/* Optimized styles.css - Performance First */

/* FAQ Hidden State */
.faq-hidden {
    display: none !important;
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
}

/* Loader */
.loader {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 2px solid #fff;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

/* Core Animations */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-spin-reverse {
    animation: spin 2s linear infinite reverse;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.5);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(203, 213, 225, 0.8);
    border-radius: 20px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(148, 163, 184, 0.8);
}

/* Gradient Animation */
@keyframes gradient {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.animate-gradient {
    animation: gradient 8s ease infinite;
}

/* Radial Gradient Background */
.bg-radial-gradient {
    background: radial-gradient(circle at center, var(--tw-gradient-stops));
}

/* Enhanced Background Effects */
body {
    background-attachment: fixed;
}

/* FAQ Accordion Styles */
.faq-item.active .faq-answer {
    max-height: 1000px !important;
}

.faq-question:hover {
    background-color: rgba(99, 102, 241, 0.02);
}

.faq-item.active {
    border-color: rgba(99, 102, 241, 0.3);
}

.faq-item.active .faq-question {
    background-color: rgba(99, 102, 241, 0.03);
}

/* Bento Grid Styles */
.auto-rows-fr {
    grid-auto-rows: minmax(200px, auto);
}

@media (min-width: 768px) {
    .auto-rows-fr {
        grid-auto-rows: minmax(250px, auto);
    }
}

@media (min-width: 1024px) {
    .auto-rows-fr {
        grid-auto-rows: minmax(280px, auto);
    }
}

/* Enhanced Navbar Styles */
nav.scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
}

/* Mobile Menu Animation */
#mobile-menu {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Nav Link Active State */
.nav-link.active {
    color: #4f46e5;
    background-color: rgba(99, 102, 241, 0.1);
}

.nav-link.active span {
    width: 100%;
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Mobile Menu Link Hover */
.mobile-nav-link:hover {
    transform: translateX(4px);
}

/* Scanning Animations */
@keyframes scan-line {
    0% {
        top: 0%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

.animate-scan-line {
    animation: scan-line 3s ease-in-out infinite;
}

@keyframes scan-vertical {
    0% {
        left: 0%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

.animate-scan-vertical {
    animation: scan-vertical 2.5s ease-in-out infinite;
}

/* Result Page Styles */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.gradient-text {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    background-image: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
}

.stat-card {
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Scanning Overlay Styles */
#scanning-overlay {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 9999 !important;
    visibility: visible !important;
    opacity: 1 !important;
    background-color: rgba(15, 23, 42, 0.95) !important;
    pointer-events: auto !important;
}

#scanning-overlay.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Preview Container Styles */
#preview-container .relative.rounded-2xl {
    position: relative !important;
    min-height: 400px !important;
    overflow: hidden !important;
}

#preview-container>div:first-child {
    min-height: 400px;
    position: relative;
}

/* Test Preloader Styles */
#test-preloader {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 50 !important;
    background-color: rgba(15, 23, 42, 0.95) !important;
}

#test-preloader.hidden {
    display: none !important;
}

/* Fast Scan Animation for Barcode Effect */
@keyframes scan-fast {
    0% {
        top: 0%;
        opacity: 0.8;
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
    }

    50% {
        top: 100%;
        opacity: 1;
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.9);
    }

    100% {
        top: 0%;
        opacity: 0.8;
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
    }
}

.animate-scan-fast {
    animation: scan-fast 1.5s ease-in-out infinite;
}