/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Performance Optimizations */
*,
*::before,
*::after {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile-First Optimizations */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
}

/* Better touch targets for mobile */
button,
a,
input,
textarea,
select {
    -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
    touch-action: manipulation;
}

/* Prevent text selection on buttons and interactive elements */
button,
.btn,
.nav-links a,
.social-icon,
.menu-toggle,
.theme-toggle,
.lang-toggle {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Smooth scrolling for mobile */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Mobile viewport fixes */
@supports (-webkit-touch-callout: none) {
    .hero,
    section {
        min-height: -webkit-fill-available;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Will-change for performance-critical animations */
.card-3d,
.floating-element,
.particle {
    will-change: transform;
}

/* GPU acceleration for smooth animations */
.card-3d,
.modal-content,
.image-modal {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* RTL/LTR Support */
html[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

html[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

/* Contact Form - From Uiverse.io by Smit-Prajapati */
.orange {
    color: #ff7a01;
}

.form-container {
    max-width: 700px;
    margin: 30px auto;
    background-color: #001925;
    padding: 30px;
    border-left: 5px solid #ff7a01;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
}

.form-container .form .heading {
    display: block;
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.form-container .form .input {
    color: #87a4b6;
    width: 100%;
    background-color: #002733;
    border: none;
    outline: none;
    padding: 10px;
    margin-bottom: 20px;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
    border-left: 1px solid transparent;
}

.form-container .form .input:focus {
    border-left: 5px solid #ff7a01;
}

.form-container .form .textarea {
    width: 100%;
    padding: 10px;
    border: none;
    outline: none;
    background-color: #013747;
    color: #ff7a01;
    font-weight: bold;
    resize: none;
    max-height: 150px;
    margin-bottom: 20px;
    border-left: 1px solid transparent;
    transition: all 0.2s ease-in-out;
}

.form-container .form .textarea:focus {
    border-left: 5px solid #ff7a01;
}

.form-container .form .button-container {
    display: flex;
    gap: 10px;
}

.form-container .form .button-container .send-button {
    flex-basis: 70%;
    background: #ff7a01;
    padding: 10px;
    color: #001925;
    text-align: center;
    font-weight: bold;
    border: 1px solid transparent;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.form-container .form .button-container .send-button:hover {
    background: transparent;
    border: 1px solid #ff7a01;
    color: #ff7a01;
}

.form-container .form .button-container .reset-button-container {
    filter: drop-shadow(1px 1px 0px #ff7a01);
    flex-basis: 30%;
}

.form-container .form .button-container .reset-button-container .reset-button {
    position: relative;
    text-align: center;
    padding: 10px;
    color: #ff7a01;
    font-weight: bold;
    background: #001925;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    border: none;
    width: 100%;
}

.form-container .form .button-container .reset-button-container .reset-button:hover {
    background: #ff7a01;
    color: #001925;
}

/* Dark theme adjustments for contact form */
[data-theme="dark"] .form-container {
    background-color: #0a1a24;
}

[data-theme="dark"] .form-container .form .input {
    background-color: #0d2330;
}

[data-theme="dark"] .form-container .form .textarea {
    background-color: #0f2a38;
}

:root {
    /* Modern Color Palette - Premium & Professional */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-900: #1e3a8a;
    
    --secondary: #10b981;
    --secondary-dark: #059669;
    --secondary-light: #34d399;
    --secondary-50: #ecfdf5;
    
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-dark: #7c3aed;
    
    --orange: #ff7a01;
    --orange-light: #ff9a3c;
    --orange-dark: #e55a00;
    
    /* Neutral Colors - Enhanced Scale */
    --dark: #0f172a;
    --light: #f8fafc;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Light Theme Variables */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-dark: rgba(255, 255, 255, 0.1);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;
    
    /* Premium Shadows - Multi-layered for depth */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-2xl: 0 30px 60px -15px rgba(0, 0, 0, 0.3);
    --shadow-colored: 0 10px 30px -5px rgba(37, 99, 235, 0.3);
    --shadow-colored-lg: 0 20px 40px -10px rgba(37, 99, 235, 0.4);
    
    /* Spacing Scale - 8px base unit */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */
    
    /* Typography Scale - Modern & Readable */
    --font-sans: 'Inter', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Inter', 'Cairo', sans-serif;
    
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */
    --text-5xl: 3rem;        /* 48px */
    --text-6xl: 3.75rem;     /* 60px */
    --text-7xl: 4.5rem;      /* 72px */
    
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    --font-black: 900;
    
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;
    
    /* Transitions - Smooth & Natural */
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-smooth: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    
    /* Easing Functions */
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Border Radius - Modern & Consistent */
    --radius-none: 0;
    --radius-sm: 0.375rem;    /* 6px */
    --radius: 0.5rem;         /* 8px */
    --radius-md: 0.75rem;     /* 12px */
    --radius-lg: 1rem;        /* 16px */
    --radius-xl: 1.5rem;      /* 24px */
    --radius-2xl: 2rem;       /* 32px */
    --radius-full: 9999px;
    
    /* Z-Index Scale */
    --z-base: 1;
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-loading: 9999;
    
    /* Layout */
    --container-max-width: 1280px;
    --section-padding-y: 6rem;
    --section-padding-y-mobile: 4rem;
}

[data-theme="dark"] {
    /* Dark Theme Variables - Premium Dark Mode */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f172a;
    --bg-tertiary: #1e293b;
    --bg-card: #1e293b;
    --bg-glass: rgba(15, 23, 42, 0.7);
    --bg-glass-dark: rgba(0, 0, 0, 0.3);
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;
    
    --border-color: #334155;
    --border-light: #475569;
    --border-dark: #1e293b;
    
    --light: #1e293b;
    
    /* Enhanced Dark Shadows */
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    --shadow-colored: 0 10px 30px -5px rgba(37, 99, 235, 0.2);
    --shadow-colored-lg: 0 20px 40px -10px rgba(37, 99, 235, 0.3);
}

/* Base Styles */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    direction: ltr;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1;
    font-kerning: normal;
}

body.loading {
    overflow: hidden;
}

/* Container - Enhanced with better spacing */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

@media (min-width: 640px) {
    .container {
        padding: 0 var(--space-8);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 var(--space-12);
    }
}

/* Typography - Modern Scale & Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    margin-bottom: var(--space-4);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 {
    font-size: var(--text-5xl);
    font-weight: var(--font-extrabold);
    line-height: var(--leading-tight);
    letter-spacing: -0.03em;
}

h2 {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    letter-spacing: -0.02em;
}

h3 {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
}

h4 {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
}

h5 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
}

h6 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
}

p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

@media (max-width: 768px) {
    h1 {
        font-size: var(--text-4xl);
    }
    
    h2 {
        font-size: var(--text-3xl);
    }
    
    h3 {
        font-size: var(--text-2xl);
    }
}

.highlight {
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Section Titles - Enhanced */
.section-title {
    text-align: center;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: var(--font-extrabold);
    margin-bottom: var(--space-12);
    position: relative;
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
    letter-spacing: -0.02em;
}

.section-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title::before {
    content: '';
    position: absolute;
    top: -var(--space-6);
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: var(--radius-full);
    opacity: 0;
    transition: opacity 0.8s var(--ease-out) 0.3s, width 0.8s var(--ease-out) 0.3s;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

.section-title.visible::before {
    opacity: 1;
    width: 100px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: calc(-1 * var(--space-4));
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    border-radius: var(--radius-full);
    transition: width 0.8s var(--ease-out) 0.5s;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.section-title.visible::after {
    width: 120px;
}

.section-subtitle {
    text-align: center;
    font-size: var(--text-lg);
    color: var(--text-muted);
    margin-bottom: var(--space-12);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: var(--leading-relaxed);
    font-weight: var(--font-medium);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--ease-out) 0.2s, transform 0.8s var(--ease-out) 0.2s;
}

.section-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn i {
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

.btn span {
    position: relative;
    z-index: 1;
}

.btn-primary {
    background: linear-gradient(135deg, #FF7A01, #E66A00);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 122, 1, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #E66A00, #FF7A01);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 122, 1, 0.5);
}

.btn-secondary {
    background: transparent;
    color: #FF7A01;
    border: 2px solid #FF7A01;
    position: relative;
    z-index: 1;
}

.btn-secondary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #FF7A01;
    transition: left 0.3s ease;
    z-index: -1;
}

.btn-secondary:hover::after {
    left: 0;
}

.btn-secondary:hover {
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 122, 1, 0.3);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-cv {
    background: #FF7A01;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
}

.btn-cv:hover {
    background: #E66A00;
    transform: translateY(-2px);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--dark) 0%, #1e293b 50%, #0f172a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    pointer-events: none;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    display: none;
}

/* Animated Background Orbs */
.loading-background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

@media (prefers-reduced-motion: reduce) {
    .loading-background-animation,
    .loading-orb {
        animation: none !important;
        filter: none;
    }
}

/* Motion reduction for key animations */
@media (prefers-reduced-motion: reduce) {
    .gradient-orb,
    .floating-badge,
    .particles,
    .astronaut,
    .box-of-star1,
    .box-of-star2,
    .box-of-star3,
    .box-of-star4,
    .quote-terminal::after,
    .card-inner,
    .hero-content,
    .hero-text,
    .hero-image,
    .section-title,
    .section-subtitle {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}

.loading-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: floatOrb 15s ease-in-out infinite;
}

.loading-orb.orb-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    top: -150px;
    right: -150px;
    animation-delay: 0s;
}

.loading-orb.orb-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    bottom: -100px;
    left: 10%;
    animation-delay: 3s;
}

.loading-orb.orb-3 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    top: 50%;
    left: -100px;
    animation-delay: 6s;
}

@keyframes floatOrb {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(80px, -80px) scale(1.2);
    }
    66% {
        transform: translate(-60px, 60px) scale(0.8);
    }
}

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    position: relative;
    z-index: 1;
}

/* Chip Loader */
.chip-loader {
    width: min(900px, 92vw);
    max-width: 100%;
}

.chip-svg {
    width: 100%;
    height: auto;
}

.chip-trace-bg {
    stroke: #333;
    stroke-width: 1.8;
    fill: none;
    opacity: 0.45;
}

.chip-trace-flow {
    stroke-width: 1.8;
    fill: none;
    stroke-dasharray: 40 400;
    stroke-dashoffset: 438;
    filter: drop-shadow(0 0 6px currentColor);
    animation: chip-flow 3s cubic-bezier(0.5, 0, 0.9, 1) infinite;
}

.chip-trace-flow.yellow { stroke: #ffea00; color: #ffea00; }
.chip-trace-flow.blue { stroke: #00ccff; color: #00ccff; }
.chip-trace-flow.green { stroke: #00ff15; color: #00ff15; }
.chip-trace-flow.purple { stroke: #9900ff; color: #9900ff; }
.chip-trace-flow.red { stroke: #ff3300; color: #ff3300; }

@keyframes chip-flow {
    to { stroke-dashoffset: 0; }
}

.chip-body {
    fill: url(#chipGradient);
    stroke: #222;
    stroke-width: 3;
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.8));
}

.chip-text {
    font-family: 'Cairo', 'Inter', system-ui, sans-serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    fill: url(#textGradient);
}

.chip-pin {
    fill: url(#pinGradient);
    rx: 2;
}

.chip-node {
    fill: #0f172a;
    stroke: #94a3b8;
    stroke-width: 1.2;
}

@media (max-width: 768px) {
    .chip-text { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .chip-trace-flow { animation: none; }
}


/* Legacy loader class for compatibility */
.loader {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary);
    border-radius: 10px;
    position: relative;
    animation: rotate 5s linear infinite;
}

.loader::before,
.loader::after {
    content: "";
    position: absolute;
    border: 2px solid;
    border-radius: 10px;
}

.loader::before {
    width: 110%;
    height: 110%;
    border-color: var(--accent);
    top: -5.5%;
    left: -5.5%;
    animation: rotate 5s linear infinite reverse;
}

.loader::after {
    width: 120%;
    height: 120%;
    border-color: var(--secondary);
    top: -10%;
    left: -10%;
    animation: rotate 5s linear infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

/* Progress Bar */
.loading-progress {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: width 0.1s linear;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.6);
    position: relative;
    overflow: hidden;
    will-change: width;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.loading-percentage {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    font-family: 'Cairo', sans-serif;
    text-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Navigation - Premium Glassmorphism */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    z-index: var(--z-fixed);
    transition: all var(--transition-smooth);
    will-change: background-color, box-shadow, transform;
}

[data-theme="dark"] .navbar {
    background: var(--bg-glass-dark);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.navbar.scrolled {
    background: var(--bg-glass);
    box-shadow: var(--shadow-lg);
    border-bottom-color: transparent;
    transform: translateY(0);
}

[data-theme="dark"] .navbar.scrolled {
    background: rgba(15, 23, 42, 0.85);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Smooth scroll reveal animation */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.navbar {
    animation: slideDown 0.6s var(--ease-out);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    position: relative;
    transition: var(--transition);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -3px;
    right: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
    border-radius: 2px;
}

.logo:hover::after {
    width: 100%;
}

.logo:hover {
    transform: scale(1.05);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.theme-toggle,
.lang-toggle {
    background: var(--light);
    border: 2px solid var(--primary);
    color: var(--primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
    padding: 0;
    font-weight: 600;
}

.lang-toggle {
    width: auto;
    min-width: 50px;
    padding: 0 0.75rem;
    border-radius: 20px;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.lang-toggle span {
    font-size: 0.85rem;
}

.theme-toggle:hover,
.lang-toggle:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.theme-toggle:hover {
    transform: rotate(20deg) scale(1.1);
}

[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .lang-toggle {
    background: var(--bg-card);
    border-color: var(--secondary);
    color: var(--secondary);
}

[data-theme="dark"] .theme-toggle:hover,
[data-theme="dark"] .lang-toggle:hover {
    background: var(--secondary);
    color: white;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    position: relative;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--transition);
    z-index: -1;
    border-radius: var(--radius-md);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width var(--transition);
    border-radius: var(--radius-full);
}

.nav-links a:hover::before {
    opacity: 1;
    transform: scale(1);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: calc(100% - var(--space-4));
}

.nav-links a.active {
    color: var(--primary);
}

.nav-links a:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

[data-theme="dark"] .nav-links a::before {
    background: rgba(37, 99, 235, 0.1);
}

/* Hero Section - Premium Design */
.hero {
    padding: calc(80px + var(--space-20)) 0 var(--space-20);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    isolation: isolate;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    z-index: 0;
    pointer-events: none;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: floatOrb 20s ease-in-out infinite;
}

.gradient-orb.orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.gradient-orb.orb-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    bottom: -50px;
    left: 10%;
    animation-delay: 5s;
}

.gradient-orb.orb-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    top: 50%;
    left: -50px;
    animation-delay: 10s;
}

/* Space Elements */
.space-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Planets */
.planet {
    position: absolute;
    border-radius: 50%;
    filter: blur(1px);
    opacity: 0.6;
    animation: planetFloat 25s ease-in-out infinite;
}

.planet-1 {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #c92a2a);
    top: 15%;
    right: 15%;
    animation-delay: 0s;
    box-shadow: 0 0 40px rgba(255, 107, 107, 0.4), inset -20px -20px 40px rgba(0, 0, 0, 0.3);
}

.planet-2 {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at 30% 30%, #4dabf7, #1971c2);
    bottom: 20%;
    left: 20%;
    animation-delay: 8s;
    box-shadow: 0 0 30px rgba(77, 171, 247, 0.4), inset -15px -15px 30px rgba(0, 0, 0, 0.3);
}

.planet-3 {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 30% 30%, #51cf66, #2f9e44);
    top: 60%;
    right: 30%;
    animation-delay: 15s;
    box-shadow: 0 0 25px rgba(81, 207, 102, 0.4), inset -10px -10px 25px rgba(0, 0, 0, 0.3);
}

@keyframes planetFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -20px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 30px) rotate(240deg);
    }
}

/* Twinkling Stars */
.twinkling-star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
    animation: twinkle 3s ease-in-out infinite;
}

.star-1 { top: 10%; left: 10%; animation-delay: 0s; }
.star-2 { top: 25%; right: 15%; animation-delay: 0.5s; }
.star-3 { top: 40%; left: 25%; animation-delay: 1s; }
.star-4 { top: 55%; right: 25%; animation-delay: 1.5s; }
.star-5 { top: 70%; left: 15%; animation-delay: 2s; }
.star-6 { top: 20%; right: 40%; animation-delay: 2.5s; }
.star-7 { top: 80%; right: 10%; animation-delay: 0.3s; }
.star-8 { top: 35%; left: 50%; animation-delay: 1.8s; }

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* Meteor Shower */
.meteor {
    position: absolute;
    width: 2px;
    height: 80px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), transparent);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
    animation: meteorFall 4s linear infinite;
    transform-origin: top;
}

.meteor-1 {
    top: -100px;
    left: 20%;
    animation-delay: 0s;
    transform: rotate(45deg);
}

.meteor-2 {
    top: -100px;
    left: 60%;
    animation-delay: 2s;
    transform: rotate(60deg);
}

.meteor-3 {
    top: -100px;
    right: 20%;
    animation-delay: 4s;
    transform: rotate(30deg);
}

@keyframes meteorFall {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) rotate(45deg);
    }
    10% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) translateX(200px) rotate(45deg);
    }
}

/* Space Cloud */
.space-cloud {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.15;
    animation: cloudFloat 30s ease-in-out infinite;
}

.cloud-1 {
    width: 200px;
    height: 100px;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.3), transparent);
    top: 30%;
    left: 10%;
    animation-delay: 0s;
}

.cloud-2 {
    width: 150px;
    height: 80px;
    background: radial-gradient(ellipse, rgba(200, 200, 255, 0.2), transparent);
    bottom: 25%;
    right: 15%;
    animation-delay: 15s;
}

@keyframes cloudFloat {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(50px, -30px);
    }
}

/* Satellite */
.satellite {
    position: absolute;
    top: 20%;
    right: 10%;
    width: 40px;
    height: 40px;
    animation: satelliteOrbit 20s linear infinite;
    transform-origin: center;
}

.satellite-body {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #94a3b8, #64748b);
    border-radius: 4px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px rgba(148, 163, 184, 0.5);
}

.satellite-panel {
    position: absolute;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
}

.satellite-panel.panel-1 {
    width: 30px;
    height: 4px;
    top: 50%;
    left: -15px;
    transform: translateY(-50%);
    animation: panelGlow 2s ease-in-out infinite;
}

.satellite-panel.panel-2 {
    width: 4px;
    height: 30px;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    animation: panelGlow 2s ease-in-out infinite 1s;
}

@keyframes satelliteOrbit {
    0% {
        transform: rotate(0deg) translateX(150px) rotate(0deg);
    }
    100% {
        transform: rotate(360deg) translateX(150px) rotate(-360deg);
    }
}

@keyframes panelGlow {
    0%, 100% {
        opacity: 0.6;
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 20px rgba(59, 130, 246, 1);
    }
}

/* Responsive adjustments for space elements */
@media (max-width: 1200px) {
    .planet-1 {
        width: 100px;
        height: 100px;
    }
    
    .planet-2 {
        width: 70px;
        height: 70px;
    }
    
    .planet-3 {
        width: 50px;
        height: 50px;
    }
    
    .satellite {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 768px) {
    .space-elements {
        opacity: 0.5;
    }
    
    .planet,
    .satellite {
        display: none;
    }
    
    .twinkling-star {
        width: 2px;
        height: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .planet,
    .twinkling-star,
    .meteor,
    .space-cloud,
    .satellite,
    .section-star,
    .section-orb,
    .section-particle {
        animation: none;
    }
}

/* Responsive adjustments for section space elements */
@media (max-width: 768px) {
    .section-background {
        opacity: 0.5;
    }
    
    .section-star {
        width: 1.5px;
        height: 1.5px;
    }
    
    .section-orb {
        filter: blur(40px);
        opacity: 0.15;
    }
    
    .section-particle {
        width: 3px;
        height: 3px;
    }
}

/* ============================================
   MOBILE-FIRST ENHANCEMENTS
   ============================================ */

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 8px 0;
    font-weight: 600;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Enhanced Mobile Navigation */
@media (max-width: 768px) {
    .nav-links {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-links a {
        min-height: 56px; /* Better touch target */
        font-size: 1.1rem;
        border-radius: var(--radius);
        margin-bottom: 0.5rem;
        transition: all 0.2s ease;
    }
    
    .nav-links a:active {
        background: var(--primary-50);
        transform: scale(0.98);
    }
    
    .menu-toggle {
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .theme-toggle,
    .lang-toggle {
        min-width: 48px;
        min-height: 48px;
    }
}

/* Enhanced Mobile Hero Section */
@media (max-width: 768px) {
    .hero {
        min-height: 100vh;
        min-height: -webkit-fill-available;
        padding: 5rem 0 3rem;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
        min-height: 52px;
        font-size: 1rem;
        padding: 1rem 2rem;
    }
    
    .hero-stats {
        gap: 1rem;
        margin-top: 2rem;
    }
    
    .stat {
        padding: 1rem;
        min-height: 100px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    .image-wrapper {
        width: 250px;
        height: 250px;
        margin: 2rem auto 0;
    }
}

/* Enhanced Mobile Cards & Interactive Elements */
@media (max-width: 768px) {
    .card-3d,
    .photo-card,
    .project-card,
    .skill-category,
    .timeline-content,
    .certificate-card {
        min-height: auto;
        padding: 1.5rem;
    }
    
    .card-3d:hover,
    .photo-card:hover,
    .project-card:hover {
        transform: translateY(-5px) scale(1.02);
    }
    
    /* Disable 3D transforms on mobile for better performance */
    .card-inner {
        transform-style: flat;
    }
    
    .photo-card:hover .card-inner {
        transform: rotateY(0deg) scale(1.02);
    }
    
    /* Better touch feedback */
    .btn,
    .card-view-btn,
    .cv-download-btn,
    button {
        min-height: 48px;
        min-width: 48px;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.2);
    }
    
    .btn:active,
    button:active {
        transform: scale(0.96);
        transition: transform 0.1s;
    }
}

/* Enhanced Mobile Skills Section */
@media (max-width: 768px) {
    .skill-bar {
        height: 12px; /* Larger for easier viewing */
    }
    
    .skill-info {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }
    
    .skill-category {
        margin-bottom: 1.5rem;
    }
}

/* Enhanced Mobile Gallery */
@media (max-width: 768px) {
    .gallery-cards-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .photo-card {
        max-width: 100%;
        height: 400px;
    }
    
    .tab-buttons {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .tab-btn {
        min-height: 44px;
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* Enhanced Mobile Timeline */
@media (max-width: 768px) {
    .timeline-item {
        margin-bottom: 2rem;
    }
    
    .timeline-content {
        padding: 1.5rem;
    }
    
    .timeline-header h3 {
        font-size: 1.2rem;
    }
    
    .timeline-list li {
        font-size: 0.95rem;
        line-height: 1.7;
        margin-bottom: 0.75rem;
    }
    
    .timeline-tags {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .tag {
        min-height: 36px;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* Enhanced Mobile Contact Form */
@media (max-width: 768px) {
    .form-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .form-container .form .input,
    .form-container .form .textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 1rem;
        min-height: 48px;
    }
    
    .form-container .form .textarea {
        min-height: 120px;
    }
    
    .submit-btn {
        width: 100%;
        min-height: 52px;
        font-size: 1rem;
    }
}

/* Enhanced Mobile Modals */
@media (max-width: 768px) {
    .modal {
        padding: 0.5rem;
    }
    
    .modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: var(--radius-lg);
    }
    
    .modal-header {
        padding: 1rem;
        position: sticky;
        top: 0;
        background: var(--bg-card);
        z-index: 10;
    }
    
    .close-modal {
        min-width: 44px;
        min-height: 44px;
    }
    
    .image-modal-content {
        max-width: 100%;
        max-height: 90vh;
        margin: 0.5rem;
    }
    
    .modal-nav {
        min-width: 44px;
        min-height: 44px;
        font-size: 1.2rem;
    }
}

/* Enhanced Mobile CV Section */
@media (max-width: 768px) {
    .portfolio-container {
        flex-direction: column;
        gap: 2rem;
    }
    
    .interactive-card-section {
        width: 100%;
    }
    
    .card-3d {
        width: 100%;
        max-width: 100%;
    }
    
    .preview-section {
        width: 100%;
    }
    
    .flip-trigger {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* Enhanced Mobile Footer */
@media (max-width: 768px) {
    .footer {
        padding: 2rem 0;
    }
    
    .footer-content {
        gap: 2rem;
    }
    
    .social-media-icons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .social-icon {
        min-width: 50px;
        min-height: 50px;
        font-size: 1.2rem;
    }
}

/* Enhanced Mobile Animations - Lighter for Performance */
@media (max-width: 768px) {
    /* Reduce particle count on mobile */
    .particle {
        display: none;
    }
    
    /* Simplify space animations */
    .astronaut-container,
    .space-elements {
        opacity: 0.6;
    }
    
    /* Reduce animation complexity */
    .card-3d,
    .photo-card .card-inner {
        transition: transform 0.3s ease;
    }
    
    /* Disable heavy hover effects */
    .hero-stats .stat::before,
    .project-card::before,
    .skill-category::before {
        display: none;
    }
}

/* Enhanced Mobile Typography */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        line-height: 1.6;
    }
    
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.5rem;
        line-height: 1.4;
    }
    
    p {
        font-size: 1rem;
        line-height: 1.7;
    }
}

/* Enhanced Mobile Spacing */
@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .section-title {
        margin-bottom: 2rem;
        font-size: 1.75rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
}

/* Enhanced Mobile Loading Screen */
@media (max-width: 768px) {
    .loading-content {
        gap: 1.5rem;
    }

    .chip-loader {
        width: clamp(320px, 95vw, 520px);
    }

    .loading-progress {
        width: clamp(240px, 90vw, 420px);
    }

    .loading-screen {
        padding: 1rem;
    }
    
    #loader {
        width: 60px;
        height: 30px;
    }
    
    .loading-percentage {
        font-size: 1.2rem;
    }
}

/* Enhanced Mobile Back to Top Button */
@media (max-width: 768px) {
    .back-to-top {
        width: 50px;
        height: 50px;
        bottom: 1.5rem;
        right: 1.5rem;
        font-size: 1.1rem;
    }
}

/* Landscape Mobile Optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 3rem 0 2rem;
        min-height: auto;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .nav-links {
        max-height: 70vh;
    }
}

/* Small Mobile Devices (320px - 480px) */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .card-3d,
    .photo-card,
    .project-card {
        padding: 1.25rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.75rem 1.25rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
}

/* Very Small Mobile Devices (320px and below) */
@media (max-width: 320px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 0.625rem 1rem;
    }
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-16);
    align-items: center;
    position: relative;
    z-index: 1;
}

@media (max-width: 968px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--space-12);
        text-align: center;
    }
}

.hero-text {
    animation: fadeInLeft 1s var(--ease-out);
}

.welcome-text {
    color: var(--text-muted);
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
    margin-bottom: var(--space-2);
    opacity: 0;
    animation: fadeInLeft 0.8s var(--ease-out) 0.3s forwards;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: var(--text-sm);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: var(--font-extrabold);
    margin-bottom: var(--space-4);
    line-height: var(--leading-tight);
    opacity: 0;
    animation: fadeInUp 1s var(--ease-out) 0.5s forwards;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* In LTR: Montaser (left) then Hamdy (right) */
html[dir="ltr"] .hero-title {
    flex-direction: row;
}

html[dir="ltr"] .hero-title .name-first {
    order: 1;
}

html[dir="ltr"] .hero-title .name-last {
    order: 2;
}

/* In RTL: we want منتصر (name-first) on RIGHT, حمدي (name-last) on LEFT */
/* HTML order: name-first (منتصر) then name-last (حمدي) */
/* In RTL, flexbox naturally starts from right, so we keep natural order */
html[dir="rtl"] .hero-title {
    flex-direction: row;
}

/* In RTL: name-first (منتصر) should be on RIGHT, name-last (حمدي) on LEFT */
/* Since RTL flexbox starts from right, name-first (first in HTML) appears on right */
/* We don't need to change order, just ensure proper display */
html[dir="rtl"] .hero-title .name-first {
    order: 1; /* Keep natural order - appears on RIGHT in RTL */
}

html[dir="rtl"] .hero-title .name-last {
    order: 2; /* Appears after name-first - on LEFT in RTL */
}

.hero-title .name-last {
    display: none;
}

.hero-title .name-first {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: gradientShift 3s ease infinite;
}

.hero-title .highlight {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    color: var(--text-muted);
    margin-bottom: var(--space-6);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    animation: fadeInUp 1s var(--ease-out) 0.7s forwards;
    font-weight: var(--font-medium);
}

.hero-description {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
    line-height: var(--leading-relaxed);
    max-width: 90%;
    opacity: 0;
    animation: fadeInUp 1s var(--ease-out) 0.9s forwards;
}

@media (max-width: 968px) {
    .hero-description {
        max-width: 100%;
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Quote - Terminal card */
.quote-page-wrapper {
    margin: 2.5rem 0;
    opacity: 0;
    animation: fadeInUp 1s ease 1.2s forwards;
}

@keyframes caretBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@keyframes scanGlow {
    0% { transform: translateX(-30%); opacity: 0; }
    20% { opacity: 0.5; }
    50% { opacity: 0.25; }
    100% { transform: translateX(120%); opacity: 0; }
}

.quote-terminal {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.12), transparent 40%),
                radial-gradient(circle at 80% 0%, rgba(168, 85, 247, 0.12), transparent 45%),
                var(--bg-card);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease, border-color 0.3s ease;
}

.quote-terminal:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(59, 130, 246, 0.18);
    border-color: var(--primary);
}

.quote-terminal::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(59, 130, 246, 0.15) 45%, rgba(255, 255, 255, 0) 100%);
    mix-blend-mode: screen;
    pointer-events: none;
    animation: scanGlow 6s ease-in-out infinite;
    opacity: 0.25;
}

.quote-terminal-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1rem;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(59, 130, 246, 0.08));
    border-bottom: 1px solid var(--border-color);
}

.quote-terminal-controls {
    position: absolute;
    left: 14px;
    display: flex;
    gap: 8px;
}

.quote-terminal .control {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #777;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08) inset;
}

.quote-terminal .control.close { background-color: #ef4444; }
.quote-terminal .control.minimize { background-color: #fbbf24; }
.quote-terminal .control.maximize { background-color: #22c55e; }

.quote-terminal-title {
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
    font-size: 0.95rem;
}

.quote-terminal-body {
    position: relative;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0) 100%);
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}

.quote-terminal-prompt {
    color: #22c55e;
    font-weight: 700;
    font-family: 'Fira Code', 'Cairo', sans-serif;
    line-height: 1.6;
    font-size: 1rem;
}

.quote-terminal-text {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.8;
    font-weight: 600;
    font-size: 1.05rem;
    flex: 1;
}

.quote-terminal-caret {
    width: 10px;
    height: 1.2em;
    background: #22c55e;
    border-radius: 2px;
    margin-top: 4px;
    animation: caretBlink 1s steps(1) infinite;
    flex-shrink: 0;
}

[data-theme="dark"] .quote-terminal {
    background: radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.16), transparent 42%),
                radial-gradient(circle at 80% 0%, rgba(168, 85, 247, 0.18), transparent 48%),
                var(--bg-card);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .quote-terminal-header {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(59, 130, 246, 0.14));
    border-color: rgba(255, 255, 255, 0.06);
}

html[dir="rtl"] .quote-terminal-body {
    direction: rtl;
    text-align: right;
    flex-direction: row-reverse;
}

html[dir="rtl"] .quote-terminal-prompt {
    order: 2;
}

html[dir="rtl"] .quote-terminal-caret {
    order: 1;
}

@media (max-width: 768px) {
    .quote-terminal {
        max-width: 100%;
    }
    
    .quote-terminal-body {
        padding: 1.2rem;
        gap: 0.6rem;
    }
    
    .quote-terminal-text {
        font-size: 1rem;
        line-height: 1.7;
    }
}

@media (max-width: 480px) {
    .quote-terminal {
        border-radius: var(--radius-md);
    }
    
    .quote-terminal-header {
        padding: 0.55rem 0.9rem;
    }
    
    .quote-terminal-body {
        padding: 1rem;
    }
}

/* Hero Stats - Premium Cards */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-4);
    margin: var(--space-8) 0;
    opacity: 0;
    animation: fadeInUp 1s var(--ease-out) 1.1s forwards;
}

@media (max-width: 640px) {
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }
}

.stat {
    text-align: center;
    padding: var(--space-6) var(--space-4);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-smooth);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    isolation: isolate;
}

.stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.15), transparent);
    transition: left 0.6s var(--ease-out);
    z-index: 0;
}

.stat::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
    opacity: 0;
    transition: opacity var(--transition);
    z-index: -1;
}

.stat:hover::before {
    left: 100%;
}

.stat:hover::after {
    opacity: 1;
}

.stat:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: var(--shadow-colored-lg);
    border-color: var(--primary);
}

[data-theme="dark"] .stat::after {
    background: rgba(37, 99, 235, 0.1);
}

.stat-number {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: var(--font-extrabold);
    color: var(--primary);
    margin-bottom: var(--space-2);
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: var(--font-medium);
    position: relative;
    z-index: 1;
    line-height: var(--leading-snug);
}

/* Hero Buttons - Enhanced */
.hero-buttons {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-8);
    opacity: 0;
    animation: fadeInUp 1s var(--ease-out) 1.3s forwards;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

.hero-buttons .btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
    font-size: var(--text-base);
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-lg);
    font-weight: var(--font-semibold);
    box-shadow: var(--shadow-md);
}

.hero-buttons .btn-primary {
    background: linear-gradient(135deg, #FF7A01, #E66A00);
    box-shadow: var(--shadow-colored);
}

.hero-buttons .btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-colored-lg);
}

.hero-buttons .btn-secondary {
    background: var(--bg-card);
    border: 2px solid #FF7A01;
    color: #FF7A01;
    box-shadow: var(--shadow);
}

.hero-buttons .btn-secondary:hover {
    background: #FF7A01;
    color: var(--text-inverse);
    transform: translateY(-4px);
    box-shadow: var(--shadow-colored);
}

/* Hero Image */
.hero-image {
    position: relative;
    opacity: 0;
    animation: fadeInRight 1s ease 0.7s forwards;
}

.image-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto;
}

.image-glow {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-xl);
    opacity: 0.3;
    filter: blur(30px);
    animation: pulseGlow 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.05);
    }
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.profile-img:hover {
    transform: scale(1.05) rotate(2deg);
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.floating-badge {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.75rem 1.125rem;
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 5px 20px rgba(37, 99, 235, 0.4);
    animation: float 3s ease-in-out infinite;
    z-index: 2;
    font-weight: 600;
    transition: var(--transition);
}

.floating-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.6);
}

.floating-badge i {
    font-size: 1.1rem;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* About Section - Premium Design */
.about {
    padding: var(--section-padding-y) 0;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.about .container {
    position: relative;
    z-index: 1;
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-text {
    text-align: center;
    margin-bottom: var(--space-12);
}

.about-text h3 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-6);
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-text p {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-5);
    line-height: var(--leading-relaxed);
    max-width: 85%;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    .about-text p {
        max-width: 100%;
    }
}

.about-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-6);
    margin-top: var(--space-12);
}

.feature {
    text-align: center;
    padding: var(--space-8) var(--space-6);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    transition: all var(--transition-smooth);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    isolation: isolate;
}

.feature::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
    opacity: 0;
    transition: opacity var(--transition-smooth);
    z-index: 0;
}

.feature::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-smooth);
    z-index: -1;
}

.feature:hover::before {
    opacity: 1;
}

.feature:hover::after {
    opacity: 1;
}

.feature:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: var(--shadow-colored-lg);
    border-color: var(--primary);
}

[data-theme="dark"] .feature::before {
    background: rgba(37, 99, 235, 0.1);
}

.feature i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: var(--space-4);
    position: relative;
    z-index: 1;
    transition: all var(--transition-smooth);
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature:hover i {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 4px 8px rgba(37, 99, 235, 0.3));
}

.feature h4 {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-3);
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.feature p {
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin: 0;
    position: relative;
    z-index: 1;
    line-height: var(--leading-relaxed);
}

/* Certificates Section - Premium Design */
.certificates {
    padding: var(--section-padding-y) 0;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.certificates::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(37, 99, 235, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.certificates .container {
    position: relative;
    z-index: 1;
}

.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-8);
    max-width: 1200px;
    margin: 0 auto;
}

.certificate-card {
    background: var(--bg-card);
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all var(--transition-smooth);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    isolation: isolate;
}

.certificate-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
    opacity: 0;
    transition: opacity var(--transition-smooth);
    z-index: 0;
}

.certificate-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-smooth);
    z-index: -1;
}

.certificate-card:hover::before {
    opacity: 1;
}

.certificate-card:hover::after {
    opacity: 1;
}

.certificate-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: var(--shadow-colored-lg);
    border-color: var(--primary);
}

[data-theme="dark"] .certificate-card::before {
    background: rgba(37, 99, 235, 0.1);
}

.certificate-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-6);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-smooth);
    position: relative;
    z-index: 1;
    padding: 12px;
}

.certificate-icon svg {
    width: 100%;
    height: 100%;
}

.certificate-icon-google {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .certificate-icon-google {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.certificate-icon-microsoft {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .certificate-icon-microsoft {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.certificate-card:hover .certificate-icon {
    transform: scale(1.15) rotate(10deg);
    box-shadow: var(--shadow-colored-lg);
}

.certificate-card h3 {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-3);
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.certificate-org {
    color: var(--primary);
    font-weight: var(--font-semibold);
    font-size: var(--text-lg);
    margin-bottom: var(--space-2);
    position: relative;
    z-index: 1;
}

.certificate-date {
    color: var(--text-muted);
    font-size: var(--text-sm);
    position: relative;
    z-index: 1;
}

/* Award Card Special Styling */
.award-card-star {
    background: var(--bg-card) !important;
    border: 1.5px solid var(--border-color) !important;
}

.award-card-star::before {
    opacity: 0.15 !important;
}

.award-container {
    position: relative;
    z-index: 1;
}

.award-svg-icon {
    color: #d9a018;
    margin-bottom: var(--space-4);
    filter: drop-shadow(0 4px 10px rgba(217, 160, 24, 0.4));
    transition: all var(--transition-smooth);
}

.certificate-card:hover .award-svg-icon {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 10px 18px rgba(217, 160, 24, 0.6));
}

/* Gallery Section */
.gallery {
    padding: var(--section-padding-y) 0;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.gallery::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 50% 20%, rgba(37, 99, 235, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.gallery .container {
    position: relative;
    z-index: 1;
}

.gallery-tabs {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: var(--space-3) var(--space-6);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--transition-smooth);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left var(--transition-smooth);
}

.tab-btn:hover::before {
    left: 100%;
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-colored);
    transform: translateY(-2px);
}

/* 3D Photo Cards */
.gallery-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.photo-card {
    background-color: transparent;
    width: 100%;
    max-width: 250px;
    height: 350px;
    perspective: 1000px;
    transform-origin: center;
    border-radius: var(--radius-lg);
    margin: 0 auto;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
    visibility: visible;
    display: block;
}

.photo-card.hidden {
    display: none;
}

.photo-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 1.1s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.photo-card:hover .card-inner {
    transform: rotateY(180deg) rotate(5deg) scale(1.05);
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.4);
}

.photo-card:hover {
    transform: translateY(-10px);
}

.front, .back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.front {
    background-color: var(--bg-card);
    color: black;
}

.front-bg {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.front-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    cursor: pointer;
}

.photo-card:hover .front-bg img {
    transform: scale(1.1);
}

.back {
    background-color: var(--bg-card);
    color: white;
    transform: rotateY(180deg);
    display: flex;
    justify-content: center;
    align-items: center;
}

.back-bg {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--dark) 0%, #1e293b 100%);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    gap: 1rem;
    position: relative;
}

.back-bg h3 {
    font-size: 1.5rem;
    margin: 0;
    color: white;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.back-bg p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    position: relative;
    z-index: 2;
}

.card-view-btn {
    width: 50px;
    height: 50px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    z-index: 2;
    margin-top: 0.5rem;
}

.card-view-btn:hover {
    background: var(--secondary);
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 5px 20px rgba(16, 185, 129, 0.4);
}

/* Image Lightbox Modal */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.image-modal.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-content-wrapper {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#modalImage {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
}

.modal-caption {
    margin-top: 1.25rem;
    text-align: center;
    color: white;
}

.modal-caption h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-caption p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

.modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 2;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 2;
}

.modal-prev {
    right: -70px;
}

.modal-next {
    left: -70px;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

/* Experience Section - Premium Timeline */
.experience {
    padding: var(--section-padding-y) 0;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 50%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.section-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Section Stars - Subtle twinkling effect */
.section-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
    animation: sectionStarTwinkle 4s ease-in-out infinite;
}

.star-exp-1 { top: 15%; left: 10%; animation-delay: 0s; }
.star-exp-2 { top: 45%; right: 15%; animation-delay: 1.5s; }
.star-exp-3 { top: 75%; left: 20%; animation-delay: 3s; }

.star-gal-1 { top: 10%; left: 8%; animation-delay: 0s; }
.star-gal-2 { top: 30%; right: 12%; animation-delay: 0.8s; }
.star-gal-3 { top: 60%; left: 15%; animation-delay: 2s; }
.star-gal-4 { top: 85%; right: 10%; animation-delay: 3.2s; }

@keyframes sectionStarTwinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* Section Orbs - Floating gradient orbs */
.section-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.2;
    animation: sectionOrbFloat 20s ease-in-out infinite;
}

.orb-skills-1 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    top: 10%;
    right: 10%;
    animation-delay: 0s;
}

.orb-skills-2 {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    bottom: 15%;
    left: 15%;
    animation-delay: 10s;
}

@keyframes sectionOrbFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(40px, -30px) scale(1.2);
    }
}

/* Section Particles - Floating particles */
.section-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(37, 99, 235, 0.4);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.6);
    animation: sectionParticleFloat 15s ease-in-out infinite;
}

.particle-proj-1 {
    top: 20%;
    left: 12%;
    animation-delay: 0s;
}

.particle-proj-2 {
    top: 50%;
    right: 18%;
    animation-delay: 5s;
}

.particle-proj-3 {
    bottom: 20%;
    left: 25%;
    animation-delay: 10s;
}

@keyframes sectionParticleFloat {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 0.4;
    }
    25% {
        transform: translate(30px, -20px);
        opacity: 0.8;
    }
    50% {
        transform: translate(-20px, 30px);
        opacity: 0.6;
    }
    75% {
        transform: translate(20px, 20px);
        opacity: 0.9;
    }
}

.experience::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 30%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.experience .container {
    position: relative;
    z-index: 1;
}

.timeline {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    padding: var(--space-8) 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    border-radius: var(--radius-full);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
}

.timeline-item {
    margin-bottom: var(--space-12);
    position: relative;
    width: calc(50% - var(--space-6));
    opacity: 0;
    transform: translateY(30px);
    transition: all var(--transition-smooth);
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: var(--space-8);
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: calc(50% + var(--space-6));
    padding-left: var(--space-8);
    text-align: left;
}

@media (max-width: 768px) {
    .timeline::before {
        left: var(--space-6);
    }
    
    .timeline-item {
        width: calc(100% - var(--space-12));
        left: var(--space-12) !important;
        padding-left: var(--space-8) !important;
        padding-right: 0 !important;
        text-align: left !important;
    }
}

.timeline-content {
    background: var(--bg-card);
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    position: relative;
    border: 1px solid var(--border-color);
    transition: all var(--transition-smooth);
    overflow: hidden;
    backdrop-filter: blur(10px);
    isolation: isolate;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
    opacity: 0;
    transition: opacity var(--transition-smooth);
    z-index: 0;
}

.timeline-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    transition: height var(--transition-smooth);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.timeline-item:nth-child(even) .timeline-content::after {
    left: auto;
    right: 0;
    border-radius: var(--radius) 0 0 var(--radius);
}

.timeline-content:hover::before {
    opacity: 1;
}

.timeline-content:hover::after {
    height: 100%;
}

.timeline-content:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-colored-lg);
    border-color: var(--primary);
}

[data-theme="dark"] .timeline-content::before {
    background: rgba(37, 99, 235, 0.1);
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: var(--space-8);
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--bg-primary), 0 0 20px rgba(37, 99, 235, 0.5);
    z-index: 2;
    transition: all var(--transition-smooth);
}

.timeline-item:nth-child(odd) .timeline-content::before {
    left: calc(-1 * var(--space-8) - 10px);
}

.timeline-item:nth-child(even) .timeline-content::before {
    right: calc(-1 * var(--space-8) - 10px);
}

.timeline-content:hover::before {
    transform: scale(1.3);
    box-shadow: 0 0 0 6px var(--bg-primary), 0 0 30px rgba(37, 99, 235, 0.8);
    animation: timelinePulse 2s ease-in-out infinite;
}

@keyframes timelinePulse {
    0%, 100% {
        box-shadow: 0 0 0 6px var(--bg-primary), 0 0 30px rgba(37, 99, 235, 0.8);
    }
    50% {
        box-shadow: 0 0 0 8px var(--bg-primary), 0 0 40px rgba(37, 99, 235, 1);
    }
}

@media (max-width: 768px) {
    .timeline-content::before {
        left: calc(-1 * var(--space-8) - 10px) !important;
        right: auto !important;
    }
}

.timeline-header {
    margin-bottom: 1.25rem;
}

.timeline-header h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.company {
    display: inline-block;
    color: var(--primary);
    font-weight: 600;
    margin-left: 0.5rem;
}

.date {
    display: inline-block;
    background: var(--bg-secondary);
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.location {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.location i {
    margin-left: 0.25rem;
}

.timeline-list {
    list-style: none;
    margin-bottom: 1.25rem;
}

.timeline-list li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-right: 1rem;
}

.timeline-list li::before {
    content: '▸';
    position: absolute;
    right: 0;
    color: var(--primary);
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: var(--primary-50);
    color: var(--primary);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    border: 1px solid var(--primary);
    transition: all var(--transition);
    display: inline-block;
    position: relative;
    z-index: 1;
}

.tag:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .tag {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--primary);
}

[data-theme="dark"] .tag:hover {
    background: var(--primary);
    color: white;
}

/* Skills Section - Premium Design */
.skills {
    padding: var(--section-padding-y) 0;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.skills::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.skills .container {
    position: relative;
    z-index: 1;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-8);
}

.skill-category {
    background: var(--bg-card);
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    isolation: isolate;
}

.skill-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
    opacity: 0;
    transition: opacity var(--transition-smooth);
    z-index: 0;
}

.skill-category:hover::before {
    opacity: 1;
}

.skill-category:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-colored-lg);
    border-color: var(--primary);
}

[data-theme="dark"] .skill-category::before {
    background: rgba(37, 99, 235, 0.1);
}


.skill-category h3 {
    font-size: 1.3rem;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-category h3 i {
    color: var(--primary);
}

.skill-bars {
    margin-top: 1.25rem;
}

.skill {
    margin-bottom: 1.25rem;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.skill-info span:first-child {
    font-weight: 600;
}

.skill-info span:last-child {
    color: var(--primary);
    font-weight: 600;
}

.skill-bar {
    height: 10px;
    background: var(--border-light);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 5px;
    width: 0;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.skill-bar:hover .skill-progress {
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.6);
    transform: scaleY(1.1);
}

.skill-category:hover .skill-progress::after {
    animation-duration: 1s;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.skill-tag {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    border: 2px solid var(--border-color);
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.skill-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left var(--transition-smooth);
}

.skill-tag:hover::before {
    left: 100%;
}

.skill-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-50);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .skill-tag:hover {
    background: rgba(37, 99, 235, 0.1);
}

/* Projects Section - Premium Cards */
.projects {
    padding: var(--section-padding-y) 0;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 50%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.projects::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 15% 30%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 70%, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.projects .container {
    position: relative;
    z-index: 1;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-8);
}

.project-card {
    background: var(--bg-card);
    padding: var(--space-10) var(--space-8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all var(--transition-smooth);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    isolation: isolate;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-smooth);
    z-index: 1;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
    opacity: 0;
    transition: opacity var(--transition-smooth);
    z-index: 0;
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover::after {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: var(--shadow-colored-lg);
    border-color: var(--primary);
}

[data-theme="dark"] .project-card::after {
    background: rgba(37, 99, 235, 0.1);
}

.project-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-6);
    font-size: 2.5rem;
    color: white;
    box-shadow: var(--shadow-colored);
    transition: all var(--transition-smooth);
    position: relative;
    z-index: 2;
}

.project-icon::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0.3;
    filter: blur(10px);
    z-index: -1;
    transition: all var(--transition-smooth);
}

.project-card:hover .project-icon {
    transform: scale(1.15) rotate(10deg);
    box-shadow: var(--shadow-colored-lg);
    animation: projectIconPulse 2s ease-in-out infinite;
}

@keyframes projectIconPulse {
    0%, 100% {
        box-shadow: var(--shadow-colored-lg);
    }
    50% {
        box-shadow: 0 15px 50px rgba(37, 99, 235, 0.6);
    }
}

.project-card:hover .project-icon::before {
    opacity: 0.5;
    transform: scale(1.2);
}

.project-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    position: relative;
    z-index: 2;
}

.project-card p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

.project-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
    margin-top: var(--space-6);
}

.project-stats span {
    background: var(--bg-secondary);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--primary);
    font-weight: var(--font-semibold);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.project-stats span::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left var(--transition-smooth);
}

.project-stats span:hover::before {
    left: 100%;
}

.project-stats span:hover {
    background: var(--primary-50);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.project-stats i {
    color: var(--secondary);
    font-size: var(--text-base);
    transition: transform var(--transition);
}

.project-stats span:hover i {
    transform: scale(1.2) rotate(5deg);
}

[data-theme="dark"] .project-stats span:hover {
    background: rgba(37, 99, 235, 0.1);
}

/* Contact Section - Premium Design */
.contact {
    padding: var(--section-padding-y) 0;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 50%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 122, 1, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(37, 99, 235, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.contact .container {
    position: relative;
    z-index: 1;
}

.contact-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.unified-contact-card {
    max-width: 1100px;
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 4rem;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 4rem;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .unified-contact-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.contact-info-section {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    padding-left: 2.5rem;
    border-left: 4px solid;
    border-image: linear-gradient(180deg, var(--primary), var(--secondary), var(--primary)) 1;
    position: relative;
    z-index: 1;
}

.contact-info-header h3 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--primary) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
    animation: gradientText 3s ease infinite;
}

@keyframes gradientText {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.contact-info-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.8;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contact-detail-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    border: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .contact-detail-item {
    background: var(--bg-card);
}

.contact-detail-item:hover {
    transform: translateX(-12px) translateY(-5px) scale(1.02);
    box-shadow: 0 20px 50px rgba(37, 99, 235, 0.2);
    border-color: var(--primary);
}

.detail-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.contact-detail-item:hover .detail-icon {
    transform: scale(1.25) rotate(15deg);
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.detail-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 700;
}

.contact-social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link-item {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.social-link-item:nth-child(1) {
    background: linear-gradient(135deg, #0077b5, #005885);
}

.social-link-item:nth-child(2) {
    background: linear-gradient(135deg, #E4405F, #C13584);
}

.social-link-item:nth-child(3) {
    background: linear-gradient(135deg, #333333, #1a1a1a);
}

.social-link-item:hover {
    transform: translateY(-10px) scale(1.2) rotate(5deg);
}

.social-link-item svg {
    width: 24px;
    height: 24px;
    transition: var(--transition);
}

/* Modern Form */
.modern-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-group-modern {
    position: relative;
}

.input-wrapper,
.textarea-wrapper {
    position: relative;
    width: 100%;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 1.125rem 1.25rem 0.75rem 3.125rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
    outline: none;
}

.form-textarea {
    padding-top: 1.25rem;
    min-height: 120px;
    resize: vertical;
}

.form-label {
    position: absolute;
    right: 3.125rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: var(--transition);
    z-index: 1;
}

.textarea-wrapper .form-label {
    top: 1.5rem;
    transform: translateY(0);
}

.form-label i {
    font-size: 1.1rem;
    color: var(--primary);
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-input:focus + .form-label,
.form-textarea:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label,
.form-textarea:not(:placeholder-shown) + .form-label {
    top: -10px;
    right: 1rem;
    font-size: 0.85rem;
    color: var(--primary);
    background: var(--bg-card);
    padding: 0 0.5rem;
    transform: translateY(0);
}

.char-counter-modern {
    position: absolute;
    bottom: 0.625rem;
    left: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.form-message-modern {
    padding: 0.9375rem 1.25rem;
    border-radius: var(--radius);
    text-align: center;
    font-weight: 600;
    display: none;
    animation: slideDown 0.3s ease;
}

.form-message-modern.show {
    display: block;
}

.form-message-modern.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
    border: 2px solid var(--secondary);
}

.form-message-modern.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 2px solid #ef4444;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* CV Interactive Card Section */
.cv-section {
    padding: var(--section-padding-y) 0;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 50%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.cv-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 40%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.cv-section .container {
    position: relative;
    z-index: 1;
}

.cv-section .container {
    max-width: 1400px;
}

/* Portfolio Container */
.portfolio-container {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    position: relative;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .portfolio-container {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
}

/* Interactive Card */
.interactive-card-section {
    perspective: 2000px;
    position: relative;
}

.card-3d {
    width: 100%;
    height: 520px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    cursor: pointer;
}

.card-side {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 35px 60px -15px rgba(0, 0, 0, 0.3);
}

/* Front Side - Minimal & Elegant */
.front-side {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px;
}

.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.floating-element {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.6;
    animation: float 20s infinite linear;
}

.fe1 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.fe2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    bottom: -80px;
    right: -80px;
    animation-delay: 5s;
}

.fe3 {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    top: 50%;
    left: 70%;
    animation-delay: 10s;
}

.card-header {
    z-index: 10;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.badge-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00ff88;
    box-shadow: 0 0 20px #00ff88;
    animation: pulse 2s infinite;
}

.card-content {
    z-index: 10;
    margin-top: auto;
}

.card-title {
    color: white;
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 15px;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.card-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 30px;
}

.card-stats {
    display: flex;
    gap: 30px;
    margin-top: 30px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    color: white;
    font-size: 2.5rem;
    font-weight: 800;
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Back Side - Detailed Info */
.back-side {
    background: white;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    padding: 40px;
}

.back-header {
    margin-bottom: 30px;
}

.back-title {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.back-subtitle {
    color: #666;
    font-size: 1rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    flex-grow: 1;
}

.info-card {
    background: #f8f9ff;
    border-radius: 20px;
    padding: 20px;
    transition: all 0.3s ease;
    border: 1px solid #e8eaff;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.1);
}

.info-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.info-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.info-text {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Preview & Download Section */
.preview-section {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.preview-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.preview-container .section-title {
    color: white;
    font-size: 2rem;
    font-weight: 800;
}

.pdf-badge {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
}

.pdf-preview {
    background: white;
    border-radius: 20px;
    height: 400px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

.pdf-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: #f5f5f5;
    z-index: 1;
}

.pdf-content {
    padding: 60px 40px 40px;
    height: 100%;
    overflow-y: auto;
}

.pdf-page {
    background: linear-gradient(to bottom, white, #fafafa);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
}

.pdf-title {
    color: #333;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-align: center;
}

.pdf-section {
    margin-bottom: 25px;
}

.pdf-section-title {
    color: #667eea;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #667eea;
}

.pdf-item {
    margin-bottom: 8px;
    padding-left: 15px;
    position: relative;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
}

.pdf-item::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    border-radius: 20px;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.preview-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.download-btn {
    background: linear-gradient(135deg, #FF7A01 0%, #E66A00 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(255, 122, 1, 0.3);
}

.action-btn:hover {
    transform: translateY(-5px);
}

.preview-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.download-btn:hover {
    box-shadow: 0 15px 40px rgba(255, 122, 1, 0.5);
}

.action-btn::after {
    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.7s;
}

.action-btn:hover::after {
    left: 100%;
}

/* Flip Trigger */
.flip-trigger {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100;
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.flip-trigger:hover {
    transform: rotate(180deg) scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

/* Resume Preview Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 1000px;
    height: 90vh;
    border-radius: 30px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4);
    animation: modalAppear 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 800;
}

.close-modal {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    flex-grow: 1;
    padding: 0;
    overflow: hidden;
}

.pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(40px, -40px) rotate(10deg); }
    50% { transform: translate(-30px, 30px) rotate(-5deg); }
    75% { transform: translate(30px, 40px) rotate(5deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

@keyframes modalAppear {
    0% { opacity: 0; transform: scale(0.8) translateY(50px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Interactive Hover Effects */
.hover-zone {
    position: absolute;
    width: 50%;
    height: 50%;
    z-index: 5;
    opacity: 0;
}

.hz-tl { top: 0; left: 0; }
.hz-tr { top: 0; right: 0; }
.hz-bl { bottom: 0; left: 0; }
.hz-br { bottom: 0; right: 0; }

.hz-tl:hover ~ .card-3d .front-side {
    transform: rotateX(5deg) rotateY(-5deg) scale(0.98);
}

.hz-tr:hover ~ .card-3d .front-side {
    transform: rotateX(5deg) rotateY(5deg) scale(0.98);
}

.hz-bl:hover ~ .card-3d .front-side {
    transform: rotateX(-5deg) rotateY(-5deg) scale(0.98);
}

.hz-br:hover ~ .card-3d .front-side {
    transform: rotateX(-5deg) rotateY(5deg) scale(0.98);
}

/* Card flipped state */
.card-3d.flipped {
    transform: rotateY(180deg);
}

/* Responsive */
@media (max-width: 768px) {
    .portfolio-container {
        gap: 30px;
    }
    
    .card-3d {
        height: 450px;
    }
    
    .card-title {
        font-size: 2rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .preview-section {
        gap: 30px;
    }
    
    .preview-container, .front-side, .back-side {
        padding: 30px;
    }
}

/* Footer - Premium Design */
.footer {
    background: linear-gradient(135deg, var(--dark) 0%, #1e293b 50%, var(--dark) 100%);
    color: white;
    padding: var(--space-16) 0 var(--space-6);
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.footer .container {
    position: relative;
    z-index: 1;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 2fr 1fr;
    gap: var(--space-12);
    align-items: start;
    margin-bottom: var(--space-12);
    padding-bottom: var(--space-8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        text-align: center;
    }
}

.footer-logo h3 {
    font-size: var(--text-2xl);
    font-weight: var(--font-extrabold);
    margin-bottom: var(--space-3);
    color: white;
    background: linear-gradient(135deg, #ffffff 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-logo p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-6);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all var(--transition-smooth);
    font-weight: var(--font-medium);
    font-size: var(--text-base);
    position: relative;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
}

.footer-links a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width var(--transition);
    border-radius: var(--radius-full);
}

.footer-links a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.footer-links a:hover::before {
    width: calc(100% - var(--space-4));
}

.footer-social {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.footer-social h4 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* Footer CV Download Button */
.footer-cv {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-cv .button {
    display: flex;
    justify-content: center;
}

.footer-cv .anchor {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #FF7A01 0%, #E66A00 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 122, 1, 0.3);
}

.footer-cv .anchor:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 122, 1, 0.5);
}

.social-media-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.social-icon {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-full);
    text-decoration: none;
    color: white;
    font-weight: var(--font-semibold);
    transition: all var(--transition-smooth);
    font-size: var(--text-base);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.social-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.social-icon:hover::before {
    width: 200px;
    height: 200px;
}

.social-icon i {
    font-size: 1.25rem;
    position: relative;
    z-index: 1;
    transition: transform var(--transition);
}

.social-icon span {
    position: relative;
    z-index: 1;
}

.social-icon:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.social-icon:hover i {
    transform: scale(1.2) rotate(5deg);
}

/* LinkedIn - Blue */
.social-icon.linkedin {
    background: #0077b5;
}

.social-icon.linkedin:hover {
    background: #005885;
    box-shadow: 0 4px 12px rgba(0, 119, 181, 0.4);
}

/* Instagram - Gradient Pink/Orange */
.social-icon.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.social-icon.instagram:hover {
    background: linear-gradient(45deg, #d17a1f 0%, #c94e1c 25%, #b81d2d 50%, #a81a4e 75%, #980f6a 100%);
    box-shadow: 0 4px 12px rgba(225, 48, 108, 0.4);
}

/* GitHub - Dark Gray/Black */
.social-icon.github {
    background: #181717;
}

.social-icon.github:hover {
    background: #0d0d0d;
    box-shadow: 0 4px 12px rgba(24, 23, 23, 0.4);
}

/* Email - Red */
.social-icon.email {
    background: #EA4335;
}

.social-icon.email:hover {
    background: #c5221f;
    box-shadow: 0 4px 12px rgba(234, 67, 53, 0.4);
}

/* WhatsApp - Green */
.social-icon.whatsapp {
    background: #25D366;
}

.social-icon.whatsapp:hover {
    background: #1da851;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* Location - Gray */
.social-icon.location {
    background: #6b7280;
}

.social-icon.location:hover {
    background: #4b5563;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-8);
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--text-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.footer-bottom p {
    margin: 0;
    line-height: var(--leading-relaxed);
}

.footer-bottom p:last-child {
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--text-xs);
}

/* Scroll Progress - Enhanced */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    z-index: var(--z-loading);
    pointer-events: none;
    backdrop-filter: blur(10px);
}

.scroll-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.1s ease;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.6);
    position: relative;
    overflow: hidden;
}

.scroll-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Back to Top - Premium Button */
.back-to-top {
    position: fixed;
    bottom: var(--space-8);
    right: var(--space-8);
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-colored);
    transition: all var(--transition-smooth);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    z-index: var(--z-fixed);
    backdrop-filter: blur(10px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: var(--shadow-colored-lg);
}

.back-to-top:active {
    transform: translateY(-2px) scale(1.05);
}

.back-to-top::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.back-to-top:hover::before {
    width: 100px;
    height: 100px;
}

.back-to-top i {
    position: relative;
    z-index: 1;
    transition: transform var(--transition);
}

.back-to-top:hover i {
    transform: translateY(-2px);
}

/* Section Reveal Animations */
section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Page Transition Effects */
@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    animation: pageFadeIn 0.6s var(--ease-out);
}

/* Enhanced Focus States for Accessibility */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
    border-radius: var(--radius-sm);
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Enhanced Touch Interactions */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .card,
    .feature,
    .project-card,
    .certificate-card {
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
    }
    
    .btn:active,
    .card:active {
        transform: scale(0.98);
    }
}

/* Enhanced Loading Screen */
.loading-screen {
    background: linear-gradient(135deg, var(--dark) 0%, #1e293b 50%, #0f172a 100%);
}

.loading-content {
    position: relative;
    z-index: 2;
}

/* Enhanced Form Input States */
.form-container .form .input:focus,
.form-container .form .textarea:focus {
    background-color: #003747;
    border-left: 5px solid #ff7a01;
    box-shadow: 0 0 20px rgba(255, 122, 1, 0.2);
}

.form-container .form .input:valid {
    border-left-color: #10b981;
}

.form-container .form .input:invalid:not(:placeholder-shown) {
    border-left-color: #ef4444;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 640px) {
    :root {
        --section-padding-y: 3rem;
        --section-padding-y-mobile: 2.5rem;
    }
    
    .section-title {
        font-size: var(--text-3xl);
        margin-bottom: var(--space-8);
    }
    
    .hero {
        padding: calc(80px + var(--space-12)) 0 var(--space-12);
        min-height: auto;
    }
    
    .hero-title {
        font-size: var(--text-4xl);
    }
    
    .hero-content {
        gap: var(--space-8);
    }
    
    .stat {
        padding: var(--space-4) var(--space-3);
    }
    
    .back-to-top {
        width: 48px;
        height: 48px;
        bottom: var(--space-6);
        right: var(--space-6);
        font-size: 1.1rem;
    }
    
    .navbar .container {
        padding: var(--space-3) var(--space-4);
    }
    
    .logo {
        font-size: var(--text-xl);
    }
    
    .form-container {
        padding: var(--space-6);
        margin: var(--space-4) auto;
    }
    
    .footer {
        padding: var(--space-12) 0 var(--space-4);
    }
    
    .footer-content {
        gap: var(--space-6);
        margin-bottom: var(--space-8);
    }
    
    .social-media-icons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .social-icon {
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-sm);
    }
}

/* Enhanced Tablet Responsiveness */
@media (min-width: 641px) and (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-image {
        order: -1;
    }
    
    .projects-grid,
    .certificates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Astronaut Animation - From Uiverse.io by JkHuger */
.astronaut-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .astronaut-container {
        opacity: 0.4;
    }
}

@keyframes snow {
    0% {
        opacity: 0;
        transform: translateY(0px);
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: translateY(650px);
    }
}

@keyframes astronaut {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.box-of-star1,
.box-of-star2,
.box-of-star3,
.box-of-star4 {
    width: 100%;
    position: absolute;
    z-index: 10;
    left: 0;
    top: 0;
    transform: translateY(0px);
    height: 700px;
}

.box-of-star1 {
    animation: snow 5s linear infinite;
}

.box-of-star2 {
    animation: snow 5s -1.64s linear infinite;
}

.box-of-star3 {
    animation: snow 5s -2.30s linear infinite;
}

.box-of-star4 {
    animation: snow 5s -3.30s linear infinite;
}

.star {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: #FFF;
    position: absolute;
    z-index: 10;
    opacity: 0.7;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.star:before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #FFF;
    position: absolute;
    z-index: 10;
    top: 80px;
    left: 70px;
    opacity: .7;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.star:after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #FFF;
    position: absolute;
    z-index: 10;
    top: 8px;
    left: 170px;
    opacity: .9;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.star-position1 {
    top: 30px;
    left: 20px;
}

.star-position2 {
    top: 110px;
    left: 250px;
}

.star-position3 {
    top: 60px;
    left: 570px;
}

.star-position4 {
    top: 120px;
    left: 900px;
}

.star-position5 {
    top: 20px;
    left: 1120px;
}

.star-position6 {
    top: 90px;
    left: 1280px;
}

.star-position7 {
    top: 30px;
    left: 1480px;
}

.astronaut {
    width: 250px;
    height: 300px;
    position: absolute;
    z-index: 11;
    top: calc(50% - 150px);
    left: calc(50% - 125px);
    animation: astronaut 5s linear infinite;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
}

.schoolbag {
    width: 100px;
    height: 150px;
    position: absolute;
    z-index: 1;
    top: calc(50% - 75px);
    left: calc(50% - 50px);
    background-color: #94b7ca;
    border-radius: 50px 50px 0 0 / 30px 30px 0 0;
}

.head {
    width: 97px;
    height: 80px;
    position: absolute;
    z-index: 3;
    background: -webkit-linear-gradient(left, #e3e8eb 0%, #e3e8eb 50%, #fbfdfa 50%, #fbfdfa 100%);
    background: linear-gradient(to right, #e3e8eb 0%, #e3e8eb 50%, #fbfdfa 50%, #fbfdfa 100%);
    border-radius: 50%;
    top: 34px;
    left: calc(50% - 47.5px);
}

.head:after {
    content: "";
    width: 60px;
    height: 50px;
    position: absolute;
    top: calc(50% - 25px);
    left: calc(50% - 30px);
    background: -webkit-linear-gradient(top, #15aece 0%, #15aece 50%, #0391bf 50%, #0391bf 100%);
    background: linear-gradient(to bottom, #15aece 0%, #15aece 50%, #0391bf 50%, #0391bf 100%);
    border-radius: 15px;
}

.head:before {
    content: "";
    width: 12px;
    height: 25px;
    position: absolute;
    top: calc(50% - 12.5px);
    left: -4px;
    background-color: #618095;
    border-radius: 5px;
    box-shadow: 92px 0px 0px #618095;
}

.body {
    width: 85px;
    height: 100px;
    position: absolute;
    z-index: 2;
    background-color: #fffbff;
    border-radius: 40px / 20px;
    top: 105px;
    left: calc(50% - 41px);
    background: -webkit-linear-gradient(left, #e3e8eb 0%, #e3e8eb 50%, #fbfdfa 50%, #fbfdfa 100%);
    background: linear-gradient(to right, #e3e8eb 0%, #e3e8eb 50%, #fbfdfa 50%, #fbfdfa 100%);
}

.panel {
    width: 60px;
    height: 40px;
    position: absolute;
    top: 20px;
    left: calc(50% - 30px);
    background-color: #b7cceb;
}

.panel:before {
    content: "";
    width: 30px;
    height: 5px;
    position: absolute;
    top: 9px;
    left: 7px;
    background-color: #fbfdfa;
    box-shadow: 0px 9px 0px #fbfdfa, 0px 18px 0px #fbfdfa;
}

.panel:after {
    content: "";
    width: 8px;
    height: 8px;
    position: absolute;
    top: 9px;
    right: 7px;
    background-color: #fbfdfa;
    border-radius: 50%;
    box-shadow: 0px 14px 0px 2px #fbfdfa;
}

.arm {
    width: 80px;
    height: 30px;
    position: absolute;
    top: 121px;
    z-index: 2;
}

.arm-left {
    left: 30px;
    background-color: #e3e8eb;
    border-radius: 0 0 0 39px;
}

.arm-right {
    right: 30px;
    background-color: #fbfdfa;
    border-radius: 0 0 39px 0;
}

.arm-left:before,
.arm-right:before {
    content: "";
    width: 30px;
    height: 70px;
    position: absolute;
    top: -40px;
}

.arm-left:before {
    border-radius: 50px 50px 0px 120px / 50px 50px 0 110px;
    left: 0;
    background-color: #e3e8eb;
}

.arm-right:before {
    border-radius: 50px 50px 120px 0 / 50px 50px 110px 0;
    right: 0;
    background-color: #fbfdfa;
}

.arm-left:after,
.arm-right:after {
    content: "";
    width: 30px;
    height: 10px;
    position: absolute;
    top: -24px;
}

.arm-left:after {
    background-color: #6e91a4;
    left: 0;
}

.arm-right:after {
    right: 0;
    background-color: #b6d2e0;
}

.leg {
    width: 30px;
    height: 40px;
    position: absolute;
    z-index: 2;
    bottom: 70px;
}

.leg-left {
    left: 76px;
    background-color: #e3e8eb;
    transform: rotate(20deg);
}

.leg-right {
    right: 73px;
    background-color: #fbfdfa;
    transform: rotate(-20deg);
}

.leg-left:before,
.leg-right:before {
    content: "";
    width: 50px;
    height: 25px;
    position: absolute;
    bottom: -26px;
}

.leg-left:before {
    left: -20px;
    background-color: #e3e8eb;
    border-radius: 30px 0 0 0;
    border-bottom: 10px solid #6d96ac;
}

.leg-right:before {
    right: -20px;
    background-color: #fbfdfa;
    border-radius: 0 30px 0 0;
    border-bottom: 10px solid #b0cfe4;
}

/* Responsive adjustments for astronaut */
@media (max-width: 1200px) {
    .astronaut {
        width: 200px;
        height: 240px;
        top: calc(50% - 120px);
        left: calc(50% - 100px);
    }
    
    .star-position4 {
        left: 80%;
    }
    
    .star-position5 {
        left: 90%;
    }
    
    .star-position6,
    .star-position7 {
        display: none;
    }
}

@media (max-width: 768px) {
    .astronaut-container {
        display: none; /* Hide on mobile for better performance */
    }
}

@media (prefers-reduced-motion: reduce) {
    .astronaut,
    .box-of-star1,
    .box-of-star2,
    .box-of-star3,
    .box-of-star4 {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .loading-screen,
    .back-to-top,
    .scroll-progress,
    .flip-trigger,
    .action-buttons,
    .footer {
        display: none !important;
    }
    
    section {
        page-break-inside: avoid;
        padding: 1rem 0;
    }
    
    .hero {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .certificate-card,
    .project-card,
    .skill-category {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .hero-image .profile-img {
        border: 1px solid #ddd;
    }
}
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 100;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.6);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlide 0.3s ease;
    border: 1px solid var(--border-color);
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.25rem;
    height: 500px;
    background: var(--bg-primary);
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.modal-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .unified-contact-card {
        grid-template-columns: 1fr;
        gap: 3rem;
        padding: 3rem;
    }
    
    .contact-info-section {
        border-left: none;
        border-bottom: 2px solid var(--border-color);
        padding-left: 0;
        padding-bottom: 2rem;
    }
    
    .hero-stats,
    .skills-grid,
    .certificates-grid,
    .projects-grid,
    .gallery-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .about-features {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .timeline::before {
        right: 30px;
    }
    
    .timeline-item {
        width: 100%;
        right: 0 !important;
        padding-left: 4.375rem !important;
        padding-right: 0 !important;
    }
    
    .timeline-content::before {
        left: -3.125rem !important;
    }
    
    .modal-prev {
        right: 10px;
    }
    
    .modal-next {
        left: 10px;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 540px;
        padding: 0 1rem;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--bg-card);
        flex-direction: column;
        gap: 0;
        transition: var(--transition);
        padding: 1.25rem;
        box-shadow: var(--shadow-lg);
        z-index: 999;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a {
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        justify-content: flex-start;
    }
    
    .hero {
        padding: 6rem 0 3rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .hero-stats,
    .skills-grid,
    .certificates-grid,
    .about-features,
    .projects-grid,
    .gallery-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .social-media-icons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .social-icon {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .image-wrapper {
        width: 300px;
        height: 300px;
    }
    
    .modal-content-wrapper {
        max-width: 95vw;
    }
    
    .modal-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .modal-prev {
        right: -50px;
    }
    
    .modal-next {
        left: -50px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 0.9375rem;
    }
    
    .hero {
        padding: 5rem 0 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .hero-stats {
        gap: 0.75rem;
    }
    
    .stat {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .image-wrapper {
        width: 250px;
        height: 250px;
    }
    
    .unified-contact-card {
        padding: 2rem 1.5rem;
        gap: 2rem;
    }
    
    .contact-detail-item {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .detail-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .form-input,
    .form-textarea {
        padding: 1rem 1rem 0.5rem 3rem;
        font-size: 0.95rem;
    }
    
    .form-label {
        right: 2.5rem;
        font-size: 0.95rem;
    }
    
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        left: 20px;
    }
}

/* Print Styles */
@media print {
    .loading-screen,
    .navbar,
    .hero-buttons,
    .theme-toggle,
    .menu-toggle,
    .back-to-top,
    .scroll-progress,
    .contact-form-section,
    .footer {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero-title {
        color: #000;
    }
    
    .hero-description,
    .about-text p,
    .timeline-list li,
    .skill-info span,
    .project-card p,
    .contact-info-header p {
        color: #333;
    }
    
    .section-title,
    .section-subtitle {
        color: #000;
    }
    
    .quote-terminal {
        box-shadow: none;
        border: 1px solid #ddd;
        background: #fff;
    }
    
    .feature,
    .project-card,
    .certificate-card,
    .skill-category,
    .timeline-content {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    a {
        color: #000;
        text-decoration: none;
    }
    
    .hero-image .profile-img {
        border: 1px solid #ddd;
    }
    
    .page-break {
        page-break-before: always;
    }
}