/* =========================================================
   STUDENT CSS
   Student pages:
   - My School
   - Assignments
   - Assignment Questions
   - Quizzes
========================================================= */


/* =========================================================
   MY SCHOOL
========================================================= */

.school-page {
    max-width: 1000px;
    margin: 0 auto;
}

.school-page-header {
    background: linear-gradient(135deg, #eff6ff, #ffffff);
    border: 1px solid #dbeafe;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
}

.school-page-header h1 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 28px;
}

.school-page-header p {
    margin: 0;
    color: #64748b;
    font-size: 15px;
}

.school-message {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
}

.school-message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.school-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.join-school-box,
.school-card {
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .06);
}

.join-school-header,
.school-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.join-school-icon,
.school-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 29px;
    flex-shrink: 0;
}

.join-school-icon {
    background: #dbeafe;
}

.school-icon {
    background: #eff6ff;
}

.join-school-header h2,
.school-card-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 21px;
}

.join-school-header p,
.school-card-header p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 14px;
}

.school-code-form {
    display: flex;
    gap: 12px;
}

.school-code-input {
    flex: 1;
    padding: 15px 17px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    outline: none;
}

.school-code-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.join-school-button {
    padding: 15px 23px;
    border: 0;
    border-radius: 12px;
    background: #2563eb;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.join-school-button:hover,
.take-quiz-button:hover {
    opacity: .9;
}

.school-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.school-info-item {
    background: #f8fafc;
    border-radius: 13px;
    padding: 18px;
}

.school-info-item span {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    color: #64748b;
}

.school-info-item strong {
    display: block;
    font-size: 16px;
    color: #0f172a;
}

.school-code {
    font-size: 20px !important;
    letter-spacing: 2px;
    color: #2563eb !important;
}

.no-school,
.not-connected {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 14px;
    padding: 20px;
    color: #9a3412;
}

.no-school strong {
    display: block;
    margin-bottom: 7px;
}

.class-notice {
    margin-top: 20px;
    padding: 17px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 13px;
    color: #166534;
    font-size: 14px;
}


/* =========================================================
   ASSIGNMENTS
========================================================= */

.page {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px 60px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 25px;
}

.page-header h1 {
    margin: 0;
    font-size: 30px;
}

.page-header p {
    margin: 7px 0 0;
    color: #6b7280;
}

.back-button,
.back {
    display: inline-block;
    padding: 11px 17px;
    background: #e5e7eb;
    color: #111827;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
}

.student-info {
    background: #fff;
    padding: 18px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .05);
}

.student-info strong {
    color: #111827;
}

.student-info span {
    color: #6b7280;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: #fff;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .05);
}

.stat-icon {
    font-size: 25px;
    margin-bottom: 8px;
}

.stat-number {
    display: block;
    font-size: 25px;
    font-weight: 800;
}

.stat-label {
    color: #6b7280;
    font-size: 13px;
}

.assignment-list {
    display: grid;
    gap: 18px;
}

.assignment-card {
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 14px;
    padding: 23px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .05);
}

.assignment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.assignment-title {
    margin: 0;
    font-size: 21px;
}

.subject-name {
    display: inline-block;
    margin-top: 7px;
    color: #2563eb;
    font-size: 14px;
    font-weight: 700;
}

.description {
    margin: 14px 0;
    color: #6b7280;
    line-height: 1.6;
    white-space: pre-wrap;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin: 15px 0;
    color: #6b7280;
    font-size: 13px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.due-date {
    font-weight: 700;
}

.due-date.normal {
    color: #2563eb;
}

.due-date.urgent {
    color: #d97706;
}

.due-date.overdue {
    color: #dc2626;
}

.status-badge {
    display: inline-block;
    padding: 6px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.status-pending {
    background: #eff6ff;
    color: #1d4ed8;
}

.status-submitted {
    background: #fef3c7;
    color: #92400e;
}

.status-graded {
    background: #dcfce7;
    color: #166534;
}

.status-late {
    background: #fee2e2;
    color: #991b1b;
}

.score-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f0fdf4;
    border-radius: 8px;
    color: #166534;
    font-weight: 800;
}

.assignment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding-top: 18px;
    border-top: 1px solid #eef0f4;
}

.action-button {
    display: inline-block;
    padding: 11px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
}

.start-button {
    background: #2563eb;
    color: #fff;
}

.start-button:hover {
    background: #1d4ed8;
}

.view-button {
    background: #e5e7eb;
    color: #111827;
}

.empty,
.no-quizzes {
    background: #fff;
    border-radius: 14px;
    padding: 50px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .05);
}

.empty-icon,
.no-quizzes-icon {
    font-size: 55px;
    margin-bottom: 15px;
}

.empty h2,
.no-quizzes h2 {
    margin: 0 0 8px;
}

.empty p,
.no-quizzes p {
    color: #6b7280;
}

.no-class {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    padding: 20px;
    border-radius: 12px;
}


/* =========================================================
   ASSIGNMENT QUESTIONS
========================================================= */

.header {
    background: #fff;
    border-radius: 14px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .05);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.header h1 {
    margin: 0;
    font-size: 28px;
}

.subject {
    display: inline-block;
    margin-top: 7px;
    color: #2563eb;
    font-weight: 700;
}

.header .description {
    margin-top: 18px;
    line-height: 1.7;
}

.header .meta {
    margin-top: 18px;
}

.status-box {
    padding: 15px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
}

.status-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.status-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.status-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.status-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.question-card {
    background: #fff;
    border-radius: 14px;
    padding: 25px;
    margin-bottom: 18px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .05);
}

.question-number {
    color: #2563eb;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.question-text {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 20px;
}

.marks {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 15px;
}

.options {
    display: grid;
    gap: 10px;
}

.option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    cursor: pointer;
    transition: .15s;
}

.option:hover {
    border-color: #2563eb;
    background: #f8fbff;
}

.option input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
}

.option-text {
    line-height: 1.5;
}

.theory-answer {
    width: 100%;
    min-height: 180px;
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    resize: vertical;
    font-family: inherit;
    font-size: 15px;
}

.theory-answer:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.submit-area {
    background: #fff;
    border-radius: 14px;
    padding: 25px;
    margin-top: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .05);
}

.submit-button {
    border: 0;
    background: #2563eb;
    color: #fff;
    padding: 14px 24px;
    border-radius: 9px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.submit-button:hover {
    background: #1d4ed8;
}

.submit-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.result-card {
    background: #fff;
    border-radius: 14px;
    padding: 30px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .05);
}

.result-score {
    font-size: 40px;
    font-weight: 900;
    color: #2563eb;
    margin: 20px 0;
}

.result-note {
    color: #6b7280;
    line-height: 1.6;
}

.teacher-comment {
    margin-top: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 9px;
    text-align: left;
}


/* =========================================================
   QUIZZES
========================================================= */

.quiz-page {
    max-width: 1200px;
    margin: 0 auto;
}

.quiz-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.quiz-page-header h1 {
    margin: 0;
    font-size: 30px;
    color: #0f172a;
}

.quiz-page-header p {
    margin: 8px 0 0;
    color: #64748b;
}

.quiz-count {
    background: #eff6ff;
    color: #2563eb;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.student-context {
    background: linear-gradient(135deg, #eff6ff, #fff);
    border: 1px solid #dbeafe;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    gap: 35px;
    flex-wrap: wrap;
}

.context-item span {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 5px;
}

.context-item strong {
    color: #0f172a;
    font-size: 16px;
}

.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

.quiz-card {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .06);
    transition: transform .2s ease, box-shadow .2s ease;
}

.quiz-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .10);
}

.quiz-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.quiz-subject {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quiz-subject-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.quiz-subject-name {
    font-size: 13px;
    font-weight: 700;
    color: #2563eb;
}

.difficulty {
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.difficulty.easy {
    background: #dcfce7;
    color: #166534;
}

.difficulty.medium {
    background: #fef3c7;
    color: #92400e;
}

.difficulty.hard {
    background: #fee2e2;
    color: #991b1b;
}

.quiz-card h2 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #0f172a;
}

.quiz-description {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    min-height: 45px;
}

.quiz-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.quiz-meta .meta-item {
    display: block;
    background: #f8fafc;
    border-radius: 10px;
    padding: 11px;
}

.quiz-meta .meta-item span {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 4px;
}

.quiz-meta .meta-item strong {
    font-size: 14px;
    color: #0f172a;
}

.quiz-rewards {
    display: flex;
    gap: 15px;
    margin-bottom: 18px;
    font-size: 13px;
    font-weight: 700;
}

.take-quiz-button {
    display: block;
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    background: #2563eb;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    transition: opacity .2s ease;
}

.not-connected {
    margin-bottom: 25px;
}

.no-quizzes {
    padding: 50px 25px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 800px) {

    .page-header {
        flex-direction: column;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .assignment-header {
        flex-direction: column;
    }

}

@media (max-width: 700px) {

    .school-info-grid {
        grid-template-columns: 1fr;
    }

    .school-code-form {
        flex-direction: column;
    }

    .join-school-button {
        width: 100%;
    }

    .school-page-header {
        padding: 22px;
    }

    .school-card,
    .join-school-box {
        padding: 22px;
    }

    .header-top,
    .quiz-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .back {
        width: 100%;
        text-align: center;
    }

    .page {
        margin-top: 15px;
    }

    .question-card,
    .header,
    .submit-area {
        padding: 20px;
    }

    .student-context {
        flex-direction: column;
        gap: 15px;
    }

}

@media (max-width: 500px) {

    .stats {
        grid-template-columns: 1fr;
    }

    .assignment-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .action-button {
        width: 100%;
        text-align: center;
    }

}