/* --- Base --- */
@tailwind base;
@tailwind components;
@tailwind utilities;

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0a0e27; /* Darker navy blue */
    color: white;
}

/* --- KBC Style Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes skeletonPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.6; }
}
@keyframes typeIn {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
}
@keyframes skeletonShimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes spinLoader {
    to { transform: rotate(360deg); }
}

.animate-fadeIn { animation: fadeIn 0.8s ease-out forwards; }
.animate-slideUp { animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-shimmer { animation: shimmer 2s infinite linear; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-typeIn { animation: typeIn 0.6s ease-out forwards; }

/* Skeleton text shimmer for loading states */
.skeleton-text {
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    color: transparent !important;
}
.skeleton-text * { color: transparent !important; }

/* Spinner for loading button */
.spin-loader {
    width: 16px; height: 16px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: spinLoader 0.6s linear infinite;
}

/* --- Phase 2: Skeleton Loader --- */
.skeleton-pulse {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

/* --- Phase 2: Fade Transitions (2 seconds) --- */
.fade-transition {
    transition: opacity 2s ease-in-out, transform 2s ease-in-out;
}

.fade-out {
    opacity: 0;
    pointer-events: none;
}

.fade-in {
    opacity: 1;
    pointer-events: auto;
}

/* --- Utility --- */
.pointer-events-auto { pointer-events: auto; }
.pointer-events-none { pointer-events: none; }
.question-text { 
    text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}

/* --- HOMEPAGE SPECIFIC STYLES --- */
/* New Search-focused card styling */

.quiz-card-new {
    background: linear-gradient(145deg, #1a1f3a, #0a0e27);
    border: 2px solid #2d3a5f;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.quiz-card-new::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; 
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(234, 179, 8, 0.3), transparent);
    transition: left 0.5s;
    pointer-events: none;
}

.quiz-card-new:hover {
    transform: translateY(-4px);
    border-color: #eab308;
    box-shadow: 
        0 8px 20px -5px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    opacity: 0.95;
}

.quiz-card-new:hover::after {
    left: 100%;
}

.quiz-card-new::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, rgba(234, 179, 8, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.quiz-card-new:hover::before {
    opacity: 1;
}

/* Search Container Styles */
.search-container input::placeholder {
    color: #64748b;
    transition: opacity 0.3s;
    opacity: var(--placeholder-opacity, 1);
}

.search-container input:focus::placeholder {
    opacity: 0.5;
}

/* Old card styles (kept for compatibility) */
.quiz-card {
    background: linear-gradient(145deg, #1a1f3a, #0a0e27);
    border: 2px solid #2d3a5f;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.quiz-card::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; 
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(234, 179, 8, 0.3), transparent);
    transition: left 0.5s;
    pointer-events: none;
}

.quiz-card:hover {
    transform: translateY(-4px);
    border-color: #eab308;
    box-shadow: 
        0 8px 20px -5px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    opacity: 0.95;
}

.quiz-card:hover::after {
    left: 100%;
}

.quiz-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, rgba(234, 179, 8, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.quiz-card:hover::before {
    opacity: 1;
}

/* KBC Title - Professional style without glow */
.kbc-title {
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

/* Button Enhancements - Professional style */
.kbc-button {
    background: linear-gradient(145deg, #eab308, #ca8a04);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.kbc-button:hover {
    background: linear-gradient(145deg, #fbbf24, #eab308);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    opacity: 0.95;
}

#topic-input::placeholder {
    color: #94a3b8;
}
