:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #22c55e;
    --error: #ef4444;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Animated Background */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #7c3aed;
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #0ea5e9;
    top: 40%;
    left: 60%;
    animation-delay: -10s;
}

@keyframes move {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.1); }
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 10%;
    background: linear-gradient(90deg, #4f46e5, #0ea5e9);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Quiz Section */
.video-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 1.5rem;
}

.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Maximized Cinematic Video Mode */
body.video-maximized {
    overflow: hidden;
}

body.video-maximized .video-card {
    backdrop-filter: none !important;
    filter: none !important;
    transform: none !important;
}

body.video-maximized .video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 0;
    aspect-ratio: auto;
    animation: cinemaFadeIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.video-maximized .video-overlay {
    background: rgba(0, 0, 0, 0.6);
}

@keyframes cinemaFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Elegant Close Button */
.close-cinema-btn {
    display: none;
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    opacity: 0.8;
}

.close-cinema-btn:hover {
    transform: scale(1.1) rotate(90deg);
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(255, 255, 255, 0.3);
    opacity: 1;
}

body.video-maximized .close-cinema-btn {
    display: flex;
}

/* Cinematic Video Playback Progress Bar */
.video-playback-progress {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    z-index: 10001;
    overflow: hidden;
}

body.video-maximized .video-playback-progress {
    display: block;
}

.video-playback-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #0ea5e9);
    transition: width 0.1s linear;
}

video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: background 0.3s;
}

.video-overlay:hover {
    background: rgba(0, 0, 0, 0.1);
}

.play-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.play-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

.video-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
}

/* Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
}

.btn-ai {
    background: #4f46e5;
    color: white;
}

.btn-ai:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

.btn-real {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-real:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-next, .btn-restart, .btn-gemini {
    padding: 1rem 2rem;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
}

.btn-next, .btn-restart {
    background: white;
    color: var(--bg-dark);
    flex: 1;
}

.btn-gemini {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    color: white;
    flex: 1;
}

.btn-gemini:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.4);
}

.result-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.gemini-response {
    margin-top: 1.5rem;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    animation: slideUp 0.4s ease-out;
}

.gemini-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.gemini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.gemini-table th {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.gemini-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: top;
    line-height: 1.5;
}

.gemini-table tr:last-child td {
    border-bottom: none;
}

.model-name {
    font-weight: 700;
    color: #a78bfa;
    white-space: nowrap;
}

.guess-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.tag-ai { background: rgba(79, 70, 229, 0.2); color: #818cf8; border: 1px solid rgba(79, 70, 229, 0.3); }
.tag-real { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }

.match-icon {
    font-size: 1.25rem;
    display: flex;
    justify-content: center;
}

.gemini-loading {
    padding: 2rem;
    text-align: center;
}

.loading-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.loading-dots::after {
    content: "...";
    display: inline-block;
    width: 20px;
    text-align: left;
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ""; }
    40% { content: "."; }
    60% { content: ".."; }
    80% { content: "..."; }
}

/* Result Container */
.result-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    animation: fadeIn 0.4s ease-out;
}

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

.result-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-correct { background: var(--success); color: white; }
.status-incorrect { background: var(--error); color: white; }

.result-explanation {
    line-height: 1.6;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.more-info-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    white-space: pre-line;
}

/* Score Section */
.score-section {
    text-align: center;
}

.score-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2rem;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid var(--primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 2rem auto;
    background: rgba(99, 102, 241, 0.1);
}

#final-score {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.score-total {
    font-size: 1rem;
    color: var(--text-muted);
}

#score-message {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.hidden {
    display: none;
}

/* Utilities */
@media (max-width: 640px) {
    .app-container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
}
