/* Inbox Guardian - Cyber Security eLearning Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    --bg-main: #090d16;
    --indigo-glow: rgba(99, 102, 241, 0.4);
    --cyan-glow: rgba(6, 182, 212, 0.4);
    --emerald-glow: rgba(16, 185, 129, 0.4);
    --rose-glow: rgba(244, 63, 94, 0.4);
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-main);
    color: #f1f5f9;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Cyberpunk Grid Background Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(to right, rgba(99, 102, 241, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
    z-index: 0;
}

.font-mono { 
    font-family: 'JetBrains Mono', monospace; 
}

/* Glassmorphism Panels */
.glass-panel {
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
}

.glass-card {
    background: rgba(30, 41, 59, 0.65);
    border: 1px solid rgba(51, 65, 85, 0.75);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.glass-card:hover {
    border-color: rgba(99, 102, 241, 0.55);
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.25);
    background: rgba(30, 41, 59, 0.95);
}

/* Character Speech Bubble Dialogue Box */
.speech-bubble {
    position: relative;
    background: rgba(15, 23, 42, 0.95);
    border: 1.5px solid rgba(6, 182, 212, 0.5);
    border-radius: 1.25rem;
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(6, 182, 212, 0.15);
}
.speech-bubble::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 24px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 10px solid rgba(6, 182, 212, 0.5);
}

/* Cyber Avatar Vector Frames */
.cyber-avatar-frame {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    border: 2px solid rgba(6, 182, 212, 0.5);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.3);
    transition: all 0.3s ease;
}
.cyber-avatar-frame:hover {
    border-color: rgba(99, 102, 241, 0.9);
    box-shadow: 0 0 45px rgba(99, 102, 241, 0.6);
}
.cyber-avatar-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.15s ease;
}

/* Speaking Avatar Active Animation & Speaking Motion */
.cyber-avatar-frame.speaking {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 40px rgba(56, 189, 248, 0.8), 0 0 15px rgba(6, 182, 212, 0.9) !important;
    animation: speakingPulse 0.35s ease-in-out infinite alternate;
}
.cyber-avatar-frame.speaking img {
    animation: avatarHeadTalk 0.4s ease-in-out infinite alternate;
}

@keyframes speakingPulse {
    0% {
        transform: translateY(0px) scale(1);
        box-shadow: 0 0 30px rgba(56, 189, 248, 0.7);
    }
    100% {
        transform: translateY(-3px) scale(1.02);
        box-shadow: 0 0 50px rgba(56, 189, 248, 1), 0 0 20px rgba(99, 102, 241, 0.8);
    }
}

@keyframes avatarHeadTalk {
    0% {
        transform: scale(1.03) translateY(0px) rotate(0deg);
    }
    50% {
        transform: scale(1.05) translateY(-2px) rotate(-1deg);
    }
    100% {
        transform: scale(1.04) translateY(-1px) rotate(1deg);
    }
}

/* Karaoke Word-by-Word Text Highlighting */
.word-node {
    display: inline-block;
    padding: 0 2px;
    border-radius: 4px;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    color: #cbd5e1;
}

.word-node.word-active {
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.18);
    text-shadow: 0 0 14px rgba(56, 189, 248, 0.9);
    font-weight: 700;
    transform: scale(1.12);
    border-bottom: 2px solid #38bdf8;
}

.word-node.word-passed {
    color: #f1f5f9;
}

/* Animations */
.fade-in { animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.slide-up { animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.pulse-glow { animation: pulseGlow 3s infinite; }

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

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

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
    50% { box-shadow: 0 0 45px rgba(99, 102, 241, 0.65); }
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(40px, -60px) scale(1.15); }
    66% { transform: translate(-30px, 30px) scale(0.9); }
}
@keyframes floatOrb2 {
    0%, 100% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(-50px, 40px) scale(1.1); }
    66% { transform: translate(35px, -50px) scale(0.85); }
}
.float-vector-1 { animation: floatOrb1 14s ease-in-out infinite; }
.float-vector-2 { animation: floatOrb2 16s ease-in-out infinite; }

/* Cyber Floating Particles */
.cyber-particle {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(99, 102, 241, 0.3);
    pointer-events: none;
    user-select: none;
    animation: particleFloat 12s linear infinite;
    z-index: 1;
}
@keyframes particleFloat {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    20% { opacity: 0.85; }
    80% { opacity: 0.85; }
    100% { transform: translateY(-20vh) rotate(360deg); opacity: 0; }
}

/* Option Selection State */
.option-selected {
    border-color: #6366f1 !important;
    background: rgba(99, 102, 241, 0.2) !important;
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.35);
}

/* Waveform Visualizer Bars */
.eq-bar {
    width: 3px;
    height: 14px;
    background: #6366f1;
    border-radius: 3px;
    transition: height 0.15s ease;
}
.eq-bar.playing {
    animation: eqBounce 0.8s ease-in-out infinite alternate;
}
.eq-bar:nth-child(1) { animation-delay: 0.1s; }
.eq-bar:nth-child(2) { animation-delay: 0.3s; }
.eq-bar:nth-child(3) { animation-delay: 0.2s; }
.eq-bar:nth-child(4) { animation-delay: 0.4s; }

@keyframes eqBounce {
    0% { height: 6px; }
    100% { height: 22px; background: #06b6d4; }
}

/* Custom Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.6); }
::-webkit-scrollbar-thumb { background: rgba(99, 102, 241, 0.45); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, 0.85); }
