/* 1. Base Reset */
* {
    box-sizing: border-box; /* Ensures padding/borders don't expand elements */
}

body {
    background-color: #0b0f19;
    color: #f8fafc;
    font-family: sans-serif;
    margin: 0;
    height: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Keeps the body from creating extra scrollbars */
}

.classroom-container {
    width: 100%;
    height: 100%;
    background: #111827;
    display: flex;
    flex-direction: column; /* Stacks elements top-to-bottom */
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
    overflow: hidden; /* Prevent the container itself from scrolling */
    border-radius: 15px; /* Matches the parent container rounding */
}

.transcript-box {
    width: 100%;
    flex-grow: 1; /* This forces the box to take ALL remaining space */
    background: #0f172a;
    border-radius: 12px;
    padding: 12px 15px;
    overflow-y: auto; /* Only the transcript area scrolls */
    margin-top: 10px;
    min-height: 80px; /* Constrained height to fit 580px layout */
}

/* 2. Avatar Structure */
.avatar-placeholder {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #1f2937 0%, #111827 100%);
    border-radius: 50%;
    margin: 5px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #374151;
    position: relative;
    transition: all 0.3s ease;
}

.teacher-face {
    width: 50px;
    height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.eyes-row {
    display: flex;
    gap: 12px;
}

.eye {
    width: 8px;
    height: 8px;
    background-color: #38bdf8;
    border-radius: 50%;
}

.mouth {
    width: 20px;
    height: 5px;
    background-color: #38bdf8;
    border-radius: 5px;
    transition: all 0.2s ease;
}

/* 3. Animations */
@keyframes talkingMouth {
    0% { height: 5px; width: 20px; }
    50% { height: 12px; width: 12px; border-radius: 50%; }
    100% { height: 5px; width: 20px; }
}

.talking-active {
    animation: talkingMouth 0.3s infinite ease-in-out;
    background-color: #0284c7;
}

.speaking-active {
    animation: avatarPulse 2s infinite ease-in-out;
    border-color: #38bdf8;
}

@keyframes avatarPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(56, 189, 248, 0); }
}

/* 4. UI Elements */


.mic-btn {
    width: 80%;
    max-width: 300px; /* Limit the maximum size */
    margin: 8px auto 12px auto; /* Centered, reduced margins */
    padding: 10px 20px; /* Slimmer padding */
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px; /* Slightly smaller text */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}

.mic-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.5);
    background: linear-gradient(135deg, #0369a1, #0284c7);
}

.mic-btn:active {
    transform: translateY(0);
}
.language-grid {
    display: grid;
    /* This tells the grid to have 4 columns, each taking an equal fraction of the width */
    grid-template-columns: repeat(4, 1fr); 
    gap: 8px; /* Slightly smaller gap to fit them on one line */
    margin-bottom: 25px;
    width: 100%;
}

.lang-option {
    background: #1f2937;
    border: 1px solid #374151;
    color: #94a3b8;
    padding: 10px 5px; /* Reduced side padding to ensure text fits */
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px; /* Slightly smaller font to prevent wrapping */
    transition: all 0.2s;
    text-align: center;
}

.lang-option:hover, .lang-option.active {
    background: #0284c7;
    color: white;
    border-color: #38bdf8;
}

.recal-btn {
    display: none;
    background: #1f2937;
    border: 1px solid #374151;
    color: #f8fafc;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s;
    padding: 10px 12px;
}
.recal-btn:hover {
    background: #374151;
    border-color: #4b5563;
    transform: translateY(-2px);
}
.recal-btn:active {
    transform: translateY(0);
}

.thinking-eyes {
    border-color: #f59e0b !important;
    animation: thinkingPulse 1.5s infinite ease-in-out;
}

@keyframes thinkingPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
}