/* Typography Foundation */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
:root {
    /* Modern Color Palette - Primary */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;
    
    /* Modern Color Palette - Secondary */
    --secondary-50: #f5f3ff;
    --secondary-100: #ede9fe;
    --secondary-200: #ddd6fe;
    --secondary-300: #c4b5fd;
    --secondary-400: #a78bfa;
    --secondary-500: #8b5cf6;
    --secondary-600: #7c3aed;
    --secondary-700: #6d28d9;
    --secondary-800: #5b21b6;
    --secondary-900: #4c1d95;
    
    /* Semantic Colors */
    --success-50: #ecfdf5;
    --success-100: #d1fae5;
    --success-500: #10b981;
    --success-600: #059669;
    --success-700: #047857;
    
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --warning-700: #b45309;
    
    --error-50: #fef2f2;
    --error-100: #fee2e2;
    --error-500: #ef4444;
    --error-600: #dc2626;
    --error-700: #b91c1c;
    
    /* Neutral Grays */
    --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;
    
    /* Backward Compatibility */
    --primary-color: var(--primary-500);
    --primary-dark: var(--primary-700);
    --primary-light: var(--primary-300);
    --secondary-color: var(--secondary-600);
    --secondary-light: var(--secondary-300);
    --dark-color: var(--gray-800);
    --light-color: var(--gray-50);
    --success-color: var(--success-500);
    --success-dark: var(--success-700);
    --warning-color: var(--warning-500);
    
    /* Enhanced Shadows */
    --shadow-xs: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 3px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 6px 10px -2px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 15px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 35px -10px rgba(0, 0, 0, 0.25), 0 15px 15px -10px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 35px 60px -15px rgba(0, 0, 0, 0.35);
    
    /* Enhanced Transitions */
    --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);
    
    /* Modern Border Radius */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Typography Scale */
    --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 */
    
    /* Spacing Scale */
    --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 */
    
    /* Light mode colors */
    --bg-primary: #ffffff;
    --bg-secondary: var(--gray-50);
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --border-color: var(--gray-200);
    --card-bg: #ffffff;
    --input-bg: #ffffff;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --text-primary: #ffffff;
        --text-secondary: #b0b0b0;
        --border-color: #404040;
        --card-bg: #2d2d2d;
        --input-bg: #3d3d3d;
        
        /* Adjust shadows for dark mode */
        --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 8px 18px rgba(0, 0, 0, 0.45);
        --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.5);
    }
}

/* Dark mode class for manual toggle */
.dark-mode {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --card-bg: #2d2d2d;
    --input-bg: #3d3d3d;
    --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 18px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.5);
}

body {
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: var(--text-base);
    line-height: 1.6;
    font-weight: 400;
    padding-bottom: 70px;
    color: var(--text-primary);
    transition: var(--transition);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Parallax effect for the background */
.parallax-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    background: linear-gradient(135deg,
        var(--primary-50) 0%,
        var(--secondary-50) 25%,
        var(--primary-100) 50%,
        var(--secondary-100) 75%,
        var(--primary-50) 100%);
    z-index: -10;
    will-change: transform;
    animation: parallaxFloat 20s infinite linear;
}

@keyframes parallaxFloat {
    0% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(0.5deg); }
    50% { transform: translateY(-10px) rotate(-0.3deg); }
    75% { transform: translateY(-30px) rotate(0.8deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* Hides the parallax effect in dark mode */
.dark-mode .parallax-bg {
    display: none;
}

@media (prefers-color-scheme: dark) {
    .parallax-bg {
        display: none;
    }
}

/* Enhanced Typography Scale */
h1, .h1 {
    font-size: var(--text-4xl);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
    margin-bottom: var(--space-4);
}

h2, .h2 {
    font-size: var(--text-3xl);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.015em;
    margin-bottom: var(--space-3);
}

h3, .h3 {
    font-size: var(--text-2xl);
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: var(--space-3);
}

h4, .h4 {
    font-size: var(--text-xl);
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: var(--space-2);
}

h5, .h5 {
    font-size: var(--text-lg);
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: var(--space-2);
}

h6, .h6 {
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: var(--space-2);
}

p {
    margin-bottom: var(--space-4);
    line-height: 1.6;
}

.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.main-content {
    margin-top: 90px;
}

.jumbotron {
    background: linear-gradient(315deg, #4e54c8, #8f94fb);
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    color: white;
    position: relative;
    overflow: hidden;
}

.jumbotron::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    z-index: 0;
}

/* Modern Card System */
.card {
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-lg);
    margin-top: var(--space-6);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    overflow: hidden;
    transform: translateZ(0); /* Hardware acceleration */
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--gray-300);
}

.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.navbar-brand, .nav-link {
    color: var(--gray-800) !important;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

.navbar-brand {
    font-weight: 700;
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: rgba(26, 42, 58, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px 0;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.footer .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.footer a {
    color: var(--primary-light) !important;
    transition: var(--transition);
    text-decoration: none;
}

.footer a:hover {
    color: white !important;
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 10vh;
    background: var(--dark-color);
}

/* Modern Drag & Drop Area */
.drag-drop-area {
    background: linear-gradient(135deg, var(--gray-50), var(--primary-50));
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: var(--space-12) var(--space-8);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drag-drop-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: var(--transition);
}

.drag-drop-area:hover,
.drag-drop-area:focus-visible {
    border-color: var(--primary-500);
    background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.drag-drop-area:hover::before,
.drag-drop-area.drag-over::before {
    opacity: 1;
}

.drag-drop-area.drag-over {
    border-color: var(--primary-500);
    background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-lg);
    animation: pulse-border 1s infinite;
}

.drag-drop-area i {
    color: var(--primary-500);
    transition: var(--transition);
    margin-bottom: var(--space-4);
}

.drag-drop-area:hover i,
.drag-drop-area.drag-over i {
    color: var(--primary-600);
    transform: scale(1.1);
}

@keyframes pulse-border {
    0%, 100% {
        border-color: var(--primary-500);
        box-shadow: var(--shadow-md);
    }
    50% {
        border-color: var(--primary-600);
        box-shadow: var(--shadow-lg), 0 0 20px rgba(59, 130, 246, 0.3);
    }
}

/* Modern Button System */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    font-weight: 600;
    letter-spacing: 0.025em;
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
    min-height: 44px; /* Touch-friendly */
    cursor: pointer;
    text-decoration: none;
    transform: translateZ(0); /* Hardware acceleration */
    will-change: transform, box-shadow;
}

.btn-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    z-index: -1;
    transition: width 0.3s ease;
}

.btn-icon:hover::before {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.25);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-success {
    background: linear-gradient(to right, var(--success-color), #0cc5b7);
    color: white;
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(0, 210, 170, 0.25);
}

.btn-success:active {
    transform: translateY(1px);
}

.btn-copy {
    background: linear-gradient(to right, var(--warning-color), #ffb144);
    color: white;
}

.btn-copy:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(255, 170, 0, 0.25);
}

.btn-copy:active {
    transform: translateY(1px);
}

.progress {
    height: 14px;
    background: #e9ecef;
    border-radius: 50px;
    overflow: hidden;
    margin-top: 20px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    text-align: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    line-height: 14px;
    transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0.4),
        rgba(255, 255, 255, 0)
    );
    animation: shine 2s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%);
    }
    60%, 100% {
        transform: translateX(100%);
    }
}

#processingMessage {
    display: none;
    text-align: center;
    font-size: 1.2em;
    color: var(--primary-color);
    font-weight: 500;
}

#statusMessage {
    display: block;
    text-align: center;
    font-size: 1.1em;
    color: var(--primary-dark);
    font-weight: 500;
    margin-top: 15px;
}

ul {
    padding-left: 1.5rem;
    list-style-type: none;
}

ul li {
    position: relative;
    padding: 5px 0 5px 30px;
}

ul li::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.btn-xl {
    font-size: 20px;
    padding: 16px 32px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 50px;
    box-shadow: 0 6px 18px rgba(50, 50, 93, 0.2);
}

.btn-xl:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(50, 50, 93, 0.3);
}

.btn-xl:active {
    transform: translateY(1px);
}

.advanced-options {
    margin-top: 30px;
}

.advanced-options .accordion-item {
    border: none;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2px;
}

.advanced-options .accordion-header {
    margin: 0;
}

.advanced-options .accordion-button {
    background: linear-gradient(to right, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    font-weight: 600;
    transition: var(--transition);
}

.advanced-options .accordion-button:not(.collapsed) {
    box-shadow: none;
    background: linear-gradient(to right, var(--primary-dark), var(--primary-color));
}

.advanced-options .accordion-button:focus {
    box-shadow: none;
    border: none;
}

.advanced-options .accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.advanced-options .accordion-body {
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 20px;
}

.advanced-options .form-check-label, 
.advanced-options .form-group label {
    color: var(--dark-color);
    font-weight: 500;
    display: flex;
    align-items: center;
}

.form-group small {
    margin-top: 5px;
    display: block;
    color: #6c757d;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.input-group .btn-outline-secondary {
    border-color: #ced4da;
    color: #6c757d;
}

.input-group .btn-outline-secondary:hover {
    background-color: #f8f9fa;
    color: #495057;
}

/* Optimized animations with will-change and hardware acceleration */
.animated {
    animation-duration: 0.6s;
    animation-fill-mode: both;
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.fadeIn {
    animation-name: fadeIn;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.delay-500ms {
    animation-delay: 0.3s;
}

.delay-1000ms {
    animation-delay: 0.6s;
}

.delay-1500ms {
    animation-delay: 0.9s;
}

.delay-2000ms {
    animation-delay: 1.2s;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Optimized progress bar animation */
@keyframes shine {
    0% {
        transform: translateX(-100%) scaleX(0.5);
    }
    60%, 100% {
        transform: translateX(100%) scaleX(0.5);
    }
}

/* Reduced motion support - optimized */
@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;
    }
    
    .animated {
        animation: none !important;
        transform: none !important;
    }
    
    .btn-icon:hover,
    .card:hover,
    .drag-drop-area:hover,
    .logo-container:hover img,
    .logo-container:hover h1::after {
        transform: none !important;
    }
    
    .progress-bar::after {
        animation: none !important;
    }
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 60px;
    margin-bottom: 30px;
    position: relative;
}

.logo-container img {
    height: 60px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
    transition: var(--transition);
}

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

.logo-container h1 {
    font-family: 'Roboto Slab', serif;
    margin-left: 15px;
    color: white;
    position: relative;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(to right, #ffffff, #e0e0e0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-container h1::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -10px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.5s ease;
}

.logo-container:hover h1::after {
    transform: scaleX(1);
}

.password-strength-meter {
    height: 6px;
    background-color: #e9ecef;
    margin-top: 8px;
    border-radius: 3px;
    overflow: hidden;
}

.password-strength-meter div {
    height: 100%;
    width: 0;
    transition: width 0.3s cubic-bezier(0.17, 0.67, 0.83, 0.67);
}

/* Enhanced Card Components */
.card-header {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border-top-left-radius: var(--radius-lg) !important;
    border-top-right-radius: var(--radius-lg) !important;
    padding: var(--space-4) var(--space-6);
    font-weight: 600;
    font-size: var(--text-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-title {
    font-weight: 700;
    color: var(--primary-600);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    font-size: var(--text-xl);
    line-height: 1.2;
}

.card-title i {
    margin-right: var(--space-3);
    color: var(--primary-500);
    flex-shrink: 0;
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--space-4) var(--space-6);
    border-bottom-left-radius: var(--radius-lg) !important;
    border-bottom-right-radius: var(--radius-lg) !important;
}

/* Hero Icon Styling */
.hero-icon {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    color: white;
    box-shadow: 0 8px 20px rgba(50, 50, 93, 0.2);
}

.jumbotron p {
    color: white;
}

.jumbotron p.lead {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

hr.my-4 {
    height: 2px;
    background: linear-gradient(to right, rgba(255,255,255,0.1), rgba(255,255,255,0.5), rgba(255,255,255,0.1));
    border: none;
    margin: 2rem 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .jumbotron {
        padding: 2rem 1rem;
    }
    
    .card {
        margin-bottom: 20px;
    }
    
    .btn-xl {
        font-size: 18px;
        padding: 14px 28px;
    }
    
    .logo-container {
        flex-direction: column;
        text-align: center;
    }
    
    .logo-container h1 {
        margin-left: 0;
        margin-top: 15px;
    }
}

/* Modern Form Controls */
.form-control {
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    border: 1.5px solid var(--gray-300);
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: var(--text-base);
    transition: var(--transition);
    box-shadow: var(--shadow-xs);
    min-height: 44px; /* Touch-friendly */
}

.form-control:hover {
    border-color: var(--primary-400);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.1),
        var(--shadow-sm);
    transform: translateY(-1px);
    background-color: var(--input-bg);
    color: var(--text-primary);
}

.form-control:invalid {
    border-color: var(--error-500);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-control:valid:not(:placeholder-shown) {
    border-color: var(--success-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Enhanced Form Labels */
.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    letter-spacing: 0.025em;
}

/* Form Groups */
.form-group {
    margin-bottom: var(--space-6);
}

.github-logo {
    color: white;
    margin: 0 5px;
}

/* Divider Text */
.divider-text {
    position: relative;
    text-align: center;
    margin: 15px 0;
}

.divider-text span {
    display: inline-block;
    padding: 0 15px;
    background: #fff;
    position: relative;
    z-index: 1;
    color: var(--primary-color);
    font-weight: 500;
}

.divider-text:before {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    background: #e0e0e0;
    left: 0;
    top: 50%;
    z-index: 0;
}

/* Badge Styling */
.badge {
    padding: 6px 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    border-radius: 50px;
}

.bg-primary {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color)) !important;
}

/* Additional Style Enhancements */
#fileNameDisplay {
    font-size: 1.1rem;
    margin-top: 10px;
    color: var(--text-primary);
}

#statusMessage, #uploadedBytes, #downloadedBytes, #downloadSpeed {
    font-weight: 500;
    color: var(--text-primary);
}

#fileID, #fileLink {
    font-family: monospace;
    font-size: 1rem;
    color: var(--text-primary);
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
}

.alert-danger {
    background-color: #fff1f1;
    border-color: #ffcccc;
    color: #cf3535;
    border-radius: var(--radius-sm);
}

@media (prefers-color-scheme: dark) {
    .alert-danger {
        background-color: #2a1a1a;
        border-color: #5c2b2b;
        color: #ff6b6b;
    }
}

.dark-mode .alert-danger {
    background-color: #2a1a1a;
    border-color: #5c2b2b;
    color: #ff6b6b;
}

/* Dark mode specific adjustments */
@media (prefers-color-scheme: dark) {
    .jumbotron {
        background: linear-gradient(315deg, #3a3a6a, #5a5a8a);
    }
    
    .drag-drop-area {
        background: linear-gradient(135deg, #2d2d2d, #3d3d4d);
    }
    
    .footer {
        background: rgba(26, 26, 26, 0.95);
    }
    
    .footer .text-muted {
        color: rgba(255, 255, 255, 0.7) !important;
    }
    
    .text-muted {
        color: #b0b0b0 !important;
    }
    
    .form-text.text-muted {
        color: #a0a0a0 !important;
    }
    
    .progress {
        background-color: #3d3d3d;
    }
    
    .card-title {
        color: var(--primary-light);
    }
    
    .navbar {
        background: rgba(26, 26, 26, 0.95);
    }
    
    .navbar-brand,
    .nav-link {
        color: white !important;
    }
    
    .nav-link:hover {
        color: var(--primary-light) !important;
    }
}

.dark-mode .jumbotron {
    background: linear-gradient(315deg, #3a3a6a, #5a5a8a);
}

.dark-mode .drag-drop-area {
    background: linear-gradient(135deg, #2d2d2d, #3d3d4d);
}

.dark-mode .footer {
    background: rgba(26, 26, 26, 0.95);
}

.dark-mode .footer .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

.dark-mode .text-muted {
    color: #b0b0b0 !important;
}

.dark-mode .form-text.text-muted {
    color: #a0a0a0 !important;
}

.dark-mode .progress {
    background-color: #3d3d3d;
}

.dark-mode .card-title {
    color: var(--primary-light);
}

.dark-mode .navbar {
    background: rgba(26, 26, 26, 0.95);
}

.dark-mode .navbar-brand,
.dark-mode .nav-link {
    color: white !important;
}

.dark-mode .nav-link:hover {
    color: var(--primary-light) !important;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    color: white;
    flex-shrink: 0;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
    background: rgba(0, 0, 0, 0.9);
}

.dark-mode-toggle i {
    font-size: 1.1rem;
    color: white;
}

/* Light mode adjustments for navbar */
.navbar-light .dark-mode-toggle {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.8);
}

.navbar-light .dark-mode-toggle i {
    color: white;
}

.navbar-light .dark-mode-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Ensure dark mode toggle works in dark mode navbar */
.navbar:not(.navbar-light) .dark-mode-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.navbar:not(.navbar-light) .dark-mode-toggle i {
    color: white;
}

.navbar:not(.navbar-light) .dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Mobile layout adjustments */
@media (max-width: 767.98px) {
    .navbar .d-flex.align-items-center {
        gap: 0.5rem;
    }
    
    .dark-mode-toggle {
        width: 32px;
        height: 32px;
        margin-right: 0 !important;
    }
    
    .dark-mode-toggle i {
        font-size: 0.9rem;
    }
    
    .navbar-toggler {
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-toggler-icon {
        width: 1.2em;
        height: 1.2em;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .navbar .d-flex.align-items-center {
        gap: 0.25rem;
    }
    
    .dark-mode-toggle {
        width: 30px;
        height: 30px;
    }
    
    .dark-mode-toggle i {
        font-size: 0.85rem;
    }
}

/* Ensure text colors adapt to dark mode */
h1, h2, h3, h4, h5, h6,
p, span, div,
.form-label,
.form-check-label {
    color: var(--text-primary);
}

/* Ensure form elements adapt */
.form-check-input {
    background-color: var(--input-bg);
    border-color: var(--border-color);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Ensure all backgrounds adapt */
.main-content,
.container {
    background-color: var(--bg-primary);
}

/* Ensure all borders adapt */
.border-bottom {
    border-bottom-color: var(--border-color) !important;
}

/* Enhanced Loading States and Animations */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

/* Progress bar completion state */
.progress-complete {
    background: linear-gradient(to right, var(--success-color), #0cc5b7) !important;
}

.progress-complete::after {
    animation: none;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.6),
        rgba(255, 255, 255, 0.8),
        rgba(255, 255, 255, 0.6)
    );
}

/* Success message styling */
.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-top: 15px;
}

.alert-success:focus {
    outline: 2px solid #155724;
    outline-offset: 2px;
}

/* Shake animation for error messages */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.alert-shake {
    animation: shake 0.5s ease-in-out;
}

/* Enhanced button states */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Improved copy button feedback */
.btn-copy.btn-success {
    background: linear-gradient(to right, var(--success-color), #0cc5b7) !important;
    border-color: var(--success-color) !important;
}

.btn-copy.btn-success:hover {
    background: linear-gradient(to right, var(--success-dark), #0aa89a) !important;
}

/* Loading spinner animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

/* Enhanced status message styling */
#statusMessage[aria-busy="true"]::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    margin-right: 8px;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

/* Optimized file selection feedback with GPU acceleration */
#selectedFileName {
    font-weight: 600;
    color: var(--primary-color);
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary-color);
    margin-top: 10px;
    transform: translateZ(0);
    will-change: transform, opacity;
}

/* Enhanced progress bar states */
.progress-bar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar:not([style*="width: 0%"]) {
    box-shadow: 0 0 10px rgba(58, 123, 213, 0.3);
}

/* Upload/Download speed display */
#uploadedBytes, #downloadedBytes, #downloadSpeed {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: var(--dark-color);
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin: 2px;
}

/* Enhanced form validation states */
.form-control:invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.1);
}

.form-control:valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.1);
}

/* Better focus states for interactive elements */
.btn:focus,
.form-control:focus,
.form-check-input:focus {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Enhanced drag and drop feedback */
.drag-drop-area.drag-over {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb) !important;
    border: 2px dashed var(--secondary-color) !important;
    transform: scale(1.02);
}

.drag-drop-area.drag-over i {
    color: var(--secondary-color) !important;
    transform: scale(1.3);
}

/* Improved responsive design for loading states */
@media (max-width: 768px) {
    .btn-icon {
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .spinner-border-sm {
        width: 0.8rem;
        height: 0.8rem;
    }
    
    #statusMessage[aria-busy="true"]::before {
        width: 14px;
        height: 14px;
    }
}

/* Smooth transitions for all state changes */
.btn,
.form-control,
.progress-bar,
.alert {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced visual hierarchy for important elements */
.card-header {
    font-weight: 700;
    font-size: 1.1rem;
}

.hero-icon {
    box-shadow: 0 8px 25px rgba(50, 50, 93, 0.3);
}

/* Better contrast for text in gradients */
.jumbotron h1,
.jumbotron p {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Improved button hover effects */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Enhanced Accessibility */
.sr-only {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Modern Focus States */
.focus-ring,
.btn,
.form-control,
.form-check-input,
.accordion-button,
.nav-link,
.drag-drop-area {
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: var(--transition-fast);
}

.focus-ring:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-check-input:focus-visible,
.accordion-button:focus-visible,
.nav-link:focus-visible,
.drag-drop-area:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn,
    .card,
    .form-control {
        border: 2px solid currentColor;
    }
    
    .btn:focus-visible,
    .form-control:focus-visible {
        outline: 4px solid var(--primary-700);
        outline-offset: 2px;
    }
}

/* Enhanced Skip Navigation */
.skip-link {
    position: absolute;
    top: -100px;
    left: var(--space-4);
    background: var(--primary-600);
    color: white;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    z-index: 9999;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.skip-link:focus {
    top: var(--space-4);
    outline: 2px solid var(--primary-300);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0056b3;
        --primary-dark: #003d82;
        --primary-light: #007bff;
        --secondary-color: #6610f2;
        --secondary-light: #7c3aed;
    }
    
    .btn-primary,
    .btn-success,
    .btn-copy {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 1px solid #ccc;
    }
}

/* Reduced motion support */
@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;
    }
    
    .animated {
        animation: none !important;
    }
    
    .btn-icon:hover,
    .card:hover,
    .drag-drop-area:hover {
        transform: none !important;
    }
}

/* Improved focus indicators for form elements */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(58, 123, 213, 0.25);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(58, 123, 213, 0.25);
}

/* Better contrast for text */
.text-primary {
    color: var(--primary-dark) !important;
}

.text-muted {
    color: #6c757d !important;
}

/* Improved button contrast */
.btn {
    font-weight: 600;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Enhanced error message contrast */
.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-danger:focus {
    outline: 2px solid #721c24;
    outline-offset: 2px;
}

/* Improved progress bar accessibility */
.progress-bar {
    font-size: 12px;
    font-weight: 600;
}

/* Better link contrast */
a:not(.btn) {
    color: var(--primary-color);
    text-decoration: underline;
}

a:not(.btn):hover {
    color: var(--primary-dark);
    text-decoration: none;
}

/* Improved form label contrast */
.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Enhanced card header contrast */
.card-header {
    font-weight: 700;
}

/* Better icon contrast */
.hero-icon {
    background: linear-gradient(to right, var(--primary-dark), var(--primary-color));
}

/* Improved navbar contrast for accessibility */
.navbar {
    background: rgba(255, 255, 255, 0.95);
}

.navbar-brand,
.nav-link {
    color: var(--gray-800) !important;
    font-weight: 600;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

/* Optimized file preview animations */
.file-preview {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
    transform: translateZ(0);
    will-change: transform, opacity;
}

/* Preview animations - optimized */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.file-preview:not(.d-none) {
    animation: slideIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.file-preview {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
}

.preview-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.preview-content {
    padding-top: 10px;
}

.image-preview img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.text-preview pre {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
}

.generic-preview .file-info {
    text-align: center;
    padding: 20px;
}

.generic-preview .file-info i {
    color: var(--primary-color);
}

.generic-preview .file-name {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.generic-preview .file-size,
.generic-preview .file-type {
    color: var(--text-secondary);
}

/* Preview animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-preview:not(.d-none) {
    animation: slideIn 0.3s ease-out;
}

/* Responsive adjustments for file preview */
@media (max-width: 768px) {
    .file-preview {
        padding: 10px;
    }
    
    .image-preview img {
        max-height: 150px;
    }
    
    .text-preview pre {
        max-height: 100px;
        font-size: 0.8rem;
    }
    
    .generic-preview .file-info {
        padding: 15px;
    }
}

/* Notification System Styles */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

.notification {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.hide {
    transform: translateX(400px);
    opacity: 0;
}

.notification-icon {
    font-size: 1.25rem;
    min-width: 24px;
    margin-top: 2px;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
    line-height: 1.3;
}

.notification-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 1rem;
    transition: var(--transition);
    margin-top: 2px;
    min-width: 24px;
}

.notification-close:hover {
    color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.1);
}

.notification-close:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

/* Notification Types */
.notification-success {
    border-left: 4px solid var(--success-color);
    background-color: rgba(32, 201, 151, 0.05);
}

.notification-success .notification-icon {
    color: var(--success-color);
}

.notification-error {
    border-left: 4px solid #dc3545;
    background-color: rgba(220, 53, 69, 0.05);
}

.notification-error .notification-icon {
    color: #dc3545;
}

.notification-warning {
    border-left: 4px solid var(--warning-color);
    background-color: rgba(253, 126, 20, 0.05);
}

.notification-warning .notification-icon {
    color: var(--warning-color);
}

.notification-info {
    border-left: 4px solid var(--primary-color);
    background-color: rgba(58, 123, 213, 0.05);
}

.notification-info .notification-icon {
    color: var(--primary-color);
}

/* Progress notification */
.notification-progress {
    border-left: 4px solid var(--primary-color);
    background-color: rgba(58, 123, 213, 0.05);
}

.notification-progress .notification-icon {
    color: var(--primary-color);
}

.notification-progress .progress {
    height: 6px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.notification-progress .progress-bar {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

/* Dark mode adjustments for notifications */
@media (prefers-color-scheme: dark) {
    .notification {
        background-color: var(--card-bg);
        border-color: var(--border-color);
    }
    
    .notification-success {
        background-color: rgba(32, 201, 151, 0.1);
    }
    
    .notification-error {
        background-color: rgba(220, 53, 69, 0.1);
    }
    
    .notification-warning {
        background-color: rgba(253, 126, 20, 0.1);
    }
    
    .notification-info {
        background-color: rgba(58, 123, 213, 0.1);
    }
    
    .notification-progress {
        background-color: rgba(58, 123, 213, 0.1);
    }
    
    .notification-close:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

.dark-mode .notification {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

.dark-mode .notification-success {
    background-color: rgba(32, 201, 151, 0.1);
}

.dark-mode .notification-error {
    background-color: rgba(220, 53, 69, 0.1);
}

.dark-mode .notification-warning {
    background-color: rgba(253, 126, 20, 0.1);
}

.dark-mode .notification-info {
    background-color: rgba(58, 123, 213, 0.1);
}

.dark-mode .notification-progress {
    background-color: rgba(58, 123, 213, 0.1);
}

.dark-mode .notification-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Responsive notifications */
@media (max-width: 768px) {
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification {
        padding: 14px 16px;
    }
    
    .notification-title {
        font-size: 0.95rem;
    }
    
    .notification-message {
        font-size: 0.85rem;
    }
}

/* Animation keyframes for notifications */
@keyframes notificationSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Reduced motion support for notifications */
@media (prefers-reduced-motion: reduce) {
    .notification {
        transition: none;
    }
    
    .notification.show,
    .notification.hide {
        animation: none;
    }
}

/* Accessibility improvements for notifications */
.notification:focus-within {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.notification[role="alert"] {
    border-width: 2px;
}

/* Stacking context for multiple notifications */
.notification-container > *:nth-child(1) { z-index: 100; }
.notification-container > *:nth-child(2) { z-index: 99; }
.notification-container > *:nth-child(3) { z-index: 98; }
.notification-container > *:nth-child(4) { z-index: 97; }
.notification-container > *:nth-child(5) { z-index: 96; }

/* Hover effects for notifications */
.notification:hover {
    transform: translateX(-2px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.notification.show:hover {
    transform: translateX(-2px) scale(1.02);
}

/* Auto-hide animation */
.notification.auto-hide {
    animation: notificationSlideOut 0.3s ease forwards 3s;
}

/* Pause auto-hide on hover */
.notification.auto-hide:hover {
    animation-play-state: paused;
}

/* Touch device optimizations */
@media (hover: none) {
    .notification:hover {
        transform: none;
    }
    
    .notification.auto-hide:hover {
        animation-play-state: running;
    }
}

/* Enhanced Micro-Interactions and Hover Effects */

/* Enhanced button ripple effect */
.btn-icon::after {
    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 ease, height 0.6s ease;
    z-index: -1;
}

.btn-icon:hover::after {
    width: 300px;
    height: 300px;
}

/* Enhanced form control interactions */
.form-control {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control:hover {
    border-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.form-control:focus {
    transform: translateY(-2px);
    box-shadow: 0 0 0 0.3rem rgba(58, 123, 213, 0.15);
}

/* Enhanced checkbox and radio interactions */
.form-check-input {
    transition: all 0.3s ease;
    cursor: pointer;
}

.form-check-input:hover {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.form-check-input:checked {
    transform: scale(1.05);
}

.form-check-label {
    transition: color 0.3s ease;
    cursor: pointer;
}

.form-check-label:hover {
    color: var(--primary-color);
}

/* Enhanced card hover effects with depth */
.card {
    perspective: 1000px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card:hover .card-inner {
    transform: rotateY(5deg) rotateX(2deg);
}

.card-header, .card-body {
    backface-visibility: hidden;
}

/* Enhanced progress bar micro-interactions */
.progress-bar {
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Enhanced file preview interactions */
.file-preview {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.file-preview:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.file-preview:active {
    transform: translateY(0) scale(0.98);
}

/* Enhanced icon hover effects */
.icon-hover {
    transition: all 0.3s ease;
    display: inline-block;
}

.icon-hover:hover {
    transform: scale(1.2) rotate(5deg);
    color: var(--primary-color);
}

.icon-hover:active {
    transform: scale(0.95);
}

/* Enhanced text hover effects */
.text-hover {
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.text-hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.text-hover:hover::after {
    width: 100%;
}

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

/* Enhanced loading spinner */
.spinner-border {
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
}

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

/* Enhanced focus states with glow effect */
.btn:focus,
.form-control:focus,
.form-check-input:focus {
    animation: focus-glow 0.6s ease-out;
}

@keyframes focus-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(58, 123, 213, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(58, 123, 213, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(58, 123, 213, 0);
    }
}

/* Enhanced drag and drop feedback */
.drag-drop-area {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.drag-drop-area.drag-over {
    animation: pulse-border 1s infinite;
}

@keyframes pulse-border {
    0%, 100% {
        border-color: var(--secondary-color);
        box-shadow: 0 0 0 rgba(111, 66, 193, 0.4);
    }
    50% {
        border-color: var(--primary-color);
        box-shadow: 0 0 20px rgba(111, 66, 193, 0.6);
    }
}

/* Enhanced copy button feedback */
.btn-copy {
    position: relative;
    overflow: hidden;
}

.btn-copy::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 1.2em;
    opacity: 0;
    transition: all 0.3s ease;
}

.btn-copy.copied::before {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.btn-copy.copied span {
    opacity: 0;
}

/* Enhanced toggle switches */
.form-switch .form-check-input {
    width: 3em;
    height: 1.5em;
    background-image: none;
    background-color: #6c757d;
    border: none;
    transition: all 0.3s ease;
}

.form-switch .form-check-input:checked {
    background-color: var(--success-color);
    transform: none;
}

.form-switch .form-check-input::after {
    content: '';
    position: absolute;
    top: 0.15em;
    left: 0.15em;
    width: 1.2em;
    height: 1.2em;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.form-switch .form-check-input:checked::after {
    transform: translateX(1.5em);
}

/* Enhanced tooltip-like hover effects */
.hover-tooltip {
    position: relative;
    cursor: help;
}

.hover-tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: var(--dark-color);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.hover-tooltip:hover::before {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

/* Enhanced scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Enhanced focus-visible states for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Enhanced disabled state interactions */
.btn:disabled,
.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover,
.form-control:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Enhanced success state animations */
.alert-success {
    animation: slideInFromRight 0.5s ease-out;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Enhanced error state animations */
.alert-danger {
    animation: shake 0.5s ease-in-out;
}

/* Enhanced loading state for buttons */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Enhanced transition for all interactive elements */
.btn,
.form-control,
.form-check-input,
.card,
.drag-drop-area,
.nav-link,
.accordion-button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reduced motion support for enhanced interactions */
@media (prefers-reduced-motion: reduce) {
    .btn::after,
    .btn::before,
    .form-control::before,
    .form-check-input::after,
    .card .card-inner,
    .progress-bar::before,
    .file-preview,
    .icon-hover,
    .text-hover::after,
    .spinner-border,
    .drag-drop-area,
    .btn-copy::before,
    .form-switch .form-check-input::after,
    .hover-tooltip::before,
    .alert-success,
    .alert-danger,
    .btn-loading::after {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
    
    .btn:hover,
    .form-control:hover,
    .form-check-input:hover,
    .card:hover,
    .drag-drop-area:hover,
    .nav-link:hover,
    .accordion-button:hover {
        transform: none !important;
    }
}

/* Touch device optimizations for enhanced interactions */
@media (hover: none) {
    .btn::after,
    .btn::before,
    .text-hover::after,
    .hover-tooltip::before {
        display: none;
    }
    
    .btn:hover,
    .form-control:hover,
    .form-check-input:hover,
    .card:hover,
    .drag-drop-area:hover,
    .nav-link:hover,
    .accordion-button:hover {
        transform: none !important;
    }
}

/* High contrast mode support for enhanced interactions */
@media (prefers-contrast: high) {
    .btn::after,
    .btn::before,
    .progress-bar::before,
    .btn-copy::before {
        display: none;
    }
    
    .btn:hover,
    .form-control:hover,
    .card:hover {
        border: 2px solid currentColor;
    }
}

/* Performance optimizations for animations */
.will-animate {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Smooth scrolling for better UX */
html {
    scroll-behavior: smooth;
}

/* Enhanced focus management for accessibility */
.skip-link:focus {
    top: 0;
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

/* Enhanced form validation visual feedback */
.form-control:invalid {
    border-color: #dc3545;
    animation: shake 0.5s ease-in-out;
}

.form-control:valid {
    border-color: #28a745;
}

/* Enhanced loading state for entire sections */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Enhanced micro-interaction for accordion */
.accordion-button:not(.collapsed) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.accordion-button.collapsed {
    transition: all 0.3s ease;
}

.accordion-button:not(.collapsed)::after {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

/* Enhanced selection feedback */
::selection {
    background-color: var(--primary-color);
    color: white;
}

::-moz-selection {
    background-color: var(--primary-color);
    color: white;
}

/* Enhanced placeholder animations */
.form-control::placeholder {
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.form-control:focus::placeholder {
    transform: translateY(-10px);
    opacity: 0.7;
    font-size: 0.8em;
}

/* Enhanced counter animations */
.counter {
    font-variant-numeric: tabular-nums;
    transition: all 0.3s ease;
}

.counter.animate {
    animation: count-up 0.5s ease-out;
}

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

/* Enhanced progress states with milestones */
.progress-bar.milestone-25 { background: linear-gradient(to right, #dc3545, #fd7e14); }
.progress-bar.milestone-50 { background: linear-gradient(to right, #fd7e14, #ffc107); }
.progress-bar.milestone-75 { background: linear-gradient(to right, #ffc107, #20c997); }
.progress-bar.milestone-100 { background: linear-gradient(to right, #20c997, #198754); }

.progress-bar.milestone-reached {
    animation: milestone-celebration 0.5s ease-out;
}

@keyframes milestone-celebration {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Mobile-First Responsive Design Enhancements */

/* Base mobile-first styles */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* Ensure proper viewport behavior */
@viewport {
    width: device-width;
    zoom: 1.0;
}

/* Enhanced mobile navigation */
.navbar-toggler {
    border: none;
    padding: 0.5rem;
    background: transparent;
}

.navbar-toggler:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.navbar-collapse {
    transition: max-height 0.3s ease;
}

/* Show navbar toggler on desktop to allow manual collapse/expand */
@media (min-width: 768px) {
    .navbar-toggler {
        display: block;
    }
}

/* Ensure navbar collapse works properly on mobile */
@media (max-width: 767.98px) {
    .navbar-collapse {
        max-height: 0;
        overflow: hidden;
    }
    
    .navbar-collapse.show {
        max-height: 300px; /* Adjust based on your menu height */
    }
    
    .navbar-toggler {
        display: block;
    }
}

/* Enhanced mobile form controls */
.form-control {
    font-size: 16px; /* Prevents iOS zoom on focus */
}

/* Touch-friendly button sizes */
.btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Enhanced mobile card layout */
.card {
    margin-bottom: 20px;
}

/* Improved mobile typography */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
}

/* Enhanced mobile grid system */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col {
    flex: 1 0 0%;
    padding: 0 15px;
}

/* Responsive breakpoints with mobile-first approach */
/* Extra small devices (phones, 320px and up) */
@media (min-width: 320px) {
    .container {
        max-width: 100%;
    }
    
    .jumbotron {
        padding: 1.5rem 1rem;
    }
    
    .btn-xl {
        font-size: 16px;
        padding: 12px 24px;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
    
    .jumbotron {
        padding: 2rem 1.5rem;
    }
    
    .btn-xl {
        font-size: 18px;
        padding: 14px 28px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    .jumbotron {
        padding: 2.5rem 2rem;
    }
    
    .btn-xl {
        font-size: 20px;
        padding: 16px 32px;
    }
    
    /* Allow collapsible navbar on desktop; Bootstrap controls visibility */
    .navbar-collapse {
        /* removed forced display to enable collapse */
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    .jumbotron {
        padding: 3rem 2.5rem;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Enhanced mobile-specific optimizations */
@media (max-width: 767.98px) {
    /* Stack cards vertically on mobile */
    .card-deck .card {
        margin-bottom: 20px;
    }
    
    /* Adjust spacing for mobile */
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    .mt-4 {
        margin-top: 1.5rem !important;
    }
    
    /* Optimize form layout for mobile */
    .form-row {
        margin-right: -8px;
        margin-left: -8px;
    }
    
    .form-row > .col,
    .form-row > [class*="col-"] {
        padding-right: 8px;
        padding-left: 8px;
    }
    
    /* Mobile-optimized drag and drop area */
    .drag-drop-area {
        padding: 20px;
        margin: 0 -15px;
    }
    
    /* Adjust footer for mobile */
    .footer {
        padding: 10px 0;
        font-size: 0.9rem;
    }
    
    /* Mobile-optimized notifications */
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification {
        padding: 12px 16px;
    }
    
    /* Hide unnecessary elements on mobile */
    .d-none-mobile {
        display: none !important;
    }
    
    /* Mobile-optimized file preview */
    .file-preview {
        margin: 0 -15px 15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    /* Mobile-optimized progress bars */
    .progress {
        margin: 15px 0;
    }
}

/* Enhanced tablet-specific optimizations */
@media (min-width: 768px) and (max-width: 1023.98px) {
    .container {
        padding-right: 20px;
        padding-left: 20px;
    }
    
    /* Tablet-optimized card layout */
    .card-deck .card {
        margin-bottom: 30px;
    }
    
    /* Tablet-optimized spacing */
    .mb-4 {
        margin-bottom: 2rem !important;
    }
}

/* Enhanced touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .btn:hover,
    .card:hover,
    .drag-drop-area:hover,
    .nav-link:hover,
    .accordion-button:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    /* Enhance touch targets */
    .btn {
        padding: 12px 20px;
    }
    
    .form-control {
        padding: 14px 16px;
    }
    
    /* Improve touch feedback */
    .btn:active,
    .card:active,
    .nav-link:active {
        transform: scale(0.98) !important;
        transition: transform 0.1s ease;
    }
}

/* Enhanced orientation-specific styles */
@media (orientation: portrait) {
    .main-content {
        padding-top: 20px;
    }
}

@media (orientation: landscape) {
    .main-content {
        padding-top: 10px;
    }
}

/* Enhanced high-DPI screen support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-container img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Enhanced print styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .navbar,
    .footer,
    .dark-mode-toggle,
    .notification-container {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .btn {
        border: 1px solid #000;
        background: white !important;
        color: black !important;
    }
}

/* Enhanced reduced data mode support */
@media (prefers-reduced-data: reduce) {
    .hero-icon,
    .logo-container img,
    .jumbotron::before {
        background-image: none !important;
    }
    
    .animated {
        animation: none !important;
    }
}

/* Enhanced mobile form validation */
@media (max-width: 767.98px) {
    .form-control:invalid,
    .form-control:valid {
        border-width: 2px;
    }
    
    .invalid-feedback,
    .valid-feedback {
        font-size: 0.8rem;
    }
}

/* Enhanced mobile loading states */
@media (max-width: 767.98px) {
    .spinner-border {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    .btn-loading::after {
        width: 16px;
        height: 16px;
    }
}

/* Enhanced mobile accessibility */
@media (max-width: 767.98px) {
    /* Increase tap target size */
    a, button, input, select, textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Improve focus visibility */
    :focus-visible {
        outline: 3px solid var(--primary-light);
        outline-offset: 3px;
    }
    
    /* Enhance readability */
    body {
        line-height: 1.6;
    }
    
    p, li {
        font-size: 1rem;
    }
}

/* Enhanced mobile performance optimizations */
@media (max-width: 767.98px) {
    /* Reduce animations on mobile */
    .animated {
        animation-duration: 0.4s;
    }
    
    /* Optimize images for mobile */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Reduce shadow intensity on mobile */
    .card,
    .btn,
    .drag-drop-area {
        box-shadow: var(--shadow-sm);
    }
}

/* Enhanced mobile navigation improvements */
@media (max-width: 767.98px) {
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
}

/* Enhanced mobile form layout */
@media (max-width: 767.98px) {
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    .form-label {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .form-text {
        font-size: 0.85rem;
    }
}

/* Enhanced mobile button groups */
@media (max-width: 767.98px) {
    .btn-group-vertical {
        width: 100%;
    }
    
    .btn-group-vertical .btn {
        margin-bottom: 0.5rem;
    }
    
    .btn-group .btn {
        flex: 1;
    }
}

/* Enhanced mobile modal support */
@media (max-width: 767.98px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: var(--radius-md);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}

/* Enhanced mobile table support */
@media (max-width: 767.98px) {
    .table-responsive {
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
    }
    
    .table th,
    .table td {
        padding: 0.75rem;
    }
}

/* Enhanced mobile utility classes */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: block !important;
}

@media (max-width: 767.98px) {
    .mobile-only {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }
}

/* Enhanced mobile grid system */
@media (max-width: 767.98px) {
    .row {
        margin-right: -8px;
        margin-left: -8px;
    }
    
    .col,
    [class*="col-"] {
        padding-right: 8px;
        padding-left: 8px;
    }
}

/* Enhanced mobile spacing utilities */
@media (max-width: 767.98px) {
    .m-sm-0 { margin: 0 !important; }
    .m-sm-1 { margin: 0.25rem !important; }
    .m-sm-2 { margin: 0.5rem !important; }
    .m-sm-3 { margin: 1rem !important; }
    .m-sm-4 { margin: 1.5rem !important; }
    .m-sm-5 { margin: 3rem !important; }
    
    .p-sm-0 { padding: 0 !important; }
    .p-sm-1 { padding: 0.25rem !important; }
    .p-sm-2 { padding: 0.5rem !important; }
    .p-sm-3 { padding: 1rem !important; }
    .p-sm-4 { padding: 1.5rem !important; }
    .p-sm-5 { padding: 3rem !important; }
}

/* Enhanced mobile text utilities */
@media (max-width: 767.98px) {
    .text-sm-left { text-align: left !important; }
    .text-sm-center { text-align: center !important; }
    .text-sm-right { text-align: right !important; }
    
    .text-sm-smaller { font-size: 0.9em !important; }
    .text-sm-small { font-size: 0.8em !important; }
}

/* Enhanced mobile visibility utilities */
@media (max-width: 767.98px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-flex { display: flex !important; }
    .d-sm-inline { display: inline !important; }
    .d-sm-inline-block { display: inline-block !important; }
}

/* Enhanced mobile flex utilities */
@media (max-width: 767.98px) {
    .flex-sm-column { flex-direction: column !important; }
    .flex-sm-row { flex-direction: row !important; }
    .flex-sm-wrap { flex-wrap: wrap !important; }
    .flex-sm-nowrap { flex-wrap: nowrap !important; }
}

/* Enhanced mobile order utilities */
@media (max-width: 767.98px) {
    .order-sm-first { order: -1 !important; }
    .order-sm-last { order: 6 !important; }
    .order-sm-0 { order: 0 !important; }
    .order-sm-1 { order: 1 !important; }
    .order-sm-2 { order: 2 !important; }
    .order-sm-3 { order: 3 !important; }
    .order-sm-4 { order: 4 !important; }
    .order-sm-5 { order: 5 !important; }
}

/* Enhanced mobile alignment utilities */
@media (max-width: 767.98px) {
    .align-items-sm-start { align-items: flex-start !important; }
    .align-items-sm-end { align-items: flex-end !important; }
    .align-items-sm-center { align-items: center !important; }
    .align-items-sm-baseline { align-items: baseline !important; }
    .align-items-sm-stretch { align-items: stretch !important; }
    
    .justify-content-sm-start { justify-content: flex-start !important; }
    .justify-content-sm-end { justify-content: flex-end !important; }
    .justify-content-sm-center { justify-content: center !important; }
    .justify-content-sm-between { justify-content: space-between !important; }
    .justify-content-sm-around { justify-content: space-around !important; }
}

/* Enhanced mobile safe area insets for modern devices */
@supports (padding: max(0px)) {
    .safe-area-inset-top {
        padding-top: max(0.75rem, env(safe-area-inset-top));
    }
    
    .safe-area-inset-bottom {
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    }
    
    .safe-area-inset-left {
        padding-left: max(0.75rem, env(safe-area-inset-left));
    }
    
    .safe-area-inset-right {
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }
}

/* Enhanced mobile performance with will-change optimizations */
@media (max-width: 767.98px) {
    .will-change-mobile {
        will-change: auto;
    }
}

/* Enhanced mobile reduced motion support */
@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animated {
        animation: none !important;
    }
}

/* ================================
   Accessibility & Theme Coherence Fixes
   Ensures readable text/background pairings across light/dark modes
   ================================ */

/* Unify body background with theme variable (avoid dark gradient with dark text) */
body {
    background: var(--bg-primary) !important;
}

/* Divider background follows current theme to keep text readable */
.divider-text span {
    background: var(--bg-primary) !important;
}

/* Accordion body should use themed card background and text */
.advanced-options .accordion-body {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

/* Muted text uses theme secondary color */
.text-muted {
    color: var(--text-secondary) !important;
}

/* Improve badge contrast */
.badge.bg-primary {
    color: #ffffff !important;
}

/* Ensure status text is readable on both themes */
#statusMessage {
    color: var(--text-primary) !important;
}

/* Selected file and transfer stats use theme-aware surfaces and text */
#selectedFileName {
    background-color: var(--bg-secondary) !important;
}
#uploadedBytes, #downloadedBytes, #downloadSpeed {
    color: var(--text-primary) !important;
    background-color: var(--bg-secondary) !important;
}

/* Navbar hamburger icon readable on both light and dark navbars */
.navbar.navbar-light .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(0,0,0,0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
}

.navbar:not(.navbar-light) .navbar-toggler-icon,
.dark-mode .navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(255,255,255,0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
}

/* Primary text variant adapts in dark mode for contrast */
.dark-mode .text-primary {
    color: var(--primary-light) !important;
}

/* Outline buttons in inputs maintain contrast in dark mode */
.dark-mode .input-group .btn-outline-secondary {
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Footer muted text remains readable on dark footer */
.footer .text-muted {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Navbar link hover maintains contrast */
.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.12) !important;
}

/* Advanced: ensure generic surfaces/text use theme variables where missed */
.file-preview,
.text-preview pre,
.generic-preview .file-info {
    background: var(--card-bg);
    color: var(--text-primary);
}

/* Keep accordion and cards text consistently themed */
.card,
.card-body,
.accordion-button,
.accordion-body {
    color: var(--text-primary);
}

/* Inputs and helper texts align with theme */
.form-text {
    color: var(--text-secondary);
}

/* Dark mode readability fix for bg-light surfaces (e.g., index info card) */
.dark-mode .bg-light {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}
.dark-mode .bg-light .card-text,
.dark-mode .bg-light p,
.dark-mode .bg-light span {
    color: var(--text-primary) !important;
}

/* Theme-aware Bootstrap accordion (global) */
.accordion {
    /* Map Bootstrap accordion tokens to site theme variables */
    --bs-accordion-bg: var(--card-bg);
    --bs-accordion-color: var(--text-primary);
    --bs-accordion-border-color: var(--border-color);
    --bs-accordion-btn-color: var(--text-primary);
    --bs-accordion-btn-bg: var(--card-bg);
    --bs-accordion-active-bg: var(--bg-secondary);
    --bs-accordion-active-color: var(--text-primary);
    --bs-accordion-btn-focus-border-color: var(--primary-color);
    --bs-accordion-btn-focus-box-shadow: 0 0 0 0.25rem rgba(58, 123, 213, 0.25);
    /* Ensure chevron uses currentColor so it adapts to theme */
    --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='currentColor' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    --bs-accordion-btn-active-icon: var(--bs-accordion-btn-icon);
}

.accordion-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

.accordion-button {
    background-color: var(--card-bg);
    color: var(--text-primary);
}

.accordion-button:not(.collapsed) {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: none;
}

.accordion-button:focus {
    /* keep accessible focus ring with theme color */
    box-shadow: 0 0 0 0.25rem rgba(58, 123, 213, 0.25);
}

.accordion-body {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border-top: 1px solid var(--border-color);
}

/* Staggered Animations per elementi multipli */
.stagger-animation {
    animation: staggerFadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
}

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

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

/* Parallax scrolling effect per il background */
.parallax-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    background: linear-gradient(135deg,
        var(--primary-50) 0%,
        var(--secondary-50) 25%,
        var(--primary-100) 50%,
        var(--secondary-100) 75%,
        var(--primary-50) 100%);
    z-index: -10;
    will-change: transform;
    animation: parallaxFloat 20s infinite linear;
}

@keyframes parallaxFloat {
    0% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(0.5deg); }
    50% { transform: translateY(-10px) rotate(-0.3deg); }
    75% { transform: translateY(-30px) rotate(0.8deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* CSS Particle Effects */
.particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -5;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    animation: particleFloat 15s infinite linear;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; }
.particle:nth-child(4) { left: 40%; animation-delay: 6s; }
.particle:nth-child(5) { left: 50%; animation-delay: 8s; }
.particle:nth-child(6) { left: 60%; animation-delay: 10s; }
.particle:nth-child(7) { left: 70%; animation-delay: 12s; }
.particle:nth-child(8) { left: 80%; animation-delay: 14s; }
.particle:nth-child(9) { left: 90%; animation-delay: 16s; }

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(90vh) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateY(10vh) scale(1);
    }
    100% {
        transform: translateY(-10vh) scale(0);
        opacity: 0;
    }
}

/* Morphing button effects */
.btn-morph {
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-morph::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent);
    transition: left 0.5s ease;
}

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

.btn-morph:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg) translateZ(10px);
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.2),
        0 0 50px rgba(59, 130, 246, 0.3);
}

/* Liquid loading animation */
.liquid-loader {
    position: relative;
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
}

.liquid-loader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        var(--primary-500) 0%,
        var(--secondary-500) 50%,
        var(--primary-500) 100%);
    border-radius: 10px;
    transform: translateX(-100%);
    animation: liquidWave 2s infinite ease-in-out;
}

@keyframes liquidWave {
    0% {
        transform: translateX(-100%) scaleX(0.5);
    }
    50% {
        transform: translateX(0%) scaleX(1.2);
    }
    100% {
        transform: translateX(100%) scaleX(0.5);
    }
}

/* Breathing animation per elementi importanti */
.breathe {
    animation: breathe 4s infinite ease-in-out;
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        box-shadow: var(--shadow-sm);
    }
    50% {
        transform: scale(1.02);
        box-shadow: var(--shadow-lg);
    }
}

/* Glitch effect per errori */
.glitch-effect {
    position: relative;
    animation: glitch 0.3s ease-in-out infinite;
}

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

.glitch-effect::before {
    color: #ff0000;
    animation: glitchTop 0.3s ease-in-out infinite;
    clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
}

.glitch-effect::after {
    color: #00ffff;
    animation: glitchBottom 0.3s ease-in-out infinite;
    clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitchTop {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, -2px); }
    40% { transform: translate(-2px, 2px); }
    60% { transform: translate(2px, -2px); }
    80% { transform: translate(2px, 2px); }
}

@keyframes glitchBottom {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-2px, 2px); }
    80% { transform: translate(-2px, -2px); }
}

/* Glass morphism effects */
.glass-morphism {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 8px 32px 0 rgba(31, 38, 135, 0.37),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.dark-mode .glass-morphism {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px 0 rgba(0, 0, 0, 0.37),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Neon glow effects per elementi critici */
.neon-glow {
    position: relative;
    text-shadow:
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 15px currentColor,
        0 0 20px var(--primary-color);
    animation: neonFlicker 2s infinite alternate;
}

@keyframes neonFlicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow:
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 15px currentColor,
            0 0 20px var(--primary-color);
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* Magnetic attraction effect */
.magnetic {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

.magnetic:hover {
    transform: scale(1.05) translateZ(0);
}

/* Advanced loading skeleton */
.skeleton {
    background: linear-gradient(90deg,
        var(--gray-200) 25%,
        var(--gray-100) 50%,
        var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.dark-mode .skeleton {
    background: linear-gradient(90deg,
        var(--gray-700) 25%,
        var(--gray-600) 50%,
        var(--gray-700) 75%);
    background-size: 200% 100%;
}

/* Typewriter effect */
.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--primary-color);
    white-space: nowrap;
    animation:
        typing 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary-color); }
}

/* Page transition effects */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
        var(--primary-color),
        var(--secondary-color));
    z-index: 10000;
    transform: translateX(-100%);
    transition: transform 0.6s cubic-bezier(0.76, 0, 0.24, 1);
}

.page-transition.active {
    transform: translateX(0);
}

.page-transition.exit {
    transform: translateX(100%);
}

/* Advanced hover states con physics */
.physics-hover {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center;
}

.physics-hover:hover {
    transform:
        perspective(1000px)
        rotateX(10deg)
        rotateY(10deg)
        translateZ(20px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.2),
        0 0 60px rgba(59, 130, 246, 0.4);
}

/* Elastic scroll effects */
.elastic-scroll {
    scroll-behavior: smooth;
    animation: elasticBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes elasticBounce {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Advanced focus effects con glow */
.advanced-focus:focus {
    outline: none;
    box-shadow:
        0 0 0 4px rgba(59, 130, 246, 0.2),
        0 0 20px rgba(59, 130, 246, 0.4),
        0 8px 16px rgba(0, 0, 0, 0.1);
    animation: focusGlow 0.6s ease-out;
}

@keyframes focusGlow {
    0% {
        box-shadow:
            0 0 0 0 rgba(59, 130, 246, 0.4),
            0 0 0 rgba(59, 130, 246, 0),
            0 0 0 rgba(0, 0, 0, 0);
    }
    100% {
        box-shadow:
            0 0 0 4px rgba(59, 130, 246, 0.2),
            0 0 20px rgba(59, 130, 246, 0.4),
            0 8px 16px rgba(0, 0, 0, 0.1);
    }
}

/* Success/Error state animations con spring physics */
.success-spring {
    animation: successBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.error-spring {
    animation: errorShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes successBounce {
    0% {
        transform: scale(0.3) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) rotate(2deg);
    }
    70% {
        transform: scale(0.9) rotate(-1deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

/* Floating action button con magnetic effect */
.fab-magnetic {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.2),
        0 0 30px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
}

.fab-magnetic:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.3),
        0 0 50px rgba(59, 130, 246, 0.6);
}

.fab-magnetic:active {
    transform: scale(0.95) translateY(-2px);
}

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

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.ripple-effect:active::after {
    width: 300px;
    height: 300px;
}

/* Polish finale: Enhanced visual hierarchy */
.visual-hierarchy-1 {
    font-weight: 800;
    font-size: var(--text-4xl);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.visual-hierarchy-2 {
    font-weight: 700;
    font-size: var(--text-3xl);
    color: var(--primary-600);
}

.visual-hierarchy-3 {
    font-weight: 600;
    font-size: var(--text-2xl);
    color: var(--gray-700);
}

/* Enhanced micro-interactions finale */
.micro-bounce:hover {
    animation: microBounce 0.4s ease;
}

@keyframes microBounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    80% {
        transform: translateY(-4px);
    }
}

/* Advanced loading states finale */
.loading-wave {
    display: inline-flex;
    gap: 4px;
}

.loading-wave span {
    width: 8px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 4px;
    animation: loadingWave 1.2s infinite ease-in-out;
}

.loading-wave span:nth-child(1) { animation-delay: -1.1s; }
.loading-wave span:nth-child(2) { animation-delay: -1.0s; }
.loading-wave span:nth-child(3) { animation-delay: -0.9s; }

@keyframes loadingWave {
    0%, 40%, 100% {
        transform: scaleY(0.4);
        opacity: 0.5;
    }
    20% {
        transform: scaleY(1.0);
        opacity: 1;
    }
}

/* Performance optimizations finale */
.gpu-accelerated {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
    perspective: 1000px;
}

/* Dark mode polish finale */
.dark-mode .glass-morphism {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-mode .neon-glow {
    text-shadow:
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 15px currentColor,
        0 0 20px var(--primary-light);
}

/* Reduced motion support finale */
@media (prefers-reduced-motion: reduce) {
    .stagger-animation,
    .parallax-bg,
    .particle,
    .btn-morph,
    .liquid-loader::before,
    .breathe,
    .glitch-effect,
    .neon-glow,
    .typewriter,
    .physics-hover,
    .elastic-scroll,
    .success-spring,
    .error-spring,
    .fab-magnetic,
    .ripple-effect,
    .micro-bounce,
    .loading-wave span {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

/* Touch device optimizations finale */
@media (hover: none) {
    .btn-morph:hover,
    .physics-hover:hover,
    .fab-magnetic:hover,
    .micro-bounce:hover {
        transform: none !important;
    }
}

/* High contrast mode finale */
@media (prefers-contrast: high) {
    .glass-morphism,
    .neon-glow,
    .particle {
        display: none;
    }
    
    .visual-hierarchy-1,
    .visual-hierarchy-2,
    .visual-hierarchy-3 {
        background: none;
        -webkit-text-fill-color: currentColor;
        color: var(--text-primary);
    }
}

/* Archive Exploration Table Styling - Theme Aware */
.archive-explorer {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-top: var(--space-4);
    overflow: hidden;
}

.archive-explorer h5 {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    padding: var(--space-4) var(--space-6);
    margin: 0;
    font-weight: 600;
    font-size: var(--text-lg);
}

.archive-file-list {
    max-height: 400px;
    overflow-y: auto;
    background: var(--card-bg);
}

.archive-file-item {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-3) var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    color: var(--text-primary);
}

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

.archive-file-item:hover {
    background: var(--bg-secondary);
    transform: translateX(4px);
}

.archive-file-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
    padding-right: var(--space-4);
}

.archive-file-download {
    flex-shrink: 0;
    white-space: nowrap;
}

.archive-file-download .btn {
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-3);
    min-height: auto;
}

/* Dark mode specific adjustments for archive explorer */
@media (prefers-color-scheme: dark) {
    .archive-explorer {
        background: var(--card-bg);
        border-color: var(--border-color);
    }
    
    .archive-file-item {
        background: var(--card-bg);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    
    .archive-file-item:hover {
        background: var(--bg-secondary);
    }
    
    .archive-file-name {
        color: var(--text-primary);
    }
}

.dark-mode .archive-explorer {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-mode .archive-file-item {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.dark-mode .archive-file-item:hover {
    background: var(--bg-secondary);
}

.dark-mode .archive-file-name {
    color: var(--text-primary);
}

/* Enhanced scrollbar for archive file list */
.archive-file-list::-webkit-scrollbar {
    width: 6px;
}

.archive-file-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.archive-file-list::-webkit-scrollbar-thumb {
    background: var(--primary-500);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.archive-file-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-600);
}

/* Responsive archive explorer */
@media (max-width: 768px) {
    .archive-explorer h5 {
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-base);
    }
    
    .archive-file-item {
        padding: var(--space-2) var(--space-3);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
    
    .archive-file-name {
        padding-right: 0;
    }
    
    .archive-file-download {
        align-self: flex-end;
    }
}
