/* ===== INTRO OVERLAY ===== */
.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #0a1e1a 0%, #0d2d2d 50%, #0a1e1a 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.intro-overlay.hidden {
    pointer-events: none;
}

#particleCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.intro-particles-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.1), transparent 70%);
    pointer-events: none;
    z-index: 2;
}

.intro-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 900px;
    padding: 40px;
}

/* Glitch Logo Effect */
.intro-logo {
    margin-bottom: 60px;
}

.glitch-wrapper {
    position: relative;
    display: inline-block;
}

.glitch {
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 900;
    font-family: 'Courier New', monospace;
    color: #10b981;
    position: relative;
    text-shadow:
        0 0 20px rgba(16, 185, 129, 0.8),
        0 0 40px rgba(16, 185, 129, 0.6),
        0 0 60px rgba(16, 185, 129, 0.4);
    animation: glitch-skew 3s infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #0ff;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #ff00ff, 2px 2px #0ff;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(10px, 9999px, 80px, 0); }
    10% { clip: rect(90px, 9999px, 30px, 0); }
    20% { clip: rect(50px, 9999px, 70px, 0); }
    30% { clip: rect(20px, 9999px, 60px, 0); }
    40% { clip: rect(80px, 9999px, 10px, 0); }
    50% { clip: rect(30px, 9999px, 90px, 0); }
    60% { clip: rect(70px, 9999px, 40px, 0); }
    70% { clip: rect(40px, 9999px, 20px, 0); }
    80% { clip: rect(60px, 9999px, 50px, 0); }
    90% { clip: rect(15px, 9999px, 85px, 0); }
    100% { clip: rect(75px, 9999px, 35px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 90px, 0); }
    10% { clip: rect(25px, 9999px, 40px, 0); }
    20% { clip: rect(85px, 9999px, 15px, 0); }
    30% { clip: rect(45px, 9999px, 75px, 0); }
    40% { clip: rect(5px, 9999px, 55px, 0); }
    50% { clip: rect(95px, 9999px, 25px, 0); }
    60% { clip: rect(35px, 9999px, 65px, 0); }
    70% { clip: rect(55px, 9999px, 5px, 0); }
    80% { clip: rect(75px, 9999px, 45px, 0); }
    90% { clip: rect(20px, 9999px, 80px, 0); }
    100% { clip: rect(50px, 9999px, 30px, 0); }
}

@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    10% { transform: skew(-1deg); }
    20% { transform: skew(1deg); }
    30% { transform: skew(-0.5deg); }
    40% { transform: skew(0.5deg); }
    50% { transform: skew(-0.8deg); }
    60% { transform: skew(0.8deg); }
    70% { transform: skew(-0.3deg); }
    80% { transform: skew(0.3deg); }
    90% { transform: skew(-0.6deg); }
    100% { transform: skew(0deg); }
}

/* Intro Text */
.intro-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(30px);
}

.intro-title .word {
    display: inline-block;
    margin: 0 10px;
    opacity: 0;
    transform: translateY(30px);
}

.intro-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: #10b981;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(20px);
}

/* Loader */
.intro-loader {
    margin: 60px auto 40px;
    max-width: 400px;
    opacity: 0;
}

.loader-bar {
    width: 100%;
    height: 4px;
    background: rgba(16, 185, 129, 0.2);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.loader-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10b981, #0f766e, #10b981);
    background-size: 200% 100%;
    animation: loader-glow 2s linear infinite;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
}

@keyframes loader-glow {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loader-percentage {
    text-align: center;
    color: #10b981;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 15px;
    font-family: 'Courier New', monospace;
}

/* Enter Button */
.intro-enter-btn {
    margin-top: 40px;
    padding: 18px 50px;
    background: linear-gradient(135deg, #10b981, #0f766e);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 10px 40px rgba(16, 185, 129, 0.3),
        0 0 60px rgba(16, 185, 129, 0.2);
    position: relative;
    overflow: hidden;
}

.intro-enter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.intro-enter-btn:hover::before {
    width: 300px;
    height: 300px;
}

.intro-enter-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow:
        0 15px 50px rgba(16, 185, 129, 0.5),
        0 0 80px rgba(16, 185, 129, 0.3);
}

.intro-enter-btn span,
.intro-enter-btn i {
    position: relative;
    z-index: 1;
}

.intro-enter-btn i {
    transition: transform 0.3s;
}

.intro-enter-btn:hover i {
    transform: translateX(5px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .intro-content {
        padding: 20px;
    }

    .intro-logo {
        margin-bottom: 40px;
    }

    .intro-title {
        margin-bottom: 15px;
    }

    .intro-title .word {
        margin: 0 5px;
    }

    .intro-loader {
        margin: 40px auto 30px;
        max-width: 300px;
    }

    .intro-enter-btn {
        padding: 15px 40px;
        font-size: 1.1rem;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .intro-subtitle {
        letter-spacing: 2px;
    }

    .intro-loader {
        margin: 30px auto 20px;
    }

    .intro-enter-btn {
        padding: 12px 35px;
        font-size: 1rem;
    }
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #10b981;
    --secondary-color: #0f766e;
    --accent-color: #34d399;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-light: #718096;
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-tertiary: #e0f2f1;
    --bg-quaternary: #b2dfdb;
    --bg-dark: #1a202c;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --code-bg: #1a202c;
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode variables */
[data-theme="dark"] {
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-light: #cbd5e0;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #1e3a3a;
    --bg-quaternary: #0d2d2d;
    --bg-dark: #0f172a;
    --border-color: #334155;
    --card-bg: #1e293b;
    --code-bg: #0f172a;
    --navbar-bg: rgba(15, 23, 42, 0.95);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease-in-out;
}

/* Language switching transitions */
body.lang-switching {
    opacity: 0.7;
}

/* Theme switching transitions */
body.theme-switching {
    opacity: 0.9;
}

/* Smooth transitions for theme changes */
.navbar,
.nav-menu,
.theme-toggle,
.language-switcher,
.lang-btn,
.hero,
.social-link,
.code-snippet,
.skill-category,
.stat-item,
.filter-btn,
.project-card,
.project-link,
.timeline-content,
.contact-item,
.form-group input,
.form-group textarea,
.footer {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-i18n],
.section-title,
.about-lead,
.about-text p,
.stat-label,
.skill-category h3,
.filter-btn,
.project-info h3,
.project-info p,
.timeline-date,
.timeline-content h3,
.timeline-content h4,
.timeline-content p,
.timeline-content ul li,
.contact-intro,
.contact-item h4,
.contact-item p,
input::placeholder,
textarea::placeholder,
.footer p {
    transition: opacity 0.2s ease-in-out;
}

body.lang-switching [data-i18n],
body.lang-switching .section-title,
body.lang-switching .about-lead,
body.lang-switching .about-text p,
body.lang-switching .stat-label,
body.lang-switching .skill-category h3,
body.lang-switching .filter-btn,
body.lang-switching .project-info h3,
body.lang-switching .project-info p,
body.lang-switching .timeline-date,
body.lang-switching .timeline-content h3,
body.lang-switching .timeline-content h4,
body.lang-switching .timeline-content p,
body.lang-switching .timeline-content ul li,
body.lang-switching .contact-intro,
body.lang-switching .contact-item h4,
body.lang-switching .contact-item p,
body.lang-switching .footer p {
    opacity: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    color: var(--text-primary);
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    margin: 15px auto 0;
    border-radius: 2px;
}

/* ===== NAVIGATION ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--navbar-bg);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.nav-brand .logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transition: var(--transition);
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: var(--transition);
    border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* When nav-controls are moved inside the mobile menu */
.mobile-nav-controls {
    display: flex;
    justify-content: center;
}

.mobile-nav-controls .nav-controls {
    justify-content: center;
}

@media (max-width: 768px) {
    .mobile-nav-controls .nav-controls {
        flex-direction: column;
        gap: 12px;
        margin-top: 10px;
    }
}

.theme-toggle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.theme-toggle i {
    transition: transform 0.3s ease;
}

[data-theme="dark"] .theme-toggle .fa-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle::before {
    content: '\f185';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.language-switcher {
    display: flex;
    gap: 5px;
    background: var(--bg-secondary);
    padding: 5px;
    border-radius: 25px;
}

.lang-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    border-radius: 20px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.lang-btn:hover:not(.active) {
    color: var(--primary-color);
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
}

[dir="rtl"] .navbar .container {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-menu {
    flex-direction: row;
}

[dir="rtl"] .nav-link::after {
    left: auto;
    right: 0;
}

[dir="rtl"] .hero-content {
    direction: rtl;
}

[dir="rtl"] .hero-buttons {
    flex-direction: row-reverse;
}

[dir="rtl"] .social-links {
    flex-direction: row-reverse;
}

[dir="rtl"] .timeline {
    padding-left: 0;
    padding-right: 50px;
}

[dir="rtl"] .timeline::before {
    left: auto;
    right: 20px;
}

[dir="rtl"] .timeline-dot {
    left: auto;
    right: -36px;
}

[dir="rtl"] .timeline-content {
    text-align: right;
}

[dir="rtl"] .timeline-content ul {
    margin-left: 0;
    margin-right: 20px;
}

[dir="rtl"] .contact-content {
    direction: rtl;
}

[dir="rtl"] .footer-content {
    flex-direction: row-reverse;
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-quaternary) 100%);
    padding-top: 80px;
}

.hero-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-particles::before,
.hero-particles::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(15, 118, 110, 0.1));
    animation: float 20s infinite ease-in-out;
}

.hero-particles::before {
    top: -200px;
    left: -200px;
}

.hero-particles::after {
    bottom: -200px;
    right: -200px;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-greeting {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    animation: fadeInUp 0.6s ease-out;
}

.hero-name {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

.hero-title-wrapper {
    min-height: 60px;
    margin-bottom: 20px;
}

.hero-title {
    font-size: 1.8rem;
    color: var(--text-secondary);
    animation: fadeInUp 0.6s ease-out 0.4s backwards;
}

.typed-text {
    color: var(--primary-color);
    font-weight: 600;
}

.cursor {
    display: inline-block;
    width: 3px;
    background-color: var(--primary-color);
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 30px;
    line-height: 1.8;
    animation: fadeInUp 0.6s ease-out 0.6s backwards;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease-out 0.8s backwards;
}

.btn {
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.social-links {
    display: flex;
    gap: 15px;
    animation: fadeInUp 0.6s ease-out 1s backwards;
}

.social-link {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    color: var(--primary-color);
    border-radius: 50%;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.social-link:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.hero-image {
    animation: fadeInRight 0.8s ease-out 0.4s backwards;
}

.image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.code-snippet {
    background: var(--code-bg);
    color: var(--text-secondary);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow-xl);
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    line-height: 1.8;
    position: relative;
    overflow: hidden;
    /* Make code block a bit wider for readability */
    min-width: 360px;
    max-width: 440px;
    /* Always keep code LTR, even when page is RTL */
    direction: ltr;
    text-align: left;
}

.code-snippet::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    pointer-events: none;
}

.code-line {
    margin: 5px 0;
}

.keyword {
    color: #c678dd;
}

.property {
    color: #e06c75;
}

.string {
    color: #98c379;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: fadeInUp 1s ease-out 1.2s backwards;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    position: relative;
}

.mouse::before {
    content: '';
    width: 4px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 2px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% {
        top: 10px;
        opacity: 1;
    }
    100% {
        top: 30px;
        opacity: 0;
    }
}

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== ABOUT SECTION ===== */
.about {
    background: var(--bg-primary);
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-text {
    animation: fadeInUp 0.6s ease-out;
}

.about-lead {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-weight: 500;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.stat-item {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-quaternary));
    border-radius: 15px;
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-number::after {
    content: '+';
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* ===== SKILLS SECTION ===== */
.skills {
    background: var(--bg-secondary);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.skill-category {
    background: var(--card-bg);
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-align: center;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.category-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 15px;
    color: white;
    font-size: 2rem;
}

.skill-category h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.skill-tag {
    /* Use theme-aware background colors so tags match light/dark themes */
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-quaternary));
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.skill-tag:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: scale(1.05);
}

/* ===== PROJECTS SECTION ===== */
.projects {
    background: var(--bg-primary);
}

.project-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 25px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    opacity: 1;
    transform: scale(1);
}

.project-card.hide {
    opacity: 0;
    transform: scale(0.8);
    height: 0;
    margin: 0;
    padding: 0;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.project-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.project-card:hover .placeholder-image {
    transform: scale(1.1);
}

/* Custom project images */
.project-custom-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: var(--transition);
}

.project-card:hover .project-custom-image {
    transform: scale(1.1);
}

/* Responsive image sizing for different screens */
@media (max-width: 1200px) {
    .project-image {
        height: 220px;
    }
}

@media (max-width: 768px) {
    .project-image {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .project-image {
        height: 180px;
    }
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-links {
    display: flex;
    gap: 20px;
}

.project-link {
    width: 50px;
    height: 50px;
    background: var(--card-bg);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    transition: var(--transition);
    font-size: 1.2rem;
}

.project-link:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: scale(1.1);
}

.project-info {
    padding: 25px;
}

.project-info h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.project-info p {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.7;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.project-tags span {
    /* Theme-aware background so tags look good in light and dark modes */
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-quaternary));
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ===== EXPERIENCE SECTION ===== */
.experience {
    background: var(--bg-secondary);
}

.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding-left: 50px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
    animation: fadeInLeft 0.6s ease-out;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-dot {
    position: absolute;
    left: -36px;
    top: 0;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    border: 4px solid var(--bg-secondary);
    z-index: 1;
}

.timeline-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.timeline-content:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-lg);
}

.timeline-date {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.timeline-content h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.timeline-content h4 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.timeline-content p {
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.7;
}

.timeline-content ul {
    margin-left: 20px;
}

.timeline-content ul li {
    color: var(--text-light);
    margin-bottom: 8px;
    line-height: 1.6;
}

/* ===== CONTACT SECTION ===== */
.contact {
    background: var(--bg-primary);
}

.contact-intro {
    text-align: center;
    max-width: 700px;
    margin: -20px auto 50px;
    font-size: 1.1rem;
    color: var(--text-light);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 50px;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.contact-item h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.contact-item p {
    color: var(--text-light);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--card-bg);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.contact-form .btn {
    align-self: flex-start;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 30px 0;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: var(--transition);
}

.footer-social a:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transform: translateY(-3px);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 968px) {
    .section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 2rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-name {
        font-size: 2.5rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-image {
        order: -1;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .timeline {
        padding-left: 40px;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--bg-primary);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-lg);
        padding: 30px 0;
        gap: 20px;
    }

    .nav-menu.active {
        left: 0;
    }

    [dir="rtl"] .nav-menu {
        /* Override global RTL row-reverse for mobile: stack items vertically */
        flex-direction: column;
        left: auto;
        right: -100%;
    }

    [dir="rtl"] .nav-menu.active {
        right: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .hero {
        min-height: auto;
        padding: 100px 0 60px;
    }

    .hero-name {
        font-size: 2rem;
    }

    .hero-title {
        font-size: 1.3rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        text-align: center;
    }

    .code-snippet {
        padding: 20px;
        font-size: 0.9rem;
    }

    .about-stats {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .section {
        padding: 40px 0;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .hero-name {
        font-size: 1.8rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .project-filters {
        gap: 10px;
    }

    .filter-btn {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
}

/* ===== UTILITY CLASSES ===== */
.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

.visible {
    opacity: 1;
    transform: translateY(0);
}
