@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Advanced Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(2deg); }
    66% { transform: translateY(-10px) rotate(-2deg); }
}

@keyframes gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

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

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

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 20px 40px -12px rgba(16, 185, 129, 0.4),
                    0 10px 20px -8px rgba(16, 185, 129, 0.3),
                    0 0 0 0 rgba(16, 185, 129, 0.5);
    }
    50% {
        box-shadow: 0 25px 50px -12px rgba(16, 185, 129, 0.6),
                    0 15px 30px -8px rgba(16, 185, 129, 0.5),
                    0 0 40px 2px rgba(16, 185, 129, 0.4);
    }
}

@keyframes goldenBreath {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1),
                    0 2px 4px rgba(0, 0, 0, 0.06),
                    0 0 0 1px rgba(139, 92, 246, 0.1),
                    0 0 12px rgba(225, 0, 127, 0.15),
                    0 0 20px rgba(225, 0, 127, 0.1);
    }
    50% {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12),
                    0 3px 6px rgba(0, 0, 0, 0.08),
                    0 0 0 1px rgba(139, 92, 246, 0.15),
                    0 0 18px rgba(225, 0, 127, 0.25),
                    0 0 30px rgba(225, 0, 127, 0.15),
                    0 0 40px rgba(225, 0, 127, 0.08);
    }
}

@keyframes goldenBreathDark {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
                    0 2px 4px rgba(0, 0, 0, 0.3),
                    0 0 0 1px rgba(167, 139, 250, 0.2),
                    0 0 15px rgba(225, 0, 127, 0.2),
                    0 0 25px rgba(225, 0, 127, 0.12);
    }
    50% {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5),
                    0 3px 6px rgba(0, 0, 0, 0.4),
                    0 0 0 1px rgba(167, 139, 250, 0.25),
                    0 0 20px rgba(225, 0, 127, 0.3),
                    0 0 35px rgba(225, 0, 127, 0.2),
                    0 0 50px rgba(225, 0, 127, 0.12);
    }
}

/* Glass Morphism */
.glass {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(203, 213, 225, 0.8);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08),
                0 1px 3px rgba(0, 0, 0, 0.04);
}

.dark .glass {
    background: rgba(17, 24, 39, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
}

.dark .glass-strong {
    background: rgba(17, 24, 39, 0.95);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #764ba2 0%, #667eea 100%);
    background-clip: padding-box;
}

.dark ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

/* Card Effects */
.card-hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.25),
                0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: rgba(139, 92, 246, 0.3);
}

.dark .card-hover:hover {
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.4),
                0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Pulsing Glow Effect for Primary Button */
.animate-pulse-glow {
    animation: pulseGlow 3s ease-in-out infinite;
}

/* Disable animation when button is disabled */
.animate-pulse-glow:disabled {
    animation: none;
    box-shadow: none;
}

/* Tab Container - Segmented Control Style */
.tab-container {
    background: rgba(243, 244, 246, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.dark .tab-container {
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Tab Buttons */
.tab-button {
    background: transparent;
    color: rgb(107, 114, 128);
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.dark .tab-button {
    color: rgb(156, 163, 175);
}

.tab-button:hover:not(.active) {
    color: rgb(75, 85, 99);
    transform: scale(1.02);
}

.dark .tab-button:hover:not(.active) {
    color: rgb(209, 213, 219);
}

.tab-button.active {
    background: white;
    color: rgb(139, 92, 246);
    animation: goldenBreath 3s ease-in-out infinite;
    transform: scale(1);
}

.dark .tab-button.active {
    background: rgba(55, 65, 81, 0.95);
    color: rgb(167, 139, 250);
    animation: goldenBreathDark 3s ease-in-out infinite;
}

.tab-button.active:hover {
    transform: scale(1.02);
    animation-play-state: paused;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12),
                0 3px 6px rgba(0, 0, 0, 0.08),
                0 0 0 1px rgba(139, 92, 246, 0.15),
                0 0 20px rgba(225, 0, 127, 0.3),
                0 0 35px rgba(225, 0, 127, 0.2);
}

.dark .tab-button.active:hover {
    animation-play-state: paused;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5),
                0 3px 6px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(167, 139, 250, 0.25),
                0 0 22px rgba(225, 0, 127, 0.35),
                0 0 40px rgba(225, 0, 127, 0.25);
}

.file-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideUp 0.3s ease-out;
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.dark .file-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg,
        rgba(0, 0, 0, 0.06) 25%,
        rgba(0, 0, 0, 0.15) 50%,
        rgba(0, 0, 0, 0.06) 75%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

.dark .skeleton {
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.06) 25%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.06) 75%
    );
    background-size: 1000px 100%;
}

/* Drop Zone */
.drop-zone {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px dashed #cbd5e1;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.dark .drop-zone {
    border-color: #475569;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.4) 0%, rgba(51, 65, 85, 0.4) 100%);
}

.drop-zone:hover {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.15);
    transform: translateY(-2px);
}

.dark .drop-zone:hover {
    border-color: #a78bfa;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(167, 139, 250, 0.1) 100%);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.25);
}

.drop-zone.active {
    border-color: #8b5cf6;
    border-width: 4px;
    border-style: solid;
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    transform: scale(1.02);
    box-shadow: 0 12px 48px rgba(139, 92, 246, 0.3);
}

.dark .drop-zone.active {
    border-color: #a78bfa;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25) 0%, rgba(167, 139, 250, 0.2) 100%);
    box-shadow: 0 12px 48px rgba(139, 92, 246, 0.4);
}

/* Progress Bar */
.progress-glow {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

/* Button Enhancements */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

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

/* Toast Animations */
@keyframes toast-in {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toast-out {
    from { transform: translateX(0) scale(1); opacity: 1; }
    to { transform: translateX(400px) scale(0.8); opacity: 0; }
}

.toast-enter {
    animation: toast-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-exit {
    animation: toast-out 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal Backdrop */
.modal-backdrop {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Password Strength */
.strength-weak { background: #ef4444; }
.strength-fair { background: #f59e0b; }
.strength-good { background: #10b981; }
.strength-strong { background: #059669; }

/* View Toggle */
.view-toggle {
    position: relative;
}

.view-btn.active {
    background: rgba(102, 126, 234, 0.1);
}

/* Accessibility */
.focus-visible:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #667eea;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Mobile Bottom Sheet */
@media (max-width: 640px) {
    .mobile-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 80vh;
        border-radius: 1.5rem 1.5rem 0 0;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
    }

    .mobile-sheet.active {
        transform: translateY(0);
    }

    /* Make touch targets larger on mobile */
    button, a, input[type="checkbox"] {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Grid Pattern Background */
.grid-pattern {
    background-image:
        linear-gradient(rgba(102, 126, 234, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 126, 234, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

.dark .grid-pattern {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
}

/* Checkbox Styling */
.checkbox-file {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #9ca3af;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.checkbox-file:checked {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

.checkbox-file:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
}
