:root {
    --primary-color: #4A90E2;
    --secondary-color: #50E3C2;
    --accent-color: #F8E71C;
    --text-color: #333;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --border-radius: 12px;
    --teacher-color: #FF6B6B;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
}

h1,
h2,
h3,
h4 {
    font-family: 'Comic Neue', cursive;
    margin-top: 0;
}

.exam-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 0 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    color: var(--primary-color);
}

.badge {
    background: var(--accent-color);
    color: #000;
    font-size: 0.5em;
    padding: 5px 10px;
    border-radius: 20px;
    vertical-align: middle;
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    transition: transform 0.2s;
}

.hidden {
    display: none;
}

/* Generator Section */
.nano-banana-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.status {
    font-size: 0.8em;
    color: #2ecc71;
    font-weight: bold;
    text-transform: uppercase;
}

.mic-check-area {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f0f4f8;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.mic-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.mic-selector {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
    max-width: 250px;
}

#audio-visualizer {
    background: #2c3e50;
    border-radius: 4px;
    width: 200px;
    height: 40px;
    margin: 5px auto;
    display: block;
}

.status-text.neutral {
    color: #7f8c8d;
}

.status-text.success {
    color: #2ecc71;
    font-weight: bold;
}

.status-text.error {
    color: #e74c3c;
    font-weight: bold;
}

.small-btn {
    padding: 5px 15px;
    font-size: 0.9em;
    width: auto;
    display: inline-block;
    cursor: pointer;
}

.network-warning {
    background: #fff3cd;
    color: #856404;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 0.9em;
    border: 1px solid #ffeeba;
}

.banana-controls {
    text-align: center;
    padding: 20px;
}

.primary-btn {
    background: linear-gradient(45deg, var(--primary-color), #2980b9);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.3);
    transition: transform 0.1s;
}

.primary-btn:active {
    transform: scale(0.98);
}

/* Image Viewport */
.image-viewport {
    width: 100%;
    min-height: 400px;
    background: #eef2f3;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
    border: 2px dashed #ccc;
}

#scenario-image {
    width: 100%;
    height: auto;
    display: block;
}

#loading-overlay {
    text-align: center;
    color: #888;
}

.spinner {
    font-size: 4em;
    animation: spin 2s infinite linear;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.task-box {
    background: #fffbeb;
    border-left: 5px solid var(--accent-color);
    padding: 10px 15px;
    margin-top: 10px;
}

.label {
    font-weight: bold;
    font-size: 0.8em;
    color: #d35400;
}

/* Recording Controls */
.recording-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.record-btn {
    background: #e74c3c;
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 0 0 5px rgba(231, 76, 60, 0.2);
    transition: box-shadow 0.2s, background 0.2s;
}

.record-btn:active {
    background: #c0392b;
}

.record-btn.recording {
    box-shadow: 0 0 0 10px rgba(231, 76, 60, 0.5);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0px rgba(231, 76, 60, 0.5);
    }

    100% {
        box-shadow: 0 0 0 15px rgba(231, 76, 60, 0);
    }
}

.transcript-box {
    margin-bottom: 20px;
}

.transcript-box h4 {
    margin-bottom: 5px;
    color: #7f8c8d;
    font-size: 0.9em;
}

.transcript-box textarea {
    width: 100%;
    min-height: 80px;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    font-family: inherit;
    font-size: 1em;
    resize: vertical;
    box-sizing: border-box;
    transition: border 0.3s;
}

.transcript-box textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    background: #fff;
}

.grade-btn {
    background: var(--secondary-color);
    color: #006450;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
}

.grade-btn:disabled {
    background: #cbd3d1;
    cursor: not-allowed;
    color: #888;
}

/* Grading Result */
.teacher-persona {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.avatar {
    font-size: 2.5em;
    background: #ffeaa7;
    padding: 10px;
    border-radius: 50%;
}

/* Mode Switcher */
.mode-switcher {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    background: #f0f4f8;
    padding: 10px;
    border-radius: 20px;
}

.mode-label {
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 15px;
    transition: background 0.2s;
    font-weight: 500;
}

.mode-label:hover {
    background: #e2e8f0;
}

.mode-label input {
    margin-right: 8px;
}

.file-upload-wrapper {
    margin: 15px 0;
}

/* Student Info */
.student-info-box {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
}

.student-info-box label {
    font-weight: bold;
    color: #555;
    margin-right: 10px;
}

.student-info-box input {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1.1em;
    width: 200px;
    text-align: center;
}

.student-info-box input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* Generator Loading */
.loading-container {
    margin-top: 15px;
    color: #666;
}

/* History Section */
#history-section {
    border-top: 5px solid #ddd;
}

.history-item {
    background: #f9f9f9;
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 0 8px 8px 0;
}

.history-item h4 {
    margin: 0 0 5px 0;
    font-size: 1em;
    color: #333;
}

.history-meta {
    font-size: 0.8em;
    color: #888;
    margin-bottom: 10px;
}

.history-feedback {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #eee;
    font-size: 0.9em;
}

.grading-body h3 {
    margin-top: 0;
    color: var(--teacher-color);
}

.grading-body strong {
    color: #d35400;
}

.secondary-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
}

#retry-btn {
    width: 100%;
    margin-top: 20px;
}