/* ===== CyanBuild: Custom Styles ===== */
/* Layered on top of Tailwind CSS CDN */

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

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}

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

/* ---- Selection ---- */
::selection {
    background: rgba(6, 182, 212, 0.3);
    color: #fff;
}

/* ---- Smooth Scroll ---- */
html {
    scroll-behavior: smooth;
}

/* ---- Glass Card ---- */
.glass-card {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(51, 65, 85, 0.5);
}

.glass-card-light {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(51, 65, 85, 0.3);
}

/* ---- Animated Gradient Text ---- */
.gradient-text-animated {
    background: linear-gradient(135deg,
            #22d3ee 0%,
            #06b6d4 25%,
            #67e8f9 50%,
            #06b6d4 75%,
            #22d3ee 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

/* ---- Drop Zone Hover Glow ---- */
.drop-zone-glow {
    position: relative;
}

.drop-zone-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 1rem;
    background: linear-gradient(135deg, #06b6d4, transparent, #06b6d4);
    opacity: 0;
    transition: opacity 0.5s;
    z-index: -1;
}

.drop-zone-glow:hover::before {
    opacity: 0.2;
}

/* ---- Table Row Hover ---- */
.results-table tbody tr {
    transition: background-color 0.15s ease;
}

.results-table tbody tr:hover {
    background-color: rgba(30, 41, 59, 0.5);
}

/* ---- Pulse Dot ---- */
@keyframes pulse-dot {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
}

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

/* ---- Loading Skeleton ---- */
@keyframes skeleton {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

/* ---- Slide Up Animation ---- */
.animate-slide-up {
    animation: slideUp 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.magnetic-content {
    transform: none !important;
}

/* Hardware Accel & Reduce Layout Thrashing on Marquee */
.animate-marquee {
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000;
    /* prevent repaints during scroll */
    contain: paint;
}

/* Prevent SVG/Background decorations from registering touch events */
.bg-\[url\],
svg {
    pointer-events: none !important;
}

/* ---- Button Ripple ---- */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-ripple:hover::after {
    opacity: 1;
}

.glass-input-glow {
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.1);
}

.glass-input-glow:focus-within {
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.3);
}



/* ---- Confidence Badges ---- */
.confidence-high {
    background-color: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.confidence-medium {
    background-color: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.confidence-low {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ---- Mobile Responsive ---- */
@media (max-width: 640px) {
    .results-table {
        font-size: 0.75rem;
    }

    .results-table th,
    .results-table td {
        padding: 0.5rem 0.375rem;
    }
}

/* ---- Premium UI Enhancements ---- */

/* Mouse-tracking Glow Cards */
.mouse-glow-card {
    position: relative;
    /* overflow: hidden; Removed to allow absolute badges to pop out */
}

.mouse-glow-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(600px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
            rgba(255, 255, 255, 0.05),
            transparent 40%);
    z-index: 0;
    transition: opacity 0.5s ease;
    border-radius: inherit;
    opacity: 0;
}

.mouse-glow-card:hover::before {
    opacity: 1;
}

/* Premium Card Borders Glow */
.mouse-glow-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    z-index: -1;
    background: radial-gradient(400px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
            rgba(255, 255, 255, 0.4),
            transparent 40%);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.mouse-glow-card:hover::after {
    opacity: 1;
}

.mouse-glow-card>* {
    z-index: 1;
    position: relative;
}

.mouse-glow-card.amber-glow::after {
    background: radial-gradient(400px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
            rgba(245, 158, 11, 0.6),
            transparent 40%);
}

.mouse-glow-card.cyan-glow::after {
    background: radial-gradient(400px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
            rgba(6, 182, 212, 0.6),
            transparent 40%);
}

.mouse-glow-card.blue-glow::after {
    background: radial-gradient(400px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
            rgba(59, 130, 246, 0.6),
            transparent 40%);
}

.mouse-glow-card.orange-glow::after {
    background: radial-gradient(400px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
            rgba(249, 115, 22, 0.6),
            transparent 40%);
}

.mouse-glow-card.green-glow::after {
    background: radial-gradient(400px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
            rgba(34, 197, 94, 0.6),
            transparent 40%);
}


/* Magnetic Button */
.magnetic-btn {
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s ease, filter 0.2s ease;
    will-change: transform;
}

.magnetic-content {
    display: inline-flex;
}

/* =========================================================================
   MOBILE PERFORMANCE OPTIMIZATION (LAG FIX) - ITERATION 6 & 7
   =========================================================================
   Disables extremely expensive CSS properties (backdrop-blur, complex box-shadows,
   and JS-driven radial gradients) on mobile devices to ensure a smooth 60fps 
   scrolling experience, while maintaining the overall layout structural integrity.
*/
@media (max-width: 768px) {

    /* Strip glassmorphism backdrop blurs */
    .glass-card,
    .glass-card-light,
    .backdrop-blur-xl,
    .backdrop-blur-2xl,
    .backdrop-blur-3xl,
    .backdrop-blur-sm,
    .backdrop-blur-md {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background-color: rgba(15, 23, 42, 0.95) !important;
        /* Solid fallback */
    }

    /* Disable dynamic JS mouse-glow effects */
    .mouse-glow-card::before,
    .mouse-glow-card::after {
        display: none !important;
        opacity: 0 !important;
    }

    .mouse-glow-card {
        border-color: rgba(255, 255, 255, 0.1) !important;
        box-shadow: none !important;
    }

    /* Simplify magnetic button animations and shadows */
    .magnetic-btn {
        box-shadow: none !important;
        transform: none !important;
    }

    .magnetic-content {
        transform: none !important;
    }

    /* Remove massive glowing shadows from elements */
    [class*="shadow-[0_"] {
        box-shadow: none !important;
    }

    /* Remove text drop-shadows which cause CPU rasterization overhead */
    [class*="drop-shadow-"] {
        filter: none !important;
    }

    /* Simplify the ambient background body glows */
    .bg-\[radial-gradient\],
    .animate-blob {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* Deep GPU Hardware Acceleration */
    .animate-marquee,
    .parallax-bg {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        will-change: transform;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
}