/* Modern Professional CV Portfolio - Simplified */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

/* Preload Persian fonts for better performance */
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/vazirmatn/v33/Dxxo8j6PP2D_p4k9P4yR9zHlFEVzN5.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE80-FEFC;
}

/* CSS Variables */
:root {
    /* Colors */
    --primary: #6366f1;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Background */
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --font-persian: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Border Colors */
    --border-color: rgba(255, 255, 255, 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Font Loading Optimization */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/jetbrainsmono/v18/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxTOlOV.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

* {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    font-size: 16px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    direction: rtl;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
    animation: backgroundPulse 15s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes backgroundPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(99, 102, 241, 0.02) 2px,
            rgba(99, 102, 241, 0.02) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(139, 92, 246, 0.02) 2px,
            rgba(139, 92, 246, 0.02) 4px
        );
    pointer-events: none;
    z-index: 0;
    animation: gridMove 30s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

main {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* Force RTL direction for Persian content */
html[dir="rtl"], body[dir="rtl"] {
    direction: rtl;
}

/* Persian/Farsi text support */
[lang="fa"], [dir="rtl"] {
    direction: rtl;
    text-align: right;
    font-family: var(--font-persian);
}

[lang="fa"] h1, [lang="fa"] h2, [lang="fa"] h3, [lang="fa"] h4, [lang="fa"] h5, [lang="fa"] h6,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
    text-align: right;
    font-family: var(--font-persian);
    font-weight: 700;
}

[lang="fa"] p, [lang="fa"] .hero-description, [lang="fa"] .project-description, [lang="fa"] .timeline-description,
[dir="rtl"] p, [dir="rtl"] .hero-description, [dir="rtl"] .project-description, [dir="rtl"] .timeline-description {
    text-align: right;
    line-height: 1.8;
    font-family: var(--font-persian);
}

[lang="fa"] .nav-links a, [lang="fa"] .btn, [lang="fa"] .filter-btn, [lang="fa"] .action-btn,
[dir="rtl"] .nav-links a, [dir="rtl"] .btn, [dir="rtl"] .filter-btn, [dir="rtl"] .action-btn {
    font-family: var(--font-persian);
}

[lang="fa"] .section-title, [lang="fa"] .section-subtitle,
[dir="rtl"] .section-title, [dir="rtl"] .section-subtitle {
    font-family: var(--font-persian);
}




/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
    font-family: var(--font-primary);
    letter-spacing: -0.025em;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: clamp(1.875rem, 4vw, 2.5rem);
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h3 {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

p {
    color: var(--text-muted);
    margin-bottom: var(--space-4);
    font-size: 1rem;
    line-height: 1.7;
    font-weight: 400;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-4);
    }
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 15, 35, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    transition: var(--transition-normal);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) 0;
}

@media (max-width: 768px) {
    .nav-content {
        padding: var(--space-3) 0;
    }
}

@media (max-width: 480px) {
    .nav-content {
        padding: var(--space-2) 0;
    }
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    font-family: var(--font-primary);
    letter-spacing: -0.025em;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: var(--space-8);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
    font-size: 0.95rem;
    font-family: var(--font-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition-fast);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    padding-top: 80px;
    z-index: 1;
}

/* Animated Background Particles for Hero */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(99, 102, 241, 0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(139, 92, 246, 0.3), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(6, 182, 212, 0.2), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(99, 102, 241, 0.2), transparent);
    background-size: 200% 200%;
    background-position: 0% 0%, 100% 100%, 50% 50%, 100% 0%;
    animation: backgroundShift 20s ease infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes backgroundShift {
    0%, 100% {
        background-position: 0% 0%, 100% 100%, 50% 50%, 100% 0%;
    }
    25% {
        background-position: 100% 0%, 0% 100%, 25% 75%, 0% 50%;
    }
    50% {
        background-position: 100% 100%, 0% 0%, 75% 25%, 50% 100%;
    }
    75% {
        background-position: 0% 100%, 100% 0%, 25% 50%, 100% 50%;
    }
}

@media (max-width: 768px) {
    .hero {
        padding-top: 90px;
        min-height: auto;
        padding-bottom: var(--space-8);
    }
}

@media (max-width: 480px) {
    .hero {
        padding-top: 80px;
        padding-bottom: var(--space-6);
    }
}

/* Animated Code Lines Background */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(99, 102, 241, 0.03) 2px,
            rgba(99, 102, 241, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 98px,
            rgba(139, 92, 246, 0.02) 98px,
            rgba(139, 92, 246, 0.02) 100px
        );
    pointer-events: none;
    z-index: 0;
    animation: codeLines 20s linear infinite, gridMove 25s linear infinite;
    opacity: 0.6;
}

@keyframes codeLines {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(50px);
    }
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    align-items: center;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

@media (max-width: 1024px) {
    .hero-content {
        gap: var(--space-12);
    }
}

@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        text-align: center;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .hero-text {
        text-align: center;
        padding: var(--space-4) 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .code-badge {
        font-size: 0.75rem;
        padding: var(--space-1) var(--space-3);
        margin-top: var(--space-4);
        margin-bottom: var(--space-3);
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .hero-title-code {
        font-size: clamp(1.1rem, 5vw, 2.2rem) !important;
        line-height: 1.4;
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
        padding: 0 var(--space-2);
        box-sizing: border-box;
    }
    
    .code-keyword,
    .code-variable,
    .code-operator,
    .code-string {
        display: inline;
        white-space: normal;
        word-break: break-word;
    }
    
    .subtitle {
        font-size: 1rem;
        font-family: var(--font-persian) !important;
        direction: rtl;
        text-align: right;
    }
    
    .subtitle.typing-effect {
        font-size: 1rem;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
        font-family: var(--font-persian) !important;
        direction: rtl;
        text-align: right;
    }
    
    .description {
        font-size: 1rem;
        line-height: 1.7;
        padding: 0 var(--space-2);
        box-sizing: border-box;
        max-width: 100%;
        font-family: var(--font-persian) !important;
        direction: rtl;
        text-align: right;
    }
    
    .hero-actions {
        max-width: 100%;
        width: 100%;
        gap: var(--space-2);
        margin-top: var(--space-6);
        box-sizing: border-box;
    }
    
    .btn-code-primary,
    .btn-code-secondary {
        padding: var(--space-3) var(--space-4);
        gap: var(--space-2);
        font-size: 0.875rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        min-height: 48px;
    }
    
    .btn-code-line {
        font-size: 0.7rem;
        min-width: 25px;
    }
    
    .btn-content {
        font-size: 0.875rem;
        gap: var(--space-1);
        flex: 1;
        min-width: 0;
    }
    
    .btn-arrow {
        font-size: 1rem;
        flex-shrink: 0;
    }
    
    .hero-image {
        margin-top: var(--space-4);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

.hero-text {
    position: relative;
    z-index: 2;
}

.hero-text.animate-slide-left {
    animation: slideInLeft 0.8s ease-out forwards;
    opacity: 0;
}

@media (max-width: 768px) {
    .hero-text.animate-slide-left {
        animation-duration: 0.5s;
    }
}

@media (max-width: 480px) {
    .hero-text.animate-slide-left {
        animation-duration: 0.4s;
    }
}

/* Code Badge */
.code-badge {
    display: inline-block;
    margin-bottom: var(--space-4);
    margin-top: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: #818cf8;
    animation: fadeInDown 0.8s ease-out;
    direction: ltr;
    text-align: left;
}

@media (max-width: 768px) {
    .code-badge {
        margin-top: var(--space-4);
        margin-bottom: var(--space-3);
    }
}

@media (max-width: 480px) {
    .code-badge {
        margin-top: var(--space-3);
        margin-bottom: var(--space-2);
    }
}

.code-tag {
    color: #818cf8;
    font-weight: 500;
}

/* Hero Title Code Style */
.hero-title-code {
    font-size: clamp(1.5rem, 4vw, 3.5rem);
    font-weight: 700;
    margin-bottom: var(--space-6);
    font-family: var(--font-mono) !important;
    line-height: 1.3;
    direction: ltr;
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
    text-shadow: none !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    will-change: auto;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
}

.code-keyword {
    color: #c792ea;
    font-weight: 600;
}

.code-variable {
    color: #82aaff;
    font-weight: 500;
}

.code-operator {
    color: #89ddff;
    margin: 0 var(--space-1);
}

.code-string {
    color: #c3e88d;
    font-weight: 400;
}

/* Hero Actions (New Button Style) */
.hero-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-8);
    max-width: 400px;
    width: 100%;
}

@media (max-width: 768px) {
    .hero-actions {
        max-width: 100%;
        width: 100%;
        margin-top: var(--space-6);
    }
}

/* Code-style Buttons */
.btn-code-primary,
.btn-code-secondary {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    background: rgba(15, 15, 35, 0.6);
    backdrop-filter: blur(10px);
    font-family: var(--font-persian) !important;
    direction: rtl;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.btn-code-primary {
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

.btn-code-primary:hover {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.1);
    transform: translateX(-5px);
    box-shadow: 
        0 4px 12px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-code-secondary {
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--text-primary);
}

.btn-code-secondary:hover {
    border-color: rgba(139, 92, 246, 0.6);
    background: rgba(139, 92, 246, 0.1);
    transform: translateX(-5px);
    box-shadow: 
        0 4px 12px rgba(139, 92, 246, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-code-line {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 30px;
    text-align: left;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.btn-code-primary:hover .btn-code-line,
.btn-code-secondary:hover .btn-code-line {
    opacity: 1;
    color: var(--primary);
}

.btn-content {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.btn-content i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.btn-code-primary:hover .btn-content i,
.btn-code-secondary:hover .btn-content i {
    transform: scale(1.1);
}

.btn-arrow {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    color: var(--primary);
}

.btn-code-primary:hover .btn-arrow,
.btn-code-secondary:hover .btn-arrow {
    opacity: 1;
    transform: translateX(0);
}

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

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideBottom {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes scale {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation Classes */
.animate-slide-left {
    animation: slideInLeft 0.8s ease-out forwards;
    opacity: 0;
}

.animate-slide-right {
    animation: slideInRight 0.8s ease-out forwards;
    opacity: 0;
}

.animate-slide-bottom {
    animation: slideBottom 0.8s ease-out forwards;
    opacity: 0;
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

.animate-scale {
    animation: scale 0.6s ease-out forwards;
    opacity: 0;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-delay-1 {
    animation-delay: 0.2s;
}

.animate-delay-2 {
    animation-delay: 0.4s;
}

.animate-delay-3 {
    animation-delay: 0.6s;
}

/* Optimize animations for mobile */
@media (max-width: 768px) {
    .animate-slide-left,
    .animate-slide-right,
    .animate-slide-bottom,
    .animate-fade-in,
    .animate-scale {
        animation-duration: 0.5s;
        animation-timing-function: ease-out;
    }
    
    .animate-delay-1 {
        animation-delay: 0.1s;
    }
    
    .animate-delay-2 {
        animation-delay: 0.2s;
    }
    
    .animate-delay-3 {
        animation-delay: 0.3s;
    }
    
    /* Reduce motion for better performance */
    @media (prefers-reduced-motion: reduce) {
        .animate-slide-left,
        .animate-slide-right,
        .animate-slide-bottom,
        .animate-fade-in,
        .animate-scale,
        .animate-float {
            animation: none;
            opacity: 1;
        }
    }
}

@media (max-width: 480px) {
    .animate-slide-left,
    .animate-slide-right,
    .animate-slide-bottom,
    .animate-fade-in,
    .animate-scale {
        animation-duration: 0.4s;
    }
    
    .animate-delay-1,
    .animate-delay-2,
    .animate-delay-3 {
        animation-delay: 0s;
    }
    
    .animate-float {
        animation: none;
    }
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: var(--space-6);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--font-primary);
    letter-spacing: -0.05em;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
    font-weight: 500;
    font-family: var(--font-primary);
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
    font-weight: 500;
    font-family: var(--font-persian) !important;
    direction: rtl;
    text-align: right;
}

.subtitle.typing-effect {
    font-family: var(--font-persian) !important;
    color: #82aaff;
    border-right: 2px solid #82aaff;
    padding-right: var(--space-2);
    animation: typing 3s steps(30, end), blink 0.75s step-end infinite;
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
    max-width: 100%;
    direction: rtl;
    text-align: right;
    opacity: 1;
}

@media (max-width: 768px) {
    .subtitle.typing-effect {
        animation: typing 2.5s steps(25, end), blink 0.75s step-end infinite;
    }
}

@media (max-width: 480px) {
    .subtitle.typing-effect {
        white-space: normal;
        overflow: visible;
        border-right: none;
        animation: none;
        display: block;
    }
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: var(--space-8);
    line-height: 1.7;
    font-weight: 400;
    font-family: var(--font-primary);
}

.description {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: var(--space-8);
    line-height: 1.8;
    font-weight: 400;
    font-family: var(--font-persian) !important;
    direction: rtl;
    text-align: right;
}

.hero-buttons {
    display: flex;
    gap: var(--space-4);
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: slideInRight 1s ease-out forwards;
}

@media (max-width: 768px) {
    .hero-image {
        animation-duration: 0.6s;
    }
}

@media (max-width: 480px) {
    .hero-image {
        animation-duration: 0.4s;
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.profile-image {
    width: 300px;
    height: 300px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 4px solid transparent;
    background: var(--gradient-primary) border-box;
    box-shadow: 
        0 0 0 4px var(--bg-primary),
        0 20px 40px rgba(99, 102, 241, 0.3);
    transition: var(--transition-normal);
    max-width: 100%;
}

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

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

.profile-image:hover {
    transform: scale(1.05);
    box-shadow: 
        0 0 0 4px var(--bg-primary),
        0 30px 60px rgba(99, 102, 241, 0.4);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-normal);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    letter-spacing: 0.025em;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Sections */
.section {
    padding: var(--space-24) 0;
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: var(--space-16);
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-8);
}

@media (max-width: 768px) {
    .skills-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
}

.skill-category {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    transition: var(--transition-normal);
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(99, 102, 241, 0.3);
}

.skill-category h3 {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
    font-size: 1.25rem;
}

.skill-category h3::before {
    content: '';
    width: 4px;
    height: 1.5rem;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.skill-item {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: var(--font-primary);
}

.skill-item:hover {
    background: var(--gradient-primary);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* Projects Section */
.section-header {
    text-align: center;
    margin-bottom: var(--space-16);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: var(--space-4);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--font-primary);
    letter-spacing: -0.05em;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
    font-family: var(--font-primary);
}

/* Projects Filter */
.projects-filter {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-12);
    flex-wrap: wrap;
}

.filter-btn {
    padding: var(--space-3) var(--space-6);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: var(--transition-normal);
    z-index: -1;
}

.filter-btn:hover::before {
    left: 0;
}

.filter-btn:hover {
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-8);
    grid-auto-flow: dense;
}

/* Ensure grid layout doesn't break when filtering */
.projects-grid:has(.project-card.hidden) {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* Responsive projects grid */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: var(--space-6);
    }
}

.project-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    transition: var(--transition-normal);
    position: relative;
    opacity: 1;
    transform: scale(1);
    display: block;
    will-change: transform, opacity;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.3);
}

.project-card.hidden {
    display: none !important;
}

/* Project Image Container */
.project-image-container {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: var(--bg-secondary);
}

/* Mobile Device Frame */
.mobile-device {
    position: relative;
    width: 120px;
    height: 200px;
    margin: 10px auto;
    background: #1a1a1a;
    border-radius: 20px;
    padding: 8px;
    box-shadow: 
        0 0 0 2px #333,
        0 10px 30px rgba(0, 0, 0, 0.5);
}

.mobile-screen {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.mobile-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-frame {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    border: 2px solid #333;
    pointer-events: none;
}

/* Gaming Device Frame */
.gaming-device {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 12px;
    overflow: hidden;
}

.game-screen {
    width: 100%;
    height: 100%;
    position: relative;
}

.game-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-normal);
}

.gaming-device:hover .game-overlay {
    opacity: 1;
}

.play-button {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-lg);
}

.play-button:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

/* Desktop Preview */
.desktop-preview {
    position: relative;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

.desktop-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 12px;
}

.browser-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.browser-dots {
    display: flex;
    gap: 4px;
}

.browser-dots span {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: #ff5f57;
}

.browser-dots span:nth-child(2) {
    background: #ffbd2e;
}

.browser-dots span:nth-child(3) {
    background: #28ca42;
}

/* Project Placeholder */
.project-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}

.placeholder-icon {
    font-size: 4rem;
    color: var(--text-muted);
    opacity: 0.5;
}

/* Image Placeholder */
.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    gap: var(--space-2);
}

.image-placeholder i {
    font-size: 2rem;
    opacity: 0.5;
}

.image-placeholder span {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Project Overlay */
.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-normal);
}

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

.project-actions {
    display: flex;
    gap: var(--space-4);
}

.action-btn {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: var(--gradient-primary);
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}



.detail-btn:hover {
    background: var(--accent);
}

/* Project Content */
.project-content {
    padding: var(--space-6);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.project-type-badge {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-type-badge.django {
    background: rgba(34, 139, 34, 0.2);
    color: #22c55e;
}

.project-type-badge.flutter {
    background: rgba(0, 123, 255, 0.2);
    color: #3b82f6;
}

.project-type-badge.android {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.project-type-badge.website {
    background: rgba(255, 193, 7, 0.2);
    color: #f59e0b;
}

.project-type-badge.unity {
    background: rgba(156, 39, 176, 0.2);
    color: #9c27b0;
}

.project-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: var(--radius-full);
    animation: pulse 2s infinite;
}

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

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

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation classes */
.animate {
    animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.slide-in-up {
    animation: slideInUp 0.6s ease-out forwards;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--text-primary);
    font-family: var(--font-primary);
    letter-spacing: -0.025em;
    line-height: 1.3;
}

.project-description {
    color: var(--text-muted);
    margin-bottom: var(--space-4);
    line-height: 1.6;
    font-family: var(--font-primary);
    font-size: 0.95rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

.tech-tag {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-mono);
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: var(--transition-fast);
}

.tech-tag:hover {
    background: rgba(99, 102, 241, 0.25);
    transform: scale(1.05);
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.project-date {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.view-more-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition-fast);
    font-family: var(--font-primary);
}

.view-more-btn:hover {
    color: var(--text-primary);
    transform: translateX(-2px);
}

/* Project Detail Page */
.project-detail-hero {
    padding: 8rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.project-detail-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    z-index: -1;
}

.project-detail-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    font-size: 0.9rem;
    font-family: var(--font-primary);
}

.breadcrumb-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.breadcrumb-link:hover {
    color: var(--primary);
}

.breadcrumb-separator {
    color: var(--text-muted);
    font-weight: 500;
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

.project-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-6);
    margin-bottom: var(--space-8);
    flex-wrap: wrap;
}

.project-type-badge {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-primary);
}

.project-type-badge.django {
    background: rgba(34, 139, 34, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 139, 34, 0.3);
}

.project-type-badge.flutter {
    background: rgba(0, 123, 255, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(0, 123, 255, 0.3);
}

.project-type-badge.android {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.project-type-badge.website {
    background: rgba(255, 193, 7, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.project-type-badge.unity {
    background: rgba(156, 39, 176, 0.2);
    color: #9c27b0;
    border: 1px solid rgba(156, 39, 176, 0.3);
}

.project-date {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-family: var(--font-mono);
}

.project-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-family: var(--font-primary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: var(--radius-full);
    animation: pulse 2s infinite;
}

.project-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 800;
    margin-bottom: var(--space-6);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--font-primary);
    letter-spacing: -0.05em;
    line-height: 1.2;
}

.project-description {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: var(--space-8);
    line-height: 1.7;
    font-family: var(--font-primary);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.project-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-normal);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: var(--transition-normal);
    z-index: -1;
}

.action-btn:hover::before {
    left: 0;
}

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



/* Project Detail Content */
.project-detail-content {
    padding: var(--space-24) 0;
    background: var(--bg-secondary);
    min-height: 60vh;
}

.project-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    align-items: start;
}

@media (max-width: 1024px) {
    .project-detail-grid {
        gap: var(--space-12);
    }
}

.project-image-section {
    position: sticky;
    top: var(--space-8);
}

.project-image-container {
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    background: var(--bg-primary);
}

/* Mobile Device Large */
.mobile-device-large {
    position: relative;
    width: 200px;
    height: 400px;
    margin: 0 auto;
    background: #1a1a1a;
    border-radius: 30px;
    padding: 20px 15px;
    box-shadow: 
        0 0 0 3px #333,
        0 20px 60px rgba(0, 0, 0, 0.7);
}

.mobile-screen-large {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
}

.mobile-screen-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-frame-large {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 30px;
    border: 3px solid #333;
    pointer-events: none;
}

/* Gaming Device Large */
.gaming-device-large {
    position: relative;
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 
        0 0 0 3px #ff00ff,
        0 20px 60px rgba(255, 0, 255, 0.3);
}

.game-screen-large {
    width: 100%;
    height: 100%;
    position: relative;
}

.game-screen-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-overlay-large {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-normal);
}

.gaming-device-large:hover .game-overlay-large {
    opacity: 1;
}

.play-button-large {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-xl);
}

.play-button-large:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-2xl);
}

/* Desktop Preview Large */
.desktop-preview-large {
    position: relative;
    width: 100%;
    height: 300px;
    background: #f5f5f5;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.desktop-preview-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-overlay-large {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.browser-bar-large {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.browser-dots-large {
    display: flex;
    gap: 6px;
}

.browser-dots-large span {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    background: #ff5f57;
}

.browser-dots-large span:nth-child(2) {
    background: #ffbd2e;
}

.browser-dots-large span:nth-child(3) {
    background: #28ca42;
}

.browser-url {
    flex: 1;
    background: white;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: #666;
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Project Info Section */
.project-info-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.info-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: var(--transition-normal);
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.2);
}

.info-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-6);
    color: var(--text-primary);
    font-family: var(--font-primary);
}

.info-title i {
    color: var(--primary);
    font-size: 1.125rem;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-3);
}

.tech-item {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    text-align: center;
    transition: var(--transition-fast);
}

.tech-item:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.tech-name {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

.project-info-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-muted);
    font-weight: 500;
    font-family: var(--font-primary);
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-primary);
}

.status-completed {
    color: #10b981;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.status-completed::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: var(--radius-full);
    animation: pulse 2s infinite;
}

/* Responsive for Project Detail */
@media (max-width: 768px) {
    .project-detail-grid {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }
    
    .project-image-section {
        position: static;
    }
    
    .mobile-device-large {
        width: 150px;
        height: 300px;
    }
    
    .gaming-device-large,
    .desktop-preview-large {
        height: 200px;
    }
    
    .project-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .project-meta {
        flex-direction: column;
        gap: var(--space-4);
    }
    
    .tech-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}

/* Experience Section */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient-primary);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: var(--space-12);
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-right: 50%;
    padding-right: var(--space-8);
    text-align: right;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: 50%;
    padding-left: var(--space-8);
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: var(--space-6);
    width: 16px;
    height: 16px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transform: translateX(-50%);
    box-shadow: 0 0 0 4px var(--bg-primary);
}

.timeline-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
}

.timeline-date {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: var(--space-2);
    font-family: var(--font-mono);
}

.timeline-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--text-primary);
    font-family: var(--font-primary);
    letter-spacing: -0.025em;
}

.timeline-company {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: var(--space-3);
    font-family: var(--font-primary);
}

.timeline-description {
    color: var(--text-muted);
    line-height: 1.6;
    font-family: var(--font-primary);
}

/* Contact Section */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
}

.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: var(--space-2);
    font-family: var(--font-primary);
    font-size: 0.95rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: var(--space-4);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-primary);
    transition: var(--transition-fast);
    font-size: 1rem;
    line-height: 1.5;
}

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

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

/* Loading spinner for form submission */
.fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Django Messages */
.messages-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 500px;
    width: 90%;
    pointer-events: none;
}

@media (max-width: 768px) {
    .messages-container {
        top: 70px;
        max-width: 95%;
        width: calc(100% - var(--space-4));
        left: 50%;
        transform: translateX(-50%);
    }
    
    .django-message {
        padding: var(--space-3) var(--space-4);
        font-size: 0.875rem;
    }
}

.django-message {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    box-shadow: var(--shadow-xl);
    animation: slideDownMessage 0.3s ease-out;
    pointer-events: auto;
    color: #1a1a2e;
}

@keyframes slideDownMessage {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.django-message-success {
    border-left: 4px solid #10b981;
}

.django-message-error {
    border-left: 4px solid #ef4444;
}

.django-message-warning {
    border-left: 4px solid #f59e0b;
}

.django-message-info {
    border-left: 4px solid #3b82f6;
}

.message-content {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    font-family: var(--font-persian);
    font-size: 0.95rem;
    font-weight: 500;
}

.message-content i {
    font-size: 1.25rem;
}

.django-message-success .message-content i {
    color: #10b981;
}

.django-message-error .message-content i {
    color: #ef4444;
}

.django-message-warning .message-content i {
    color: #f59e0b;
}

.django-message-info .message-content i {
    color: #3b82f6;
}

.message-close {
    background: none;
    border: none;
    color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    padding: var(--space-2);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
    font-size: 1rem;
}

.message-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.8);
}

/* Auto-hide messages after 5 seconds */
.django-message {
    animation: slideDownMessage 0.3s ease-out, slideUpMessage 0.3s ease-in 4.7s forwards;
}

@keyframes slideUpMessage {
    to {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-bottom: 0;
    }
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-12) 0;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-8);
}

.social-links {
    display: flex;
    gap: var(--space-4);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.social-link:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-2px);
}

.footer-bottom {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Language Toggle */
.language-toggle {
    display: flex;
    gap: var(--space-2);
}

.lang-btn {
    padding: var(--space-2) var(--space-4);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.lang-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

/* Admin Controls */
.admin-controls {
    position: fixed;
    top: 50%;
    right: var(--space-4);
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    z-index: 1000;
}

.control-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.control-btn:hover {
    background: var(--gradient-primary);
    color: white;
    transform: scale(1.1);
}

.control-btn.active {
    background: var(--gradient-primary);
    color: white;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 280px;
        height: calc(100vh - 70px);
        background: rgba(15, 15, 35, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: var(--space-8) var(--space-6);
        gap: var(--space-4);
        transition: right 0.3s ease-in-out;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 999;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        padding: var(--space-3) var(--space-4);
        border-radius: var(--radius-lg);
        width: 100%;
    }
    
    .nav-links a:hover {
        background: rgba(99, 102, 241, 0.1);
    }
    
    .mobile-menu-toggle {
        display: block;
        z-index: 1000;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        text-align: center;
    }
    
    .hero-text {
        text-align: center;
        padding: var(--space-4) 0;
    }
    
    .code-badge {
        font-size: 0.75rem;
        padding: var(--space-1) var(--space-3);
        margin-top: var(--space-4);
        margin-bottom: var(--space-3);
    }
    
    .hero-title-code {
        font-size: clamp(1.25rem, 5vw, 2.5rem) !important;
        line-height: 1.4;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    .subtitle.typing-effect {
        font-size: 1rem;
        max-width: 100%;
        overflow: hidden;
    }
    
    .description {
        font-size: 1rem;
        line-height: 1.7;
        padding: 0 var(--space-2);
    }
    
    .hero-actions {
        max-width: 100%;
        gap: var(--space-2);
        margin-top: var(--space-6);
    }
    
    .btn-code-primary,
    .btn-code-secondary {
        padding: var(--space-3) var(--space-4);
        gap: var(--space-3);
        font-size: 0.875rem;
    }
    
    .btn-code-line {
        font-size: 0.7rem;
        min-width: 25px;
    }
    
    .btn-content {
        font-size: 0.875rem;
        gap: var(--space-1);
    }
    
    .btn-arrow {
        font-size: 1rem;
    }
    
    .hero-image {
        justify-content: center;
        margin-top: var(--space-4);
    }
    
    .hero-buttons,
    .btn-group {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* Projects responsive */
    .projects-grid {
        grid-template-columns: 1fr !important;
        gap: var(--space-6);
    }
    
    .projects-filter {
        gap: var(--space-2);
        margin-bottom: var(--space-8);
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filter-btn {
        padding: var(--space-2) var(--space-4);
        font-size: 0.85rem;
        flex: 0 0 auto;
    }
    
    .project-image-container {
        height: 200px;
    }
    
    .mobile-device {
        width: 100px;
        height: 160px;
    }
    
    .project-content {
        padding: var(--space-4);
    }
    
    .project-actions {
        gap: var(--space-3);
    }
    
    .action-btn {
        width: 45px;
        height: 45px;
    }
    
    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    
    .project-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    
    .project-footer .view-more-btn {
        width: 100%;
        justify-content: center;
    }
    
    .timeline::before {
        left: var(--space-4);
    }
    
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: var(--space-10);
        margin-right: 0;
        padding-left: var(--space-4);
        padding-right: 0;
        text-align: right;
    }
    
    .timeline-dot {
        left: var(--space-4);
    }
    
    .footer-content {
        flex-direction: column;
        gap: var(--space-6);
        align-items: center;
    }
    
    .admin-controls {
        right: var(--space-2);
        bottom: var(--space-4);
        top: auto;
        transform: none;
        flex-direction: row;
        gap: var(--space-2);
    }
    
    .section {
        padding: var(--space-16) 0;
    }
    
    .section-title {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
        margin-bottom: var(--space-8);
    }
    
    .contact-form {
        padding: var(--space-6);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-3);
    }
    
    .hero {
        min-height: auto;
        padding-top: 60px;
        padding-bottom: var(--space-6);
    }
    
    .hero-content {
        gap: var(--space-6);
    }
    
    .hero-text {
        padding: var(--space-2) 0;
    }
    
    .code-badge {
        font-size: 0.7rem;
        padding: var(--space-1) var(--space-2);
        margin-top: var(--space-3);
        margin-bottom: var(--space-2);
    }
    
    .hero-title-code {
        font-size: clamp(0.95rem, 6vw, 1.8rem) !important;
        line-height: 1.3;
        margin-bottom: var(--space-4);
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
        padding: 0 var(--space-1);
        box-sizing: border-box;
    }
    
    .code-keyword,
    .code-variable,
    .code-operator,
    .code-string {
        display: inline;
        white-space: normal;
        word-break: break-word;
    }
    
    .subtitle {
        font-size: 0.95rem;
        margin-bottom: var(--space-4);
        font-family: var(--font-persian) !important;
        direction: rtl;
        text-align: right;
    }
    
    .subtitle.typing-effect {
        font-size: 0.9rem;
        max-width: 100%;
        white-space: normal;
        overflow: visible;
        border-right: none;
        animation: none;
        font-family: var(--font-persian) !important;
        direction: rtl;
        text-align: right;
    }
    
    .description {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: var(--space-6);
        padding: 0;
        font-family: var(--font-persian) !important;
        direction: rtl;
        text-align: right;
    }
    
    .hero-buttons,
    .btn-group {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .hero-actions {
        max-width: 100%;
        gap: var(--space-2);
        margin-top: var(--space-4);
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        padding: var(--space-4) var(--space-6);
    }
    
    .btn-code-primary,
    .btn-code-secondary {
        padding: var(--space-3) var(--space-3);
        gap: var(--space-2);
        font-size: 0.8rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        min-height: 44px;
    }
    
    .btn-code-line {
        font-size: 0.65rem;
        min-width: 20px;
    }
    
    .btn-content {
        font-size: 0.8rem;
        flex: 1;
    }
    
    .btn-content i {
        font-size: 0.9rem;
    }
    
    .btn-arrow {
        font-size: 0.9rem;
    }
    
    .profile-image {
        width: 180px;
        height: 180px;
    }
    
    .hero-image {
        margin-top: var(--space-2);
    }
    
    .projects-grid {
        grid-template-columns: 1fr !important;
        gap: var(--space-4);
    }
    
    .project-card {
        border-radius: var(--radius-xl);
    }
    
    .skills-grid {
        gap: var(--space-4);
    }
    
    .skill-category {
        padding: var(--space-6);
    }
    
    .section {
        padding: var(--space-12) 0;
    }
    
    h1 {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    
    h2 {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }
    
    .contact-form {
        padding: var(--space-4);
    }
    
    .form-input,
    .form-textarea {
        padding: var(--space-3);
        font-size: 0.95rem;
    }
    
    .navbar {
        padding: var(--space-3) 0;
    }
    
    .logo {
        font-size: 1.25rem;
    }
}

/* Image Gallery Styles */
.project-gallery {
    margin-top: var(--space-8);
}

.gallery-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.gallery-title i {
    color: var(--primary);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: var(--space-4);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

/* Image Modal Styles */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-caption {
    color: white;
    text-align: center;
    margin-top: var(--space-4);
    font-size: 1.1rem;
    font-weight: 500;
    max-width: 600px;
    line-height: 1.5;
}

/* RTL/LTR Language Support */
[dir="rtl"] .gallery-grid {
    direction: rtl;
}

[dir="ltr"] .gallery-grid {
    direction: ltr;
}

[dir="rtl"] .gallery-caption {
    text-align: right;
}

[dir="ltr"] .gallery-caption {
    text-align: left;
}

[dir="rtl"] .modal-close {
    right: auto;
    left: 0;
}

[dir="ltr"] .modal-close {
    left: auto;
    right: 0;
}

/* Responsive Gallery */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--space-3);
    }
    
    .gallery-item img {
        height: 120px;
    }
    
    .gallery-caption {
        font-size: 0.8rem;
        padding: var(--space-3);
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: var(--space-2);
    }
    
    .gallery-item img {
        height: 100px;
    }
    
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .modal-close {
        top: -30px;
        font-size: 1.5rem;
        width: 30px;
        height: 30px;
    }
}

/* Fix RTL issues on mobile */
@media (max-width: 768px) {
    [dir="rtl"] .timeline-item:nth-child(odd) .timeline-content,
    [dir="rtl"] .timeline-item:nth-child(even) .timeline-content {
        text-align: right;
    }
    
    [dir="rtl"] .project-header,
    [dir="rtl"] .project-footer {
        align-items: flex-start;
    }
}

/* ========================================
   ACHIEVEMENTS SECTION - MODERN DESIGN
   ======================================== */

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-6);
    margin-top: var(--space-12);
}

@media (max-width: 768px) {
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
}

.achievement-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.achievement-card:hover::before {
    transform: scaleX(1);
}

.achievement-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.achievement-icon {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-xl);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-6);
    position: relative;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    transition: all 0.4s ease;
}

.achievement-icon i {
    font-size: 2rem;
    color: white;
    animation: float 3s ease-in-out infinite;
}

.achievement-card:hover .achievement-icon {
    transform: rotate(10deg) scale(1.1);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.5);
}

.featured-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
    animation: pulse-gold 2s ease-in-out infinite;
}

.featured-badge i {
    font-size: 0.875rem;
    color: white;
}

@keyframes pulse-gold {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(251, 191, 36, 0.6);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

.achievement-content {
    position: relative;
    direction: rtl !important;
    text-align: right !important;
    font-family: var(--font-persian) !important;
}

.achievement-title {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: var(--space-3);
    color: var(--text-primary);
    font-family: var(--font-persian) !important;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.6;
    direction: rtl !important;
    text-align: right !important;
}

.achievement-organization {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-4);
    font-family: var(--font-persian) !important;
    direction: rtl !important;
    text-align: right !important;
}

.achievement-organization i {
    color: var(--primary);
    font-size: 0.875rem;
}

.achievement-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: var(--space-6);
    font-family: var(--font-persian) !important;
    direction: rtl !important;
    text-align: right !important;
}

.achievement-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.achievement-type {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.badge-award {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-certificate {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-honor {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-competition {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-publication {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-other {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.achievement-date {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-family: var(--font-mono);
}

.achievement-date i {
    font-size: 0.75rem;
}

/* Responsive Achievements */
@media (max-width: 768px) {
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .achievement-card {
        padding: var(--space-6);
    }
    
    .achievement-icon {
        width: 60px;
        height: 60px;
        margin-bottom: var(--space-4);
    }
    
    .achievement-icon i {
        font-size: 1.5rem;
    }
    
    .achievement-title {
        font-size: 1.25rem;
        font-family: var(--font-persian) !important;
        direction: rtl !important;
        text-align: right !important;
    }
    
    .achievement-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
}

@media (max-width: 480px) {
    .achievement-card {
        padding: var(--space-4);
    }
    
    .achievement-icon {
        width: 50px;
        height: 50px;
    }
    
    .achievement-icon i {
        font-size: 1.25rem;
    }
    
    .achievement-title {
        font-size: 1.125rem;
        font-family: var(--font-persian) !important;
        direction: rtl !important;
        text-align: right !important;
    }
}

/* ========================================
   MODERN DEVELOPER PORTFOLIO ENHANCEMENTS
   ======================================== */

/* Enhanced Hero Section with Code-like Animation */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

/* Typing Animation Effect */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #82aaff;
    }
}

/* Enhanced Developer Theme Animations */
@keyframes codeGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.6), 0 0 30px rgba(139, 92, 246, 0.4);
    }
}

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

/* Floating Code Snippets Effect */
.code-snippet {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(99, 102, 241, 0.3);
    pointer-events: none;
    z-index: 0;
    animation: floatCode 15s infinite ease-in-out;
}

@keyframes floatCode {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.2;
    }
    50% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.4;
    }
}

.typing-effect {
    display: inline-block;
    overflow: hidden;
    border-right: 3px solid var(--primary);
    white-space: nowrap;
    animation: 
        typing 3s steps(40, end),
        blink 0.75s step-end infinite;
}

/* Glassmorphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================
   PROFESSIONAL ADVANCED ANIMATIONS
   ======================================== */

/* Glow Pulse Animation */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 
            0 0 5px rgba(99, 102, 241, 0.3),
            0 0 10px rgba(99, 102, 241, 0.2),
            0 0 15px rgba(99, 102, 241, 0.1);
    }
    50% {
        box-shadow: 
            0 0 20px rgba(99, 102, 241, 0.6),
            0 0 30px rgba(99, 102, 241, 0.4),
            0 0 40px rgba(139, 92, 246, 0.3);
    }
}

.glow-effect {
    animation: glowPulse 3s ease-in-out infinite;
}

/* Gradient Shift Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer-effect {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
}

/* Rotate 3D Effect */
@keyframes rotate3D {
    0% {
        transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
    }
    25% {
        transform: perspective(1000px) rotateY(90deg) rotateX(10deg);
    }
    50% {
        transform: perspective(1000px) rotateY(180deg) rotateX(0deg);
    }
    75% {
        transform: perspective(1000px) rotateY(270deg) rotateX(-10deg);
    }
    100% {
        transform: perspective(1000px) rotateY(360deg) rotateX(0deg);
    }
}

.rotate-3d {
    animation: rotate3D 20s linear infinite;
    transform-style: preserve-3d;
}

/* Morphing Blob Animation */
@keyframes morphBlob {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

.morph-blob {
    animation: morphBlob 8s ease-in-out infinite;
}

/* Text Reveal Animation */
@keyframes textReveal {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-reveal {
    animation: textReveal 0.8s ease-out forwards;
    opacity: 0;
    will-change: opacity, transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Remove blur from hero title - Enhanced */
.hero-title-code.text-reveal {
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
    text-shadow: none !important;
    opacity: 1;
    will-change: auto;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.hero-title-code {
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
    text-shadow: none !important;
    will-change: auto;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Magnetic Hover Effect */
.magnetic-hover {
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.magnetic-hover:hover {
    transform: translateY(-5px) scale(1.02);
}

/* Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    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;
}

.ripple-effect:active::after {
    width: 300px;
    height: 300px;
    animation: ripple 0.6s ease-out;
}

/* Particle Trail Effect */
@keyframes particleTrail {
    0% {
        transform: translateY(0) translateX(0) scale(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(var(--random-x, 50px)) scale(1);
        opacity: 0;
    }
}

.particle-trail {
    position: relative;
}

.particle-trail::before,
.particle-trail::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.particle-trail:hover::before {
    animation: particleTrail 1s ease-out forwards;
    --random-x: 30px;
}

.particle-trail:hover::after {
    animation: particleTrail 1s ease-out 0.2s forwards;
    --random-x: -30px;
}

/* Neon Glow Animation */
@keyframes neonGlow {
    0%, 100% {
        text-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 15px currentColor,
            0 0 20px var(--primary);
    }
    50% {
        text-shadow: 
            0 0 10px currentColor,
            0 0 20px currentColor,
            0 0 30px currentColor,
            0 0 40px var(--primary),
            0 0 50px var(--primary);
    }
}

.neon-text {
    animation: neonGlow 2s ease-in-out infinite;
    color: var(--primary);
}

/* Liquid Animation */
@keyframes liquid {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: translateY(0);
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: translateY(-10px);
    }
    50% {
        border-radius: 70% 30% 50% 50% / 30% 50% 70% 50%;
        transform: translateY(0);
    }
    75% {
        border-radius: 40% 60% 30% 70% / 60% 40% 60% 40%;
        transform: translateY(10px);
    }
}

.liquid-effect {
    animation: liquid 8s ease-in-out infinite;
}

/* Code Typing Enhanced */
@keyframes codeTyping {
    0% {
        width: 0;
    }
    100% {
        width: 100%;
    }
}

.code-typing {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--primary);
    animation: codeTyping 3s steps(40, end), blink 0.75s step-end infinite;
}

/* Hover Scale with Shadow */
.hover-lift {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Smooth Fade In on Scroll */
.scroll-fade-in {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Animation */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* Enhanced Button Animations */
.btn-code-primary::before,
.btn-code-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.btn-code-primary:hover::before,
.btn-code-secondary:hover::before {
    left: 100%;
}

.btn-code-primary,
.btn-code-secondary {
    position: relative;
    overflow: hidden;
}

.btn-code-primary::after,
.btn-code-secondary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-code-primary:active::after,
.btn-code-secondary:active::after {
    width: 300px;
    height: 300px;
}

/* Code Badge Enhanced Animation */
.code-badge {
    position: relative;
    overflow: hidden;
}

.code-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(99, 102, 241, 0.3),
        transparent
    );
    transition: left 0.5s;
}

.code-badge:hover::before {
    left: 100%;
}

/* Profile Image Enhanced */
.profile-image {
    position: relative;
}

.profile-image::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-primary);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: glowPulse 3s ease-in-out infinite;
}

.profile-image:hover::before {
    opacity: 0.5;
}

/* Hero Title Code Enhanced */
.hero-title-code {
    position: relative;
}

.hero-title-code::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    animation: expandWidth 2s ease-out forwards;
    animation-delay: 1s;
}

@keyframes expandWidth {
    to {
        width: 100%;
    }
}

/* Section Title Animation */
.section-title {
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--gradient-primary);
    animation: expandWidth 1s ease-out forwards;
    animation-delay: 0.5s;
}

/* Card Hover Effects */
.project-card,
.achievement-card,
.skill-category {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.project-card::before,
.achievement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: inherit;
    z-index: -1;
}

.project-card:hover::before,
.achievement-card:hover::before {
    opacity: 0.1;
}

/* Smooth Scroll Indicator */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.scroll-indicator {
    animation: bounce 2s infinite;
}

/* Floating Particles */
@keyframes floatParticle {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100vh) translateX(calc(var(--random-x, 0) * 1px));
        opacity: 0;
    }
}

.floating-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(99, 102, 241, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* ========================================
   DEVELOPER-SPECIFIC ANIMATIONS
   ======================================== */

/* Terminal Cursor Blink */
@keyframes terminalCursor {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

.terminal-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--primary);
    margin-left: 2px;
    animation: terminalCursor 1s step-end infinite;
    vertical-align: baseline;
}

/* Code Compile Animation */
@keyframes compile {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.compile-effect {
    animation: compile 0.5s ease-in-out;
}

/* Binary Rain Effect */
@keyframes binaryRain {
    0% {
        transform: translateY(-100vh);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

.binary-rain {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: rgba(99, 102, 241, 0.3);
    pointer-events: none;
    animation: binaryRain 12s linear infinite;
    z-index: 0;
    animation: binaryRain 10s linear infinite;
}

/* Syntax Highlight Pulse */
@keyframes syntaxPulse {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 5px currentColor;
    }
    50% {
        opacity: 0.7;
        text-shadow: 0 0 15px currentColor, 0 0 25px currentColor;
    }
}

.code-keyword.syntax-pulse {
    animation: syntaxPulse 2s ease-in-out infinite;
}

.code-variable.syntax-pulse {
    animation: syntaxPulse 2s ease-in-out infinite 0.3s;
}

.code-string.syntax-pulse {
    animation: syntaxPulse 2s ease-in-out infinite 0.6s;
}

/* Code Line Numbers Animation */
@keyframes lineNumberAppear {
    0% {
        opacity: 0;
        transform: translateX(-10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.line-number {
    animation: lineNumberAppear 0.3s ease-out forwards;
    opacity: 0;
}

.line-number:nth-child(1) { animation-delay: 0.1s; }
.line-number:nth-child(2) { animation-delay: 0.2s; }
.line-number:nth-child(3) { animation-delay: 0.3s; }
.line-number:nth-child(4) { animation-delay: 0.4s; }
.line-number:nth-child(5) { animation-delay: 0.5s; }

/* Terminal Typing Effect */
@keyframes terminalType {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.terminal-typing {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #10b981;
    animation: terminalType 3s steps(40, end), terminalCursor 1s step-end infinite;
    font-family: var(--font-mono);
}

/* Git Commit Animation */
@keyframes gitCommit {
    0% {
        transform: translateX(-20px);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.git-commit-effect {
    animation: gitCommit 0.6s ease-out;
}

/* Code Execution Flow */
@keyframes codeFlow {
    0% {
        background-position: 0% 50%;
        opacity: 0.3;
    }
    50% {
        background-position: 100% 50%;
        opacity: 0.6;
    }
    100% {
        background-position: 0% 50%;
        opacity: 0.3;
    }
}

.code-flow {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(99, 102, 241, 0.2),
        transparent
    );
    background-size: 200% 100%;
    animation: codeFlow 3s ease-in-out infinite;
}

/* Debug Breakpoint Animation */
@keyframes breakpoint {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

.breakpoint {
    position: relative;
}

.breakpoint::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    animation: breakpoint 2s ease-in-out infinite;
}

/* Loading Spinner (Code Style) */
@keyframes codeSpinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.code-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(99, 102, 241, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: codeSpinner 1s linear infinite;
}

/* Matrix Style Digits */
@keyframes matrixFall {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

.matrix-digit {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(16, 185, 129, 0.4);
    animation: matrixFall 8s linear infinite;
    pointer-events: none;
    z-index: 0;
}

/* Code Error Flash */
@keyframes errorFlash {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(239, 68, 68, 0.2);
    }
}

.error-flash {
    animation: errorFlash 0.5s ease-in-out;
}

/* Success Check Animation */
@keyframes successCheck {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-check {
    animation: successCheck 0.5s ease-out;
}

/* Code Folding Animation */
@keyframes codeFold {
    0% {
        max-height: 0;
        opacity: 0;
    }
    100% {
        max-height: 500px;
        opacity: 1;
    }
}

.code-fold {
    overflow: hidden;
    animation: codeFold 0.5s ease-out forwards;
}

/* Terminal Prompt Animation */
@keyframes promptBlink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0.3;
    }
}

.terminal-prompt {
    color: #10b981;
    animation: promptBlink 1s step-end infinite;
}

.terminal-prompt::before {
    content: '$ ';
    color: #10b981;
}

/* Code Comment Fade */
@keyframes commentFade {
    0% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 0.3;
    }
}

.code-comment {
    animation: commentFade 3s ease-in-out infinite;
    color: rgba(107, 114, 128, 0.8);
}

/* Hex Code Animation */
@keyframes hexPulse {
    0%, 100% {
        color: rgba(99, 102, 241, 0.6);
    }
    50% {
        color: rgba(99, 102, 241, 1);
        text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    }
}

.hex-code {
    font-family: var(--font-mono);
    animation: hexPulse 2s ease-in-out infinite;
}

/* Build Progress Bar */
@keyframes buildProgress {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

.build-progress {
    height: 4px;
    background: var(--gradient-primary);
    animation: buildProgress 3s ease-out forwards;
    border-radius: var(--radius-full);
}

/* Code Diff Animation */
@keyframes diffAdd {
    0% {
        background-color: rgba(16, 185, 129, 0);
    }
    100% {
        background-color: rgba(16, 185, 129, 0.2);
    }
}

@keyframes diffRemove {
    0% {
        background-color: rgba(239, 68, 68, 0);
    }
    100% {
        background-color: rgba(239, 68, 68, 0.2);
    }
}

.diff-add {
    animation: diffAdd 0.5s ease-out forwards;
}

.diff-remove {
    animation: diffRemove 0.5s ease-out forwards;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .glow-effect,
    .morph-blob,
    .rotate-3d,
    .liquid-effect {
        animation-duration: 4s;
    }
    
    .hover-lift:hover {
        transform: translateY(-5px) scale(1.02);
    }
    
    .magnetic-hover:hover {
        transform: translateY(-3px) scale(1.01) !important;
    }
    
    .binary-rain,
    .matrix-digit {
        display: none;
    }
    
    .developer-background {
        display: none;
    }
    
    body::before,
    body::after {
        display: none;
    }
    
    .hero::before {
        display: none;
    }
}

@media (max-width: 480px) {
    .glow-effect,
    .morph-blob,
    .rotate-3d,
    .liquid-effect {
        animation: none;
    }
    
    .neon-text {
        animation: none;
        text-shadow: 0 0 10px currentColor;
    }
    
    .floating-particle {
        display: none;
    }
    
    .magnetic-hover:hover {
        transform: none !important;
    }
    
    .binary-rain,
    .matrix-digit {
        display: none;
    }
}

/* Developer Background Effects */
.developer-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.code-lines-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 98%,
            rgba(99, 102, 241, 0.05) 98%,
            rgba(99, 102, 241, 0.05) 100%
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 98%,
            rgba(139, 92, 246, 0.03) 98%,
            rgba(139, 92, 246, 0.03) 100%
        );
    animation: codeLines 30s linear infinite, gridMove 35s linear infinite;
    opacity: 0.4;
}

.binary-rain-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

/* Animated Code Snippets in Background */
.code-snippet-bg {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: rgba(99, 102, 241, 0.15);
    pointer-events: none;
    z-index: 0;
    white-space: pre;
    line-height: 1.5;
    animation: codeSnippetFloat 20s linear infinite;
}

@keyframes codeSnippetFloat {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

/* Hex Code Pattern Background */
.hex-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            30deg,
            transparent,
            transparent 50px,
            rgba(99, 102, 241, 0.02) 50px,
            rgba(99, 102, 241, 0.02) 52px
        ),
        repeating-linear-gradient(
            -30deg,
            transparent,
            transparent 50px,
            rgba(139, 92, 246, 0.02) 50px,
            rgba(139, 92, 246, 0.02) 52px
        );
    animation: hexRotate 40s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes hexRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Circuit Board Pattern */
.circuit-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: circuitMove 20s linear infinite;
    pointer-events: none;
    z-index: 0;
    opacity: 0.2;
}

@keyframes circuitMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

/* Particle Background Animation */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: particle-float 20s infinite linear;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100px) translateX(100px);
        opacity: 0;
    }
}

/* Gradient Text Animation */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-gradient {
    background-size: 200% auto;
    animation: gradient-shift 3s ease infinite;
}

/* Enhanced Button Hover Effects */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.scroll-indicator::after {
    content: '';
    width: 2px;
    height: 30px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* Enhanced Project Cards with 3D Effect */
.project-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.project-card:hover {
    transform: translateY(-12px) rotateX(2deg) rotateY(2deg);
}

/* Loading Skeleton Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Enhanced Navbar with Blur Effect */
.navbar.scrolled {
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(30px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Section Divider Animation */
.section-divider {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--primary),
        transparent
    );
    margin: var(--space-20) 0;
    opacity: 0.3;
}

/* Code Block Style Enhancement */
.code-block {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    font-family: var(--font-mono);
    overflow-x: auto;
    position: relative;
}

.code-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

/* Enhanced Animation Delays */
[data-aos] {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-aos].aos-animate {
    opacity: 1;
}

[data-aos="fade-up"] {
    transform: translateY(30px);
}

[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
}