/* Debate Arena - Additional styles beyond Tailwind */

/* Hide elements with x-cloak until Alpine initializes */
[x-cloak] { display: none !important; }

/* Chat container custom scrollbar */
#debate-chat::-webkit-scrollbar {
    width: 6px;
}
#debate-chat::-webkit-scrollbar-track {
    background: #0D1117;
}
#debate-chat::-webkit-scrollbar-thumb {
    background: #30363D;
    border-radius: 3px;
}
#debate-chat::-webkit-scrollbar-thumb:hover {
    background: #484F58;
}

/* Persona list custom scrollbar */
.persona-list-scroll {
    scrollbar-width: thin;
    scrollbar-color: #30363D #0D1117;
}
.persona-list-scroll::-webkit-scrollbar {
    width: 6px;
}
.persona-list-scroll::-webkit-scrollbar-track {
    background: #0D1117;
}
.persona-list-scroll::-webkit-scrollbar-thumb {
    background: #30363D;
    border-radius: 3px;
}
.persona-list-scroll::-webkit-scrollbar-thumb:hover {
    background: #484F58;
}

/* Message entrance animation */
#debate-chat > div {
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Evidence chip hover effect */
.evidence-chip {
    transition: all 0.15s ease;
}
.evidence-chip:hover {
    transform: scale(1.05);
}

/* Generating dots animation */
.generating-dots span {
    animation: dotPulse 1.4s infinite ease-in-out both;
}
.generating-dots span:nth-child(1) { animation-delay: 0s; }
.generating-dots span:nth-child(2) { animation-delay: 0.2s; }
.generating-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

/* Winner/Loser Card Styling */
.winner-card {
    position: relative;
    z-index: 10;
}

.golden-glow {
    animation: goldenGlowPulse 2s ease-in-out infinite;
}

@keyframes goldenGlowPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(251, 191, 36, 0.4), 0 0 30px rgba(251, 191, 36, 0.2);
    }
    50% {
        box-shadow: 0 0 25px rgba(251, 191, 36, 0.6), 0 0 40px rgba(251, 191, 36, 0.3);
    }
}

.loser-card {
    filter: grayscale(0.2);
}

/* Trophy entrance animation */
@keyframes trophy-drop {
    0% {
        transform: translate(-50%, -50px) scale(0);
        opacity: 0;
    }
    60% {
        transform: translate(-50%, 5px) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, 0) scale(1);
    }
}

.animate-trophy-drop {
    animation: trophy-drop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Winner score bounce */
@keyframes score-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.animate-score-bounce {
    animation: score-bounce 0.5s ease-out;
}

/* Confetti particles */
.confetti-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    opacity: 0;
    animation: confetti-fall 1.2s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(200px) rotate(360deg);
        opacity: 0;
    }
}

/* Success checkmark bounce */
.success-icon {
    display: inline-block;
    animation: checkmark-bounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkmark-bounce {
    0% { transform: scale(0); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* XP badge slide */
.xp-badge {
    animation: xp-slide-up 0.5s ease-out 0.3s both;
}

@keyframes xp-slide-up {
    0% {
        transform: translateY(10px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Incorrect prediction shake */
.miss-shake {
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%, 75% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
}

/* Utility classes */
.scale-98 { transform: scale(0.98); }
.scale-105 { transform: scale(1.05); }

/* ========================================
   MODAL STYLES
   ======================================== */

/* Modal fade in/out */
@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Stage transitions */
@keyframes stage-slide-in {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes stage-zoom-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes stage-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Round announcement dramatic entrance */
@keyframes round-announce {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-5deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.1) rotate(0deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Persona draft selection glow */
@keyframes draft-select {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% {
        transform: scale(1);
        box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
    }
}

/* Countdown/prediction urgency pulse */
@keyframes countdown-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Suspense/scoring glow effect */
@keyframes suspense-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(251, 191, 36, 0.6);
    }
}

/* Victory burst animation */
@keyframes victory-burst {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Stats counter spin/reveal */
@keyframes counter-spin {
    0% {
        transform: rotateY(0deg);
        opacity: 0;
    }
    50% {
        transform: rotateY(180deg);
        opacity: 0;
    }
    100% {
        transform: rotateY(360deg);
        opacity: 1;
    }
}

/* Loading message fade cycle */
@keyframes message-fade-cycle {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}

/* Utility animation classes */
.stage-enter { animation: stage-slide-in 400ms ease-out; }
.stage-enter-zoom { animation: stage-zoom-in 500ms ease-out; }
.stage-exit { animation: stage-fade-out 300ms ease-out forwards; }
.round-announce-enter { animation: round-announce 800ms cubic-bezier(0.34, 1.56, 0.64, 1); }
.draft-selected { animation: draft-select 500ms ease-out; }
.countdown-urgent { animation: countdown-pulse 1s ease-in-out infinite; }
.suspense-active { animation: suspense-glow 2s ease-in-out infinite; }
.victory-celebrate { animation: victory-burst 600ms cubic-bezier(0.34, 1.56, 0.64, 1); }
.counter-reveal { animation: counter-spin 800ms ease-out; }

/* Transition speed classes */
.transition-fast { transition: all 150ms ease-out; }
.transition-standard { transition: all 300ms ease-out; }
.transition-dramatic { transition: all 500ms cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Fade in delayed (for hints) */
@keyframes fade-in-delayed {
    0% { opacity: 0; }
    80% { opacity: 0; }
    100% { opacity: 1; }
}

.animate-fade-in-delayed {
    animation: fade-in-delayed 3s ease-out forwards;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
