:root {
    --neon-cyan: #00ffff;
    --neon-magenta: #ff00ff;
    --neon-purple: #8a2be2;
    --electric-blue: #0080ff;
    --hot-pink: #ff1493;
    --dark-bg: #0a0a0f;
    --darker-bg: #050508;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Exo 2', sans-serif;
    background: var(--dark-bg);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, var(--neon-purple) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, var(--neon-cyan) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, var(--electric-blue) 0%, transparent 50%),
        linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
    animation: backgroundShift 20s ease-in-out infinite;
    z-index: -3;
}

@keyframes backgroundShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 30s linear infinite;
    z-index: -2;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-particles::before,
.floating-particles::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--neon-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-cyan);
    animation: float 15s infinite linear;
}

.floating-particles::before {
    top: 10%;
    left: 20%;
    animation-delay: -5s;
}

.floating-particles::after {
    top: 60%;
    right: 30%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    background: rgba(10, 10, 15, 0.8);
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    position: relative;
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: 3px;
}

.logo-text {
    background: linear-gradient(45deg, var(--neon-cyan), var(--neon-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 2;
}

.logo-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--neon-cyan), var(--neon-magenta));
    filter: blur(10px);
    opacity: 0.5;
    z-index: 1;
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

.nav-items {
    display: flex;
    gap: 2rem;
}

.nav-item {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 400;
    letter-spacing: 1px;
    position: relative;
    transition: all 0.3s ease;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    transition: width 0.3s ease;
}

.nav-item:hover {
    color: #ffffff;
    text-shadow: 0 0 10px var(--neon-cyan);
}

.nav-item:hover::after {
    width: 100%;
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 120px 2rem 4rem;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.hero-title {
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
}

.title-line {
    display: block;
    color: #ffffff;
    animation: titleGlow 4s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 20px rgba(255, 255, 255, 0.5); }
    50% { text-shadow: 0 0 30px rgba(255, 255, 255, 0.8); }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #ffffff;
    font-weight: 300;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* Search Console */
.search-console {
    margin-bottom: 4rem;
    display: flex;
    justify-content: center;
}

.console-frame {
    width: 100%;
    max-width: 800px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--glass-border);
}

.console-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: block;
}

.dot.red { background: #ff5f57; box-shadow: 0 0 10px #ff5f57; }
.dot.yellow { background: #ffbd2e; box-shadow: 0 0 10px #ffbd2e; }
.dot.green { background: #28ca42; box-shadow: 0 0 10px #28ca42; }

.console-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    color: var(--neon-cyan);
    letter-spacing: 2px;
}

.search-container {
    padding: 2rem;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 1rem;
    position: relative;
    transition: all 0.3s ease;
    background-clip: padding-box;
    z-index: 1;
}

.search-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(45deg, var(--neon-cyan), var(--neon-magenta), var(--electric-blue));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.search-box:focus-within::before {
    opacity: 1;
    animation: borderPulse 2s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.search-icon {
    color: var(--neon-cyan);
    font-size: 1.2rem;
    margin-right: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

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

#searchInput {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.1rem;
    font-family: 'Exo 2', sans-serif;
    outline: none;
    letter-spacing: 0.5px;
    z-index: 10;
    position: relative;
}

#searchInput::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

#searchBtn {
    background: #ffffff;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    color: #000;
    font-weight: 600;
    font-family: 'Orbitron', monospace;
    letter-spacing: 1px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-left: 1rem;
}

#searchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.3);
    background: #f0f0f0;
}

.btn-glow {
    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;
}

#searchBtn:hover .btn-glow {
    left: 100%;
}

/* Loading Animation */
.loading {
    text-align: center;
    margin: 4rem 0;
}

.loading-scanner {
    position: relative;
    width: 300px;
    height: 60px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.scanner-line {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    animation: scan 2s ease-in-out infinite;
}

@keyframes scan {
    0% { left: -100%; }
    100% { left: 100%; }
}

.scanner-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    color: var(--neon-cyan);
    letter-spacing: 2px;
    z-index: 2;
}

.hidden {
    display: none;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.result-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    transform-style: preserve-3d;
    animation: cardSlideIn 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(50px);
}

@keyframes cardSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card:hover {
    transform: translateY(-8px) rotateX(5deg);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(0, 255, 255, 0.2);
    border-color: var(--neon-cyan);
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.result-card:hover::before {
    opacity: 0.1;
}

.video-container {
    position: relative;
    width: 100%;
    height: 225px;
    background: #000;
    overflow: hidden;
}

.video-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(0, 255, 255, 0.1) 50%, transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-card:hover .video-container::after {
    opacity: 1;
    animation: scanline 1.5s ease-in-out infinite;
}

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

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.result-content {
    padding: 1.5rem;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.4;
    color: #ffffff;
    font-family: 'Orbitron', monospace;
    letter-spacing: 0.5px;
}

.dialogue {
    font-size: 1rem;
    color: var(--neon-cyan);
    font-style: italic;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(0, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--neon-cyan);
    position: relative;
    overflow: hidden;
}

.dialogue::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 3rem;
    color: var(--neon-magenta);
    opacity: 0.3;
}

.meta-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Orbitron', monospace;
}

.confidence {
    background: linear-gradient(45deg, var(--neon-purple), var(--hot-pink));
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    box-shadow: 0 0 15px rgba(255, 20, 147, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 100px 1rem 2rem;
    }
    
    .nav-container {
        padding: 1rem;
    }
    
    .nav-items {
        gap: 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .search-box {
        flex-direction: column;
        gap: 1rem;
    }
    
    #searchBtn {
        margin-left: 0;
        width: 100%;
    }
    
    .video-container {
        height: 200px;
    }
}

/* Staggered Animation for Results */
.result-card:nth-child(1) { animation-delay: 0.1s; }
.result-card:nth-child(2) { animation-delay: 0.2s; }
.result-card:nth-child(3) { animation-delay: 0.3s; }
.result-card:nth-child(4) { animation-delay: 0.4s; }
.result-card:nth-child(5) { animation-delay: 0.5s; }
.result-card:nth-child(6) { animation-delay: 0.6s; }
/* Additional Animations and Effects */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

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

.card-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, var(--neon-cyan) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    to {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

.card-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--neon-cyan), var(--neon-magenta), var(--electric-blue));
    border-radius: 18px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
    filter: blur(8px);
}

.result-card:hover .card-glow {
    opacity: 0.3;
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.video-unavailable {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Orbitron', monospace;
}

.unavailable-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.source-tag {
    background: rgba(0, 255, 255, 0.1);
    color: var(--neon-cyan);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid rgba(0, 255, 255, 0.3);
}

.timestamp {
    color: var(--neon-magenta);
    font-weight: 600;
}

.meta-left {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.no-results, .error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin: 2rem 0;
}

.no-results-icon, .error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.no-results-icon {
    color: var(--neon-cyan);
}

.error-icon {
    color: var(--hot-pink);
    animation: errorFlash 1s ease-in-out infinite;
}

@keyframes errorFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.no-results h3, .error-state h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.no-results p, .error-state p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .console-frame {
        margin: 0 1rem;
    }
    
    .search-container {
        padding: 1.5rem;
    }
    
    .result-content {
        padding: 1rem;
    }
    
    .meta-left {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --neon-cyan: #ffffff;
        --neon-magenta: #ffffff;
        --glass-bg: rgba(0, 0, 0, 0.8);
        --glass-border: rgba(255, 255, 255, 0.5);
    }
}