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

::-webkit-scrollbar-track {
    background: #060609;
}

::-webkit-scrollbar-thumb {
    background: #1e1e2e;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #f43f5e;
}

/* Body scroll */
html {
    scroll-behavior: smooth;
}

body {
    background: #050508;
}

/* Subtle noise texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Nav links */
.nav-link {
    color: #717180;
    position: relative;
    letter-spacing: 0.02em;
}

.nav-link:hover {
    color: #fff;
    text-shadow: 0 0 20px rgba(244, 63, 94, 0.3);
}

.nav-link.active {
    color: #fb7185;
    text-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
    background: linear-gradient(90deg, #f43f5e, #8b5cf6);
    border-radius: 1px;
    box-shadow: 0 0 8px rgba(244, 63, 94, 0.5);
}

/* Button states for selectors */
.duration-btn.active,
.resolution-btn.active,
.count-btn.active,
.camera-btn.active,
.audio-btn.active,
.model-btn.active,
.style-btn.active,
.aspect-btn.active,
.lighting-btn.active,
.fps-btn.active {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.5);
    color: #fb7185;
    font-weight: 600;
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.15);
}

.duration-btn:hover,
.resolution-btn:hover,
.count-btn:hover,
.camera-btn:hover,
.audio-btn:hover,
.model-btn:hover,
.style-btn:hover,
.aspect-btn:hover,
.lighting-btn:hover,
.fps-btn:hover {
    border-color: rgba(244, 63, 94, 0.3);
    color: #fda4af;
}

.model-btn.active .text-dark-500 {
    color: #fb7185;
}

/* Prompt tags */
.prompt-tag {
    transition: all 0.2s ease;
}

.prompt-tag:hover {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.4);
    color: #fb7185;
}

/* Toggle checkbox */
.toggle-checkbox {
    -webkit-appearance: none;
    appearance: none;
    width: 40px;
    height: 22px;
    background: #1c1c2b;
    border: 1px solid #2a2a3a;
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toggle-checkbox::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4e4e5e;
    top: 2px;
    left: 2px;
    transition: all 0.2s ease;
}

.toggle-checkbox:checked {
    background: rgba(244, 63, 94, 0.2);
    border-color: rgba(244, 63, 94, 0.5);
}

.toggle-checkbox:checked::before {
    background: #f43f5e;
    transform: translateX(18px);
    box-shadow: 0 0 8px rgba(244, 63, 94, 0.5);
}

/* Custom range slider */
.custom-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #0e0e18;
    outline: none;
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f43f5e, #8b5cf6);
    cursor: pointer;
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.5), 0 0 4px rgba(244, 63, 94, 0.3);
    transition: transform 0.15s ease;
}

.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.6), 0 0 6px rgba(244, 63, 94, 0.4);
}

.custom-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f43f5e, #8b5cf6);
    cursor: pointer;
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.5);
    border: none;
}

/* Upload area drag hover */
#uploadArea.dragover {
    border-color: rgba(244, 63, 94, 0.6);
    background: rgba(244, 63, 94, 0.05);
    box-shadow: 0 0 30px rgba(244, 63, 94, 0.1);
}

/* Video result card */
.video-result-card {
    background: #0c0c16;
    border: 1px solid #1e1e2e;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.video-result-card:hover {
    border-color: rgba(244, 63, 94, 0.4);
    box-shadow: 0 0 30px rgba(244, 63, 94, 0.15), 0 4px 20px rgba(0,0,0,0.4);
    transform: translateY(-2px);
}

/* Shimmer loading */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.shimmer-bg {
    background: linear-gradient(90deg, #0c0c16 25%, #1e1e2e 50%, #0c0c16 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Toast animation */
.toast-enter {
    animation: toastIn 0.3s ease-out forwards;
}

.toast-exit {
    animation: toastOut 0.3s ease-in forwards;
}

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

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

/* Pulse dot animation */
@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.pulse-dot {
    animation: pulseDot 1.5s ease-in-out infinite;
}

/* Header blur on scroll */
.header-scrolled {
    background: rgba(5, 5, 8, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(244, 63, 94, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* Prompt card hover */
.prompt-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(30, 30, 46, 0.8);
    background: rgba(8, 8, 14, 0.6);
}

.prompt-card:hover {
    transform: translateY(-3px);
    border-color: rgba(244, 63, 94, 0.4);
    box-shadow: 0 8px 30px rgba(244, 63, 94, 0.1), 0 0 0 1px rgba(244, 63, 94, 0.2);
}

/* Video gallery card */
.gallery-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(30, 30, 46, 0.5);
}

.gallery-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 30px rgba(244, 63, 94, 0.15);
}

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

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(5, 5, 8, 0.9) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 12px;
}

/* Generate button loading */
.generate-loading {
    background: linear-gradient(90deg, #9f1239, #6d28d9, #9f1239) !important;
    background-size: 200% 100% !important;
    animation: shimmer 2s linear infinite !important;
    pointer-events: none;
}

/* Playing indicator */
@keyframes eqBar {
    0%, 100% { height: 4px; }
    50% { height: 16px; }
}

.eq-bar {
    width: 3px;
    background: #f43f5e;
    border-radius: 2px;
    animation: eqBar 0.8s ease-in-out infinite;
}

.eq-bar:nth-child(2) { animation-delay: 0.1s; }
.eq-bar:nth-child(3) { animation-delay: 0.2s; }
.eq-bar:nth-child(4) { animation-delay: 0.3s; }
.eq-bar:nth-child(5) { animation-delay: 0.4s; }

/* Generate button glow */
#generateBtn {
    position: relative;
    overflow: hidden;
}

#generateBtn::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, #f43f5e, #8b5cf6, #f43f5e, #8b5cf6);
    background-size: 300% 300%;
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: gradientShift 3s ease infinite;
    filter: blur(8px);
}

#generateBtn:hover::before {
    opacity: 0.6;
}

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

/* Selection styling */
::selection {
    background: rgba(244, 63, 94, 0.3);
    color: #fff;
}

/* Focus styling */
textarea:focus, input:focus {
    outline: none;
    box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.3), 0 0 20px rgba(244, 63, 94, 0.1);
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .custom-slider::-webkit-slider-thumb {
        width: 22px;
        height: 22px;
    }

    .toggle-checkbox {
        width: 36px;
        height: 20px;
    }

    .toggle-checkbox::before {
        width: 14px;
        height: 14px;
    }

    .toggle-checkbox:checked::before {
        transform: translateX(16px);
    }
}