/* Oral Exam Agent — minimal responsive stylesheet */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #ca8a04;
    --danger: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background: var(--gray-900);
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.navbar-brand {
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}
.navbar-links { display: flex; gap: 1rem; }
.navbar-links a { color: var(--gray-300); text-decoration: none; font-size: 0.9rem; }
.navbar-links a:hover { color: white; }

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fefce8; color: #854d0e; border: 1px solid #fef08a; }

/* Cards */
.card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.card h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.card p { color: var(--gray-600); font-size: 0.9rem; }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}
th, td { padding: 0.6rem 0.75rem; text-align: left; font-size: 0.9rem; }
th { background: var(--gray-100); font-weight: 600; border-bottom: 2px solid var(--gray-200); }
td { border-bottom: 1px solid var(--gray-100); }
tr:last-child td { border-bottom: none; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-800);
}
.btn-outline:hover { background: var(--gray-100); }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.3rem; font-size: 0.9rem; }
.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
}
.form-control:focus { outline: 2px solid var(--primary); outline-offset: -1px; }

/* Status badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-pending { background: var(--gray-200); color: var(--gray-600); }
.badge-active { background: #dbeafe; color: #1e40af; }
.badge-completed { background: #dcfce7; color: #166534; }
.badge-graded { background: #f3e8ff; color: #6b21a8; }
.badge-flagged { background: #fef2f2; color: #991b1b; }

/* Headings */
h1 { font-size: 1.5rem; margin-bottom: 1rem; }
h2 { font-size: 1.25rem; margin-bottom: 0.75rem; margin-top: 1.5rem; }
h2:first-child { margin-top: 0; }

/* Utilities */
.text-muted { color: var(--gray-600); }
.text-sm { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--gray-600);
    font-size: 0.8rem;
    border-top: 1px solid var(--gray-200);
    margin-top: auto;
}

/* Exam widget container — hosts the ElevenLabs <elevenlabs-convai> element.
   The widget itself renders as a floating orb; this container is only used
   while the script is loading (shows a "Loading…" message). */
.exam-widget {
    width: 100%;
    min-height: 60px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
}
/* Hide the container once the widget element has been inserted */
.exam-widget:empty {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 1rem; }
    table { font-size: 0.8rem; }
    th, td { padding: 0.4rem; }
}
