/* style.css - Refined stylesheet for rezajalili.ir with Dark/Light mode and premium design */

/* 1. Font Definitions */
@font-face {
    font-family: 'PeydaFaNum';
    src: url('assets/fonts/PeydaWebFaNum-Regular.woff2') format('woff2'),
         url('assets/fonts/PeydaWebFaNum-Regular.woff') format('woff'),
         url('assets/fonts/PeydaFaNum-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'PeydaFaNum';
    src: url('assets/fonts/PeydaWebFaNum-Bold.woff2') format('woff2'),
         url('assets/fonts/PeydaWebFaNum-Bold.woff') format('woff'),
         url('assets/fonts/PeydaFaNum-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansXFaNum';
    src: url('assets/fonts/IRANSansXFaNum-Regular.woff2') format('woff2'),
         url('assets/fonts/IRANSansXFaNum-Regular.woff') format('woff'),
         url('assets/fonts/IRANSansXFaNum-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansXFaNum';
    src: url('assets/fonts/IRANSansXFaNum-Bold.woff2') format('woff2'),
         url('assets/fonts/IRANSansXFaNum-Bold.woff') format('woff'),
         url('assets/fonts/IRANSansXFaNum-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

/* 2. Global Variables & Design System */
:root {
    --primary: #1591DC;
    --primary-rgb: 21, 145, 220;
    --secondary: #F6850C;
    --secondary-rgb: 246, 133, 12;
    
    /* Light Mode Default Theme */
    --bg-main: #f3f4f6;
    --bg-page: #f9fafb;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-border: rgba(15, 23, 42, 0.06);
    --bg-header: rgba(249, 250, 251, 0.85);
    
    --text-main: #374151;
    --text-muted: #6b7280;
    --text-heading: #111827;
    --text-white: #111827; /* Main headers dark in light mode */
    --text-light: #ffffff;
    
    --shadow-color: rgba(31, 41, 55, 0.08);
    --shadow-sm: 0 2px 8px var(--shadow-color);
    --shadow-md: 0 10px 30px var(--shadow-color);
    --shadow-lg: 0 20px 40px rgba(31, 41, 55, 0.12);
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    
    --font-heading: 'PeydaFaNum', system-ui, -apple-system, sans-serif;
    --font-body: 'IRANSansXFaNum', system-ui, -apple-system, sans-serif;
}

/* Dark Mode Overrides */
body.dark-mode {
    --bg-main: #060a13;
    --bg-page: #0b0f19;
    --bg-card: rgba(17, 24, 39, 0.75);
    --bg-card-border: rgba(255, 255, 255, 0.08);
    --bg-header: rgba(11, 15, 25, 0.85);
    
    --text-main: #d1d5db;
    --text-muted: #9ca3af;
    --text-heading: #ffffff;
    --text-white: #ffffff;
    --text-light: #111827;
    
    --shadow-color: rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 8px var(--shadow-color);
    --shadow-md: 0 10px 30px var(--shadow-color);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* 3. Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.8;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(21, 145, 220, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(246, 133, 12, 0.04) 0%, transparent 40%);
    background-attachment: fixed;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--secondary);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-white);
    font-weight: bold;
    line-height: 1.4;
    transition: color var(--transition-normal);
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-page);
}
::-webkit-scrollbar-thumb {
    background: rgba(21, 145, 220, 0.25);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Container & Sections */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: 100px 0;
    position: relative;
}

/* Glass Card Design (Refined with glowing shadows) */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--border-radius-md);
    padding: 35px;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal), background-color var(--transition-normal);
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: rgba(21, 145, 220, 0.3);
    box-shadow: var(--shadow-lg);
}

/* Section Header */
.section-title-wrapper {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.4rem;
    position: relative;
    display: inline-block;
    padding-bottom: 20px;
    margin-bottom: 12px;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 4px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.15rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Header & Navigation Menu */
header {
    background-color: var(--bg-header);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--bg-card-border);
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    will-change: transform;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 85px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
    box-shadow: 0 0 12px rgba(21, 145, 220, 0.35);
}

.logo-text {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--text-white);
}

.logo-text span {
    color: var(--secondary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 35px;
}

.nav-link {
    color: var(--text-main);
    font-weight: 500;
    position: relative;
    padding: 10px 0;
    font-family: var(--font-heading);
    transition: color var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    right: 0;
    background-color: var(--primary);
    border-radius: 2px;
    transition: var(--transition-normal);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.header-actions-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Theme Switcher Button */
.theme-toggle-btn {
    background: var(--bg-card-border);
    border: 1px solid var(--bg-card-border);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.15rem;
    transition: var(--transition-normal);
}

.theme-toggle-btn:hover {
    background: var(--primary);
    color: white;
    transform: rotate(30deg);
}

.btn-cta-header {
    background: linear-gradient(135deg, var(--primary) 0%, #0c7bcf 100%);
    color: white !important;
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    font-weight: bold;
    font-size: 0.95rem;
    font-family: var(--font-heading);
    box-shadow: 0 4px 15px rgba(21, 145, 220, 0.35);
    transition: var(--transition-normal);
}

.btn-cta-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(21, 145, 220, 0.5);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    font-weight: bold;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: var(--transition-normal);
    border: none;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #0c7bcf 100%);
    color: white !important;
    box-shadow: 0 5px 18px rgba(21, 145, 220, 0.35);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(21, 145, 220, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, #d87004 100%);
    color: white !important;
    box-shadow: 0 5px 18px rgba(246, 133, 12, 0.35);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(246, 133, 12, 0.5);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--text-white) !important;
}

.btn-outline:hover {
    background: rgba(21, 145, 220, 0.1);
    transform: translateY(-3px);
    color: var(--primary) !important;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 130px;
    overflow: visible;
    z-index: 10;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 60px;
    align-items: center;
}

.hero-content h2 {
    color: var(--secondary);
    font-size: 1.6rem;
    font-weight: bold;
    margin-bottom: 12px;
}

.hero-content h1 {
    font-size: 3.8rem;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero-content h1 span {
    background: linear-gradient(to left, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content .bio-text {
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 40px;
    text-align: justify;
    line-height: 2;
}

.hero-actions {
    display: flex;
    gap: 20px;
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-img-container {
    width: 340px;
    height: 340px;
    border-radius: 50%;
    overflow: hidden;
    border: 6px solid rgba(21, 145, 220, 0.25);
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow-lg);
    animation: morph 8s ease-in-out infinite alternate;
}

.hero-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.hero-img-container:hover img {
    transform: scale(1.1) rotate(-3deg);
}

.hero-backdrop {
    position: absolute;
    width: 390px;
    height: 390px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(21,145,220,0.18) 0%, rgba(246,133,12,0.06) 70%, transparent 100%);
    z-index: 1;
    animation: rotateBackdrop 20s linear infinite;
}

@keyframes morph {
    0% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

@keyframes rotateBackdrop {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Values Grid */
.values-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
}

.value-card {
    text-align: center;
    border-top: 4px solid var(--primary);
}

.value-card:nth-child(2) {
    border-top-color: var(--secondary);
}

.value-card:nth-child(3) {
    border-top-color: var(--primary);
}

.value-icon-wrapper {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    background: rgba(21, 145, 220, 0.08);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px auto;
    font-size: 2.2rem;
    border: 1px solid rgba(21, 145, 220, 0.15);
    transition: var(--transition-normal);
}

.value-card:nth-child(2) .value-icon-wrapper {
    background: rgba(246, 133, 12, 0.08);
    color: var(--secondary);
    border-color: rgba(246, 133, 12, 0.15);
}

.value-card:hover .value-icon-wrapper {
    background: var(--primary);
    color: white;
    transform: scale(1.1) rotate(12deg);
    box-shadow: 0 0 25px rgba(21, 145, 220, 0.35);
}

.value-card:nth-child(2):hover .value-icon-wrapper {
    background: var(--secondary);
    color: white;
    box-shadow: 0 0 25px rgba(246, 133, 12, 0.35);
}

.value-card h3 {
    font-size: 1.4rem;
    margin-bottom: 18px;
}

.value-card p {
    color: var(--text-muted);
    font-size: 1rem;
    text-align: justify;
    line-height: 1.8;
}

/* Datepicker Font Override */
.pdatepicker,
.pdatepicker *,
.persian-datepicker-red,
.persian-datepicker-red *,
.datepicker-container,
.datepicker-container * {
    font-family: var(--font-body) !important;
}

/* Redesigned Expertise Pillars Grid */
.expertise-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.expertise-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--border-radius-md);
    padding: 40px 30px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal), background-color var(--transition-normal);
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.expertise-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0.8;
}

.expertise-card:hover {
    transform: translateY(-8px);
    border-color: rgba(21, 145, 220, 0.35);
    box-shadow: 0 15px 45px rgba(21, 145, 220, 0.15);
}

.expertise-bg-num {
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 6rem;
    font-weight: 900;
    font-family: var(--font-heading);
    color: var(--primary);
    opacity: 0.05;
    line-height: 1;
    z-index: -1;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.expertise-card:hover .expertise-bg-num {
    opacity: 0.12;
}

.expertise-icon-box {
    width: 70px;
    height: 70px;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(135deg, rgba(21, 145, 220, 0.1) 0%, rgba(246, 133, 12, 0.05) 100%);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 25px;
    border: 1px solid rgba(21, 145, 220, 0.15);
    transition: var(--transition-normal);
}

.expertise-card:hover .expertise-icon-box {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    transform: scale(1.05);
}

.expertise-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-white);
    line-height: 1.5;
}

.expertise-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.8;
    text-align: justify;
    margin-bottom: 25px;
    flex-grow: 1;
}

.expertise-bullets {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid var(--bg-card-border);
    padding-top: 20px;
}

.expertise-bullets li {
    font-size: 0.9rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.expertise-bullets li i {
    color: var(--secondary);
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* Projects Showcase */
.projects-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 35px;
}

.project-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.project-category {
    font-size: 0.85rem;
    background: rgba(246, 133, 12, 0.1);
    color: var(--secondary);
    padding: 6px 16px;
    border-radius: 30px;
    font-weight: bold;
}

body.dark-mode .project-category {
    background: rgba(246, 133, 12, 0.2);
}

.project-icon {
    color: var(--primary);
    font-size: 1.65rem;
}

.project-card h3 {
    font-size: 1.45rem;
    margin-bottom: 15px;
}

.project-card p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 25px;
    flex-grow: 1;
    text-align: justify;
    line-height: 1.8;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--bg-card-border);
    padding-top: 20px;
}

.project-tag {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.project-link {
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
}

.project-link i {
    font-size: 0.8rem;
    transition: transform var(--transition-fast);
}

.project-link:hover i {
    transform: translateX(-5px);
}

/* Experience & Job Timeline */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 50px auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    top: 0;
    bottom: 0;
    right: 35px;
    opacity: 0.3;
}

.timeline-item {
    position: relative;
    padding-right: 80px;
    margin-bottom: 50px;
}

.timeline-badge {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-page);
    border: 4px solid var(--primary);
    top: 8px;
    right: 23px;
    z-index: 5;
    box-shadow: 0 0 12px rgba(21, 145, 220, 0.6);
    transition: var(--transition-normal);
}

.timeline-item:nth-child(2n) .timeline-badge {
    border-color: var(--secondary);
    box-shadow: 0 0 12px rgba(246, 133, 12, 0.6);
}

.timeline-item:hover .timeline-badge {
    transform: scale(1.2);
    background: var(--secondary);
    border-color: var(--primary);
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--border-radius-md);
    padding: 30px;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.timeline-item:hover .timeline-content {
    border-color: rgba(21, 145, 220, 0.3);
    transform: translateX(-5px);
    box-shadow: var(--shadow-lg);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.timeline-role {
    font-size: 1.35rem;
    font-weight: bold;
    color: var(--text-white);
}

.timeline-company {
    color: var(--primary);
    font-weight: bold;
    font-size: 1.1rem;
}

.timeline-years {
    background: var(--bg-card-border);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: bold;
}

.timeline-desc {
    color: var(--text-main);
    font-size: 1.05rem;
    text-align: justify;
    line-height: 1.8;
}

/* Academic & Courses Cards */
.education-section {
    background: rgba(22, 31, 54, 0.05);
    border-radius: var(--border-radius-lg);
    padding: 60px 45px;
    margin-top: 60px;
    border: 1px solid var(--bg-card-border);
}

body.dark-mode .education-section {
    background: rgba(22, 31, 54, 0.2);
}

.edu-courses-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 50px;
}

.edu-list, .courses-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.edu-card {
    display: flex;
    gap: 25px;
}

.edu-icon-container {
    width: 65px;
    height: 65px;
    border-radius: var(--border-radius-sm);
    background: rgba(21, 145, 220, 0.08);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    flex-shrink: 0;
    border: 1px solid rgba(21, 145, 220, 0.15);
}

.edu-card:hover .edu-icon-container {
    background: var(--primary);
    color: white;
}

.edu-details h4 {
    font-size: 1.25rem;
    margin-bottom: 5px;
}

.edu-details .inst {
    color: var(--primary);
    font-weight: bold;
    font-size: 1.05rem;
    margin-bottom: 5px;
}

.edu-details .years {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: inline-block;
    margin-top: 5px;
}

.course-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 25px;
    border-radius: var(--border-radius-md);
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    transition: var(--transition-normal);
}

.course-card:hover {
    background: rgba(246, 133, 12, 0.08);
    border-color: rgba(246, 133, 12, 0.25);
    transform: translateX(-5px);
}

.course-card i {
    color: var(--secondary);
    font-size: 1.4rem;
}

.course-info h4 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.course-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Category Filter Bar */
.filter-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 50px;
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    color: var(--text-main);
    padding: 10px 12px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    transition: var(--transition-normal);
}

.filter-btn:hover {
    background: rgba(21, 145, 220, 0.08);
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: white !important;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(21, 145, 220, 0.4);
}

/* Form Styles */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-white);
}

.form-control {
    width: 100%;
    background: var(--bg-page);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--border-radius-sm);
    padding: 14px 20px;
    color: var(--text-white);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition-normal);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(21, 145, 220, 0.25);
}

textarea.form-control {
    resize: vertical;
    min-height: 140px;
}

.booking-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Footer Section */
footer {
    background: var(--bg-main);
    border-top: 1px solid var(--bg-card-border);
    padding: 60px 0;
    color: var(--text-muted);
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 60px;
    margin-bottom: 50px;
}

.footer-about h3 {
    margin-bottom: 18px;
    font-size: 1.6rem;
    color: var(--text-white);
}

.footer-about p {
    max-width: 550px;
    text-align: justify;
    line-height: 1.9;
}

.footer-contact h4 {
    margin-bottom: 25px;
    font-size: 1.25rem;
    color: var(--text-white);
}

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.footer-contact-item i {
    color: var(--primary);
    font-size: 1.2rem;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.social-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    border: 1px solid var(--bg-card-border);
    transition: var(--transition-normal);
}

.social-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px) rotate(360deg);
    box-shadow: 0 0 15px rgba(21, 145, 220, 0.45);
}

.social-btn.tg:hover {
    background: #0088cc;
}

.social-btn.li:hover {
    background: #0077b5;
}

.footer-bottom {
    border-top: 1px solid var(--bg-card-border);
    padding-top: 30px;
    text-align: center;
    font-size: 0.95rem;
}

/* Alert Styles */
.alert {
    padding: 18px 25px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 30px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 15px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #10b981;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

/* Bottom Navigation for Mobile */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    background: var(--bg-header);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--bg-card-border);
    z-index: 1000;
    padding: 12px 0;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    will-change: transform;
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    gap: 4px;
    font-family: var(--font-heading);
    transition: var(--transition-fast);
}

.bottom-nav-item i {
    font-size: 1.35rem;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--primary);
}

/* Admin Dashboard CSS */
.admin-login-card {
    max-width: 440px;
    margin: 100px auto;
}

.admin-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    margin-top: 120px;
    min-height: 75vh;
}

.admin-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--border-radius-md);
    padding: 25px;
    align-self: flex-start;
}

.admin-sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    border-radius: var(--border-radius-sm);
    color: var(--text-main);
    font-weight: bold;
    transition: var(--transition-normal);
}

.admin-sidebar-link:hover,
.admin-sidebar-link.active {
    background: rgba(21, 145, 220, 0.1);
    color: var(--primary);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--bg-card-border);
    padding-bottom: 25px;
    margin-bottom: 35px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 25px;
}

.admin-table th,
.admin-table td {
    padding: 18px 20px;
    text-align: right;
    border-bottom: 1px solid var(--bg-card-border);
}

.admin-table th {
    font-family: var(--font-heading);
    color: var(--text-white);
    background: var(--bg-card-border);
    font-weight: bold;
}

.admin-table tr:hover {
    background: var(--bg-card-border);
}

.badge-topic {
    background: rgba(246, 133, 12, 0.15);
    color: var(--secondary);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: bold;
}

.about-bio-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: center;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.55fr;
    gap: 45px;
}

@media (max-width: 992px) {
    /* Disable transitions/animations and shadows on mobile/tablet to prevent rendering flicker on scroll */
    body,
    header,
    .bottom-nav,
    .logo-img,
    .bottom-nav-item {
        transition: none !important;
        animation: none !important;
    }
    
    .logo-img {
        box-shadow: none !important;
    }

    .hero-backdrop {
        animation: none !important;
    }
    
    .hero-img-container {
        animation: none !important;
        border-radius: 50% !important;
    }

    header,
    .bottom-nav {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: var(--bg-page) !important;
    }

    @media (max-height: 480px) {
        .bottom-nav {
            display: none !important;
        }
    }

    .about-bio-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    
    .about-bio-grid div:last-child {
        order: -1;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .values-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .edu-courses-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .header-container .btn-cta-header {
        display: none;
    }
    
    .expertise-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    section {
        padding: 60px 0;
    }
    
    header {
        height: 70px;
    }
    
    .header-container {
        height: 70px;
    }
    
    .nav-menu {
        display: none;
    }
    
    body {
        padding-bottom: 90px;
    }
    
    .bottom-nav {
        display: block;
    }
    
    .timeline::after {
        right: 20px;
    }
    
    .timeline-item {
        padding-right: 50px;
    }
    
    .timeline-badge {
        right: 10px;
        width: 20px;
        height: 20px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .booking-grid {
        grid-template-columns: 1fr;
    }
    
    .expertise-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .expertise-card {
        padding: 30px 20px;
        text-align: center;
    }
    
    .expertise-bg-num {
        font-size: 5rem;
    }
    
    .expertise-icon-box {
        margin: 0 auto 20px auto;
    }
    
    .expertise-bullets li {
        justify-content: flex-start;
    }
}

/* Resume Dropdown Styling */
.dropdown-wrapper {
    position: relative;
    display: inline-block;
    z-index: 100;
}

.dropdown-menu-list {
    display: none;
    position: absolute;
    top: 105%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--border-radius-sm);
    min-width: 190px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    padding: 8px 0;
    text-align: right;
}

.dropdown-menu-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-main) !important;
    font-size: 0.9rem;
    font-weight: bold;
    transition: var(--transition-fast);
}

.dropdown-menu-list a:hover {
    background: var(--bg-card-border);
    color: var(--primary) !important;
}

.dropdown-wrapper:hover .dropdown-menu-list,
.dropdown-wrapper.active .dropdown-menu-list {
    display: block;
}

/* Process Flow Visualizer Styling */
.flow-steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.flow-step-item {
    background: var(--bg-page);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--border-radius-md);
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: var(--transition-normal);
}

.flow-step-item:hover,
.flow-step-item.active {
    background: var(--bg-card);
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.flow-step-item.active {
    box-shadow: 0 0 15px rgba(21, 145, 220, 0.2);
}

.flow-step-num {
    position: absolute;
    top: -15px;
    right: 50%;
    transform: translateX(50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(21, 145, 220, 0.4);
    font-family: var(--font-heading);
}

.flow-step-icon {
    font-size: 1.8rem;
    color: var(--primary);
    margin: 15px 0 10px 0;
    transition: var(--transition-fast);
}

.flow-step-item:hover .flow-step-icon,
.flow-step-item.active .flow-step-icon {
    color: var(--secondary);
    transform: scale(1.1);
}

.flow-step-item h4 {
    font-size: 1.05rem;
    margin-bottom: 8px;
    color: var(--text-white);
}

.flow-step-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.flow-step-inline-detail {
    display: none;
}

.flow-step-arrow {
    position: absolute;
    top: 50%;
    left: -22px;
    transform: translateY(-50%);
    color: var(--primary);
    opacity: 0.4;
    font-size: 1.2rem;
    pointer-events: none;
}

.flow-detail-box {
    background: var(--bg-page);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--border-radius-md);
    padding: 30px;
    border-right: 5px solid var(--secondary);
    animation: fadeIn 0.4s ease;
}

.flow-detail-box h4 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--secondary);
}

.flow-detail-box p {
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.8;
    text-align: justify;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 992px) {
    .flow-steps-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .flow-step-item {
        padding: 15px 20px;
        text-align: right;
        display: block;
    }
    
    .flow-step-icon {
        display: inline-block;
        vertical-align: middle;
        margin: 0 0 0 15px;
        font-size: 1.5rem;
    }
    
    .flow-step-item h4 {
        display: inline-block;
        vertical-align: middle;
        font-size: 1.05rem;
        margin: 0;
    }
    
    .flow-step-item p.flow-step-desc-short {
        margin-top: 8px;
        font-size: 0.85rem;
        color: var(--text-muted);
        text-align: right;
    }
    
    .flow-step-num {
        left: 20px;
        right: auto;
        top: -15px;
        transform: none;
    }
    
    .flow-step-arrow {
        display: none;
    }
    
    .flow-detail-box {
        display: none !important;
    }
    
    /* Inline Detail Expansion */
    .flow-step-item.active .flow-step-inline-detail {
        display: block;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid var(--bg-card-border);
        text-align: right;
        animation: fadeIn 0.3s ease;
    }
    
    .flow-step-inline-detail h4 {
        color: var(--secondary);
        font-size: 0.95rem;
        margin-bottom: 8px;
        font-weight: bold;
    }
    
    .flow-step-inline-detail p {
        color: var(--text-main);
        font-size: 0.85rem;
        line-height: 1.6;
        text-align: justify;
        margin: 0;
    }
}

/* ==========================================
   8. LTR Layout Overrides (For English)
   ========================================== */
html[dir="ltr"] body {
    direction: ltr !important;
    text-align: left !important;
}

html[dir="ltr"] h1,
html[dir="ltr"] h2,
html[dir="ltr"] h3,
html[dir="ltr"] h4,
html[dir="ltr"] h5,
html[dir="ltr"] h6,
html[dir="ltr"] p,
html[dir="ltr"] span,
html[dir="ltr"] div,
html[dir="ltr"] section {
    text-align: left !important;
}

html[dir="ltr"] .section-title-wrapper,
html[dir="ltr"] .section-title,
html[dir="ltr"] .section-subtitle {
    text-align: center !important;
}

html[dir="ltr"] .hero-content h1,
html[dir="ltr"] .hero-content h2,
html[dir="ltr"] .hero-content p {
    text-align: left !important;
}

html[dir="ltr"] .logo-wrapper {
    margin-right: 0 !important;
    margin-left: 0 !important;
}

html[dir="ltr"] .nav-menu {
    gap: 30px !important;
}

html[dir="ltr"] .dropdown-menu-list {
    right: auto !important;
    left: 0 !important;
    text-align: left !important;
}

html[dir="ltr"] .dropdown-menu-list a {
    text-align: left !important;
}

html[dir="ltr"] .expertise-bullets li {
    justify-content: flex-start !important;
}

html[dir="ltr"] .admin-table th,
html[dir="ltr"] .admin-table td {
    text-align: left !important;
}

html[dir="ltr"] .admin-sidebar {
    border-left: 1px solid var(--bg-card-border) !important;
    border-right: none !important;
}

html[dir="ltr"] .flow-step-arrow {
    left: auto !important;
    right: -22px !important;
    transform: translateY(-50%) rotate(180deg) !important;
}

html[dir="ltr"] .flow-detail-box {
    border-right: none !important;
    border-left: 5px solid var(--secondary) !important;
}

html[dir="ltr"] .timeline::after {
    right: auto !important;
    left: 35px !important;
}

html[dir="ltr"] .timeline-item {
    padding-right: 0 !important;
    padding-left: 80px !important;
}

html[dir="ltr"] .timeline-badge {
    right: auto !important;
    left: 24px !important;
}

html[dir="ltr"] .timeline-item:hover .timeline-content {
    transform: translateX(5px) !important;
}

html[dir="ltr"] .course-card:hover {
    transform: translateX(5px) !important;
}

html[dir="ltr"] .project-link:hover i {
    transform: translateX(5px) !important;
}

html[dir="ltr"] .pdatepicker {
    direction: ltr !important;
    text-align: left !important;
}

@media (max-width: 992px) {
    html[dir="ltr"] .hero-content h1,
    html[dir="ltr"] .hero-content h2,
    html[dir="ltr"] .hero-content p {
        text-align: center !important;
    }

    html[dir="ltr"] .flow-step-item {
        text-align: left !important;
    }
    
    html[dir="ltr"] .flow-step-icon {
        margin: 0 15px 0 0 !important;
    }
    
    html[dir="ltr"] .flow-step-item h4 {
        text-align: left !important;
    }
    
    html[dir="ltr"] .flow-step-item p.flow-step-desc-short {
        text-align: left !important;
    }
    
    html[dir="ltr"] .flow-step-num {
        left: auto !important;
        right: 20px !important;
    }
    
    html[dir="ltr"] .flow-step-item.active .flow-step-inline-detail {
        text-align: left !important;
    }
    
    html[dir="ltr"] .expertise-bullets li {
        justify-content: flex-start !important;
    }
}

/* ==========================================
   9. Language Selector Pill Styles
   ========================================== */
.lang-selector-group {
    display: flex;
    align-items: center;
    background: var(--bg-card-border);
    border: 1px solid var(--bg-card-border);
    border-radius: 30px;
    padding: 3px;
    gap: 1px;
}

.lang-selector-btn {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted) !important;
    padding: 5px 9px;
    border-radius: 20px;
    transition: var(--transition-fast);
    line-height: 1;
    text-align: center;
    display: inline-block;
    letter-spacing: 0.5px;
}

.lang-selector-btn:hover {
    color: var(--text-white) !important;
    background: rgba(255, 255, 255, 0.04);
}

.lang-selector-btn.active {
    background: var(--primary);
    color: white !important;
    box-shadow: 0 2px 8px rgba(21, 145, 220, 0.3);
}

@media (max-width: 480px) {
    .lang-selector-btn {
        padding: 4px 7px;
        font-size: 0.68rem;
    }
}

/* Footer Contact LTR Adjustment */
html[dir="ltr"] .footer-contact .footer-contact-item:last-child {
    flex-direction: row-reverse !important;
    justify-content: flex-end !important;
}
