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


body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f7fb;
    color: #1f2937;
    min-height: 100vh;
}


/* =========================================================
   NAVBAR
   ========================================================= */

.navbar {
    background: #172554;
    color: white;
    min-height: 70px;
    padding: 0 40px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}


.nav-brand a {
    color: white;
    text-decoration: none;
    font-size: 22px;
    font-weight: 700;
}


.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
}


.nav-links a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 7px;
    transition: 0.2s;
}


.nav-links a:hover {
    background: rgba(255, 255, 255, 0.12);
}


/* =========================================================
   MAIN
   ========================================================= */

main {
    min-height: calc(100vh - 130px);
}


.container {
    width: min(1200px, 92%);
    margin: 35px auto;
}


/* =========================================================
   PAGE HEADER
   ========================================================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}


.page-header h1 {
    font-size: 32px;
    color: #172554;
}


.page-header p {
    margin-top: 7px;
    color: #64748b;
}


.test-topic {
    color: #2563eb;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
}


/* =========================================================
   CARDS
   ========================================================= */

.card {
    background: white;
    border-radius: 14px;
    padding: 28px;
    margin-bottom: 25px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
    border: 1px solid #e5e7eb;
}


.card-header {
    margin-bottom: 22px;
}


.card-header h2 {
    color: #172554;
    margin-bottom: 6px;
}


.card-header p {
    color: #64748b;
}


/* =========================================================
   FORMS
   ========================================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}


.form-group {
    margin-bottom: 20px;
}


.form-group-full {
    grid-column: 1 / -1;
}


.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #334155;
}


input,
textarea,
select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    background: white;
    outline: none;
    transition: 0.2s;
}


input:focus,
textarea:focus,
select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}


textarea {
    resize: vertical;
}


.form-actions {
    margin-top: 5px;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 8px;

    padding: 11px 18px;

    font-size: 14px;
    font-weight: 700;

    text-decoration: none;
    cursor: pointer;

    transition: 0.2s;
}


.btn:hover {
    transform: translateY(-1px);
}


.btn-primary {
    background: #2563eb;
    color: white;
}


.btn-primary:hover {
    background: #1d4ed8;
}


.btn-secondary {
    background: #64748b;
    color: white;
}


.btn-secondary:hover {
    background: #475569;
}


.btn-success {
    background: #16a34a;
    color: white;
}


.btn-success:hover {
    background: #15803d;
}


.btn-warning {
    background: #d97706;
    color: white;
}


.btn-warning:hover {
    background: #b45309;
}


.btn-danger {
    background: #dc2626;
    color: white;
}


.btn-danger:hover {
    background: #b91c1c;
}


.btn-small {
    padding: 7px 11px;
    font-size: 12px;
}


/* =========================================================
   TABLE
   ========================================================= */

.table-wrapper {
    overflow-x: auto;
}


table {
    width: 100%;
    border-collapse: collapse;
}


th {
    background: #f1f5f9;
    color: #334155;
    text-align: left;
    padding: 14px;
    font-size: 13px;
}


td {
    padding: 15px 14px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}


tr:hover td {
    background: #f8fafc;
}


.table-description {
    color: #64748b;
    font-size: 12px;
    margin-top: 4px;
}


.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 30px;
    height: 30px;

    border-radius: 50%;

    background: #dbeafe;
    color: #1d4ed8;

    font-weight: 700;
}


.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}


.inline-form {
    display: inline;
}


/* =========================================================
   STATUS
   ========================================================= */

.status {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}


.status.active {
    background: #dcfce7;
    color: #166534;
}


.status.inactive {
    background: #e2e8f0;
    color: #475569;
}


.status.completed {
    background: #dcfce7;
    color: #166534;
}


/* =========================================================
   FLASH
   ========================================================= */

.flash-container {
    width: min(1200px, 92%);
    margin: 20px auto 0;
}


.flash {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: 600;
}


.flash.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}


.flash.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}


.flash.warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}


/* =========================================================
   QUESTION ADMIN
   ========================================================= */

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}


.question-admin-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 18px;
    background: #f8fafc;
}


.question-admin-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 15px;
}


.question-number-badge {
    width: 34px;
    height: 34px;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #2563eb;
    color: white;
}


.question-admin-card h3 {
    margin-bottom: 15px;
    line-height: 1.5;
}


.admin-options {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}


.admin-option {
    background: white;
    padding: 11px 14px;
    border-radius: 7px;
    border: 1px solid #e2e8f0;
}


.correct-option {
    background: #f0fdf4;
    border-color: #86efac;
}


.correct-label {
    color: #15803d;
    font-weight: 700;
    margin-left: 10px;
}


.upload-box {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}


.upload-box input[type="file"] {
    flex: 1;
}


.format-help {
    margin-top: 22px;
    padding: 18px;
    background: #f8fafc;
    border-radius: 10px;
}


.format-help h3 {
    margin-bottom: 12px;
}


.format-help pre {
    white-space: pre-wrap;
    background: #0f172a;
    color: white;
    padding: 18px;
    border-radius: 8px;
    overflow-x: auto;
    line-height: 1.6;
    margin: 12px 0;
}


/* =========================================================
   STATS
   ========================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 25px;
}


.stat-card {
    background: white;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.07);
    border: 1px solid #e5e7eb;
}


.stat-label {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 8px;
}


.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #172554;
}


.stat-unit {
    font-size: 14px;
    color: #64748b;
}


/* =========================================================
   STUDENT TEST PAGE
   ========================================================= */

.test-page {
    max-width: 1000px;
}


.test-header {
    background: white;
    padding: 25px;
    border-radius: 14px;
    margin-bottom: 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}


.test-header h1 {
    color: #172554;
    font-size: 27px;
}


.timer-box {
    min-width: 150px;
    text-align: center;
    background: #eff6ff;
    padding: 13px 18px;
    border-radius: 10px;
    border: 1px solid #bfdbfe;
}


.timer-box span {
    display: block;
    font-size: 12px;
    color: #475569;
    margin-bottom: 4px;
}


.timer-box strong {
    font-size: 25px;
    color: #1d4ed8;
}


.timer-danger {
    color: #dc2626 !important;
}


.question-progress {
    background: white;
    padding: 18px 22px;
    border-radius: 12px;
    margin-bottom: 20px;

    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.06);
}


.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    margin-top: 12px;
    overflow: hidden;
}


.progress-fill {
    height: 100%;
    background: #2563eb;
    border-radius: 10px;
    transition: width 0.3s;
}


.single-question-card {
    background: white;
    padding: 35px;
    border-radius: 14px;

    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);

    margin-bottom: 20px;
}


.question-label {
    display: inline-block;

    background: #dbeafe;
    color: #1d4ed8;

    padding: 7px 12px;

    border-radius: 20px;

    font-size: 12px;
    font-weight: 800;

    margin-bottom: 18px;
}


.student-question {
    font-size: 21px;
    line-height: 1.6;
    color: #172554;
    margin-bottom: 28px;
}


.student-options {
    display: grid;
    gap: 13px;
}


.student-option {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 16px;

    border: 2px solid #e2e8f0;
    border-radius: 10px;

    cursor: pointer;

    transition: 0.2s;
}


.student-option:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}


.student-option input {
    width: auto;
    accent-color: #2563eb;
}


.student-option:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
}


.option-letter {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #e2e8f0;
    color: #334155;

    font-weight: 800;
}


.option-text {
    font-size: 16px;
    line-height: 1.5;
}


.question-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}


.test-note {
    padding: 15px 18px;
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.6;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #64748b;
}


.empty-icon {
    font-size: 45px;
    margin-bottom: 12px;
}


.empty-state h3 {
    color: #334155;
    margin-bottom: 8px;
}


/* =========================================================
   PUBLISH
   ========================================================= */

.publish-card {
    border-left: 5px solid #2563eb;
}


.publish-card h2 {
    color: #172554;
    margin-bottom: 10px;
}


.publish-card p {
    color: #64748b;
    margin-bottom: 18px;
    line-height: 1.6;
}


/* =========================================================
   LOGIN
   ========================================================= */

.login-page {
    min-height: calc(100vh - 140px);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 40px 20px;
}


.login-card {
    width: min(450px, 100%);

    background: white;

    padding: 40px;

    border-radius: 18px;

    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.12);

    border: 1px solid #e5e7eb;
}


.login-card h1 {
    text-align: center;
    color: #172554;
    margin-bottom: 8px;
}


.login-card h2 {
    text-align: center;
    font-size: 18px;
    color: #2563eb;
    margin-bottom: 8px;
}


.login-subtitle {
    text-align: center;
    color: #64748b;
    margin-bottom: 28px;
}


.full-width {
    width: 100%;
}


.demo-login {
    margin-top: 25px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.7;
}


.demo-login strong {
    color: #172554;
}


.demo-login p {
    color: #64748b;
    margin-bottom: 10px;
}


/* =========================================================
   FOOTER
   ========================================================= */

footer {
    text-align: center;
    padding: 25px;
    color: #64748b;
    font-size: 13px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 800px) {

    .navbar {
        padding: 15px 20px;
        flex-direction: column;
        gap: 12px;
    }


    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }


    .form-grid {
        grid-template-columns: 1fr;
    }


    .form-group-full {
        grid-column: auto;
    }


    .options-grid {
        grid-template-columns: 1fr;
    }


    .stats-grid {
        grid-template-columns: 1fr;
    }


    .test-header {
        flex-direction: column;
        align-items: stretch;
    }


    .timer-box {
        width: 100%;
    }


    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }


    .single-question-card {
        padding: 22px;
    }


    .student-question {
        font-size: 18px;
    }


    .question-navigation {
        gap: 10px;
    }

}


@media (max-width: 500px) {

    .container {
        width: 94%;
    }


    .card {
        padding: 20px;
    }


    .login-card {
        padding: 25px;
    }


    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }


    .action-buttons .btn {
        width: 100%;
    }

}