:root {
    --bg-dark: #050508;
    --card-bg: rgba(15, 15, 25, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent-primary: #6366f1;
    --accent-secondary: #a855f7;
    --accent-neon: #00f2ff;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --correct: #10b981;
    --incorrect: #f43f5e;
    --transition-smooth: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Dynamic Background Animation */
@keyframes mesh {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(-45deg, #0a0a12, #1a1a2e, #0f0c29, #302b63);
    background-size: 400% 400%;
    animation: mesh 15s ease infinite;
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    background: rgba(0, 0, 0, 0.3); /* Overlay for readability */
}

.aspect-ratio-box {
    width: 100%;
    height: 100%;
    position: relative;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    display: flex;
}

.content-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px 30px;
}

/* Header Styling */
.channel-header {
    margin-bottom: 20px; /* Reduced */
    padding-bottom: 15px; /* Reduced */
    border-bottom: 1px solid var(--glass-border);
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-right {
    display: flex;
    gap: 20px;
}

.social-link {
    text-decoration: none;
}

.social-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 15px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    font-size: 0.9rem;
    font-weight: 600;
}

.social-item.subscribe {
    border-color: #ef4444;
    color: #ef4444;
}

.social-item.instagram {
    border-color: #e1306c;
    color: #e1306c;
}

.channel-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100px;
    height: 2px;
    background: var(--accent-neon);
    box-shadow: 0 0 10px var(--accent-neon);
}

.channel-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem; /* Slightly smaller */
    font-weight: 800;
    background: linear-gradient(90deg, #fff, var(--accent-neon));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

/* Layout Split - 3 Column Mode */
.quiz-layout {
    display: grid;
    grid-template-columns: 350px 1fr 250px; /* Chat | Question | Webcam */
    gap: 30px;
    flex: 1;
    min-height: 0;
}

/* Question Section */
.question-section {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Moved to top */
    padding-top: 10px; /* Slight gap from header */
}

.question-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 30px 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    animation: fadeIn 1s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    /* overflow: hidden removed to prevent clipping */
}

.question-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.question-number {
    font-size: 1rem;
    color: var(--accent-neon);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 15px;
    display: block;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.3);
}

.question-text {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.5; /* Increased from 1.2 for Hindi matras */
    padding-top: 10px; /* Space for top matras */
    margin-bottom: 25px;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.option {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px 30px;
    font-size: 1.3rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    position: relative;
}

.option:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(10px) scale(1.02);
    border-color: var(--accent-primary);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.2);
}

.option::before {
    content: attr(data-prefix);
    font-weight: 800;
    margin-right: 20px;
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.15);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: var(--transition-smooth);
}

.option:hover::before {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 0 15px var(--accent-primary);
}

/* Option States */
.option.correct {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: var(--correct) !important;
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.3) !important;
    transform: scale(1.05);
}

.option.incorrect {
    background: rgba(244, 63, 94, 0.15) !important;
    border-color: var(--incorrect) !important;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* Controls */
.controls {
    margin-top: 20px; /* Reduced from 40px */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.nav-btns {
    display: flex;
    gap: 20px;
    align-items: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    padding: 15px 25px;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.5);
    filter: brightness(1.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: var(--accent-primary);
}

.answer-box {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--correct);
    padding: 15px 30px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideInUp 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}

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

.answer-box.hidden {
    display: none;
}

.answer-box .label {
    color: var(--correct);
    font-weight: 600;
}

/* Sidebar Styling */
.chat-sidebar {
    height: 100%;
    padding-bottom: 20px;
    display: flex; /* Added flex */
    flex-direction: column; /* Added flex direction */
}

.webcam-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    height: 100%; /* Ensure full height for sidebar */
}

.webcam-placeholder {
    width: 250px; /* Full width of its column */
    height: 250px; 
    background: rgba(0, 0, 0, 0.4);
    border: 3px solid var(--accent-primary);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Chat Styling */
.chat-container {
    height: 100%; /* Force full height */
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.chat-header {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--accent-secondary);
}

.chat-frame-wrapper {
    flex: 1;
    position: relative;
}

#youtube-chat-frame {
    width: 100%;
    height: 100%;
    border: none;
}

.chat-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 12, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    z-index: 10;
}

.chat-overlay p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.chat-overlay input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px;
    color: white;
    margin-bottom: 10px;
    text-align: center;
}

.chat-overlay button {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.chat-overlay button:hover {
    transform: scale(1.05);
}

.placeholder-content {
    text-align: center;
    color: var(--text-muted);
}

.placeholder-content .icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive Font Sizes */
@media (max-width: 1200px) {
    .question-text { font-size: 1.8rem; }
    .option { font-size: 1.1rem; }
}
