
/* =========================================================
   REPORT CARD PAGE
========================================================= */

#report {
    min-width: 0;
    color: #2A2430;
}

#report .report-card-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    color: #2A2430;
}

#report .report-card-header {
    margin-bottom: 28px;
}

#report .report-card-overline,
#report .report-eyebrow {
    display: inline-block;
    color: #8B35E8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.8px;
    text-transform: uppercase;
}

#report .report-card-header h1 {
    margin: 8px 0 10px;
    color: #17121F;
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 800;
    letter-spacing: -1px;
}

#report .report-card-header > p {
    max-width: 650px;
    margin: 0;
    color: #77717E;
    font-size: 14px;
    line-height: 1.7;
}

/* =========================================================
   STUDY SPACE SELECTOR
========================================================= */

#report #reportCardRoomSelector {
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: 100%;
    max-width: 440px;
    margin-bottom: 24px;
}

#report #reportCardRoomSelector label {
    color: #2A2430;
    font-size: 13px;
    font-weight: 700;
}

#report #reportCardRoom {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #E4DFE8;
    border-radius: 12px;
    outline: none;
    background: #FFFFFF;
    color: #27202C;
    font: inherit;
    font-size: 14px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

#report #reportCardRoom:hover:not(:disabled) {
    border-color: #CBB2E5;
}

#report #reportCardRoom option {
    background: #FFFFFF;
    color: #27202C;
}

#report #reportCardRoom optgroup {
    background: #FFFFFF;
    color: #7130B5;
    font-weight: 700;
}

#report #reportCardRoom:disabled {
    background: #F5F0F8;
    color: #938B98;
    cursor: not-allowed;
}

#report #reportCardRoom:focus {
    border-color: #8B35E8;
    box-shadow: 0 0 0 3px rgba(139, 53, 232, 0.12);
}

#report #reportCardRoom:focus-visible {
    outline: 2px solid #8B35E8;
    outline-offset: 3px;
}

#report #reportCardFeedback {
    min-height: 18px;
    margin-top: 12px;
    color: #77717E;
    font-size: 12px;
    line-height: 1.6;
}

/* =========================================================
   GENERATE REPORT SECTION
========================================================= */

#report .report-generate-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
}

#report .report-generate-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 22px;
    border: 1px solid #8B35E8;
    border-radius: 12px;
    background: linear-gradient(135deg, #8B35E8, #7130C7);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(139, 53, 232, 0.16);
    transition:
        background 0.2s ease,
        transform 0.2s ease,
        opacity 0.2s ease,
        box-shadow 0.2s ease;
}

#report .report-generate-button span {
    color: inherit;
}

#report .report-generate-button svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    color: #FFFFFF;
}

#report .report-generate-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #9B4CF0, #8138D9);
    color: #FFFFFF;
    box-shadow: 0 8px 22px rgba(139, 53, 232, 0.24);
    transform: translateY(-1px);
}

#report .report-generate-button:focus-visible {
    outline: 3px solid #D8B8FF;
    outline-offset: 3px;
}

#report .report-generate-button:disabled {
    border-color: #D8C9E5;
    background: #EAE2F0;
    color: #938B98;
    opacity: 1;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#report .report-generate-button:disabled svg {
    color: #938B98;
}

#report .report-generate-button .report-spinner {
    width: 17px;
    height: 17px;
    margin: 0;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: reportSpin 0.8s linear infinite;
}

#report .report-generate-hint {
    margin: 0;
    color: #938B98;
    font-size: 12px;
    line-height: 1.6;
}

/* =========================================================
   MAIN REPORT CARD
========================================================= */

#report .student-report-card {
    overflow: hidden;
    width: 100%;
    border: 1px solid #E6DCED;
    border-radius: 20px;
    background: #FFFFFF;
    color: #2A2430;
    box-shadow: 0 12px 32px rgba(42, 20, 65, 0.07);
}

/* Report banner */

#report .student-report-banner {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 26px;
    border-bottom: 1px solid #E6DCED;
    background:
        radial-gradient(
            circle at top right,
            rgba(155, 76, 240, 0.09),
            transparent 42%
        ),
        #F8F4FC;
    color: #2A2430;
}

#report .report-banner-icon {
    display: flex;
    flex: 0 0 54px;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border: 1px solid #E4D3F5;
    border-radius: 16px;
    background: #EEE3FA;
    color: #8138D9;
}

#report .report-banner-icon svg {
    width: 26px;
    height: 26px;
    color: inherit;
}

#report .report-banner-copy {
    flex: 1;
    min-width: 0;
}

#report .report-banner-copy h2 {
    margin: 7px 0 5px;
    color: #17121F;
    font-size: clamp(19px, 3vw, 25px);
    font-weight: 800;
    overflow-wrap: anywhere;
}

#report .report-banner-copy p {
    margin: 0;
    color: #77717E;
    font-size: 13px;
    line-height: 1.6;
}

/* Report status */

#report .report-status {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #DCC6F2;
    border-radius: 999px;
    background: #F3EAFA;
    color: #7130B5;
    font-size: 11px;
    font-weight: 700;
}

#report .report-status.is-final {
    border-color: #B8E2CA;
    background: #EAF8EF;
    color: #247346;
}

#report .report-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

/* =========================================================
   STUDENT INFORMATION
========================================================= */

#report .report-student-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    padding: 24px 26px;
    border-bottom: 1px solid #EBE6EF;
    background: #FFFFFF;
    color: #2A2430;
}

#report .report-student-details > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

#report .report-detail-label {
    color: #938B98;
    font-size: 12px;
    font-weight: 600;
}

#report .report-student-details strong {
    color: #27202C;
    font-size: 15px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

/* =========================================================
   GRADE AND PERCENTAGE
========================================================= */

#report .report-grade-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin: 24px;
    padding: clamp(22px, 4vw, 34px);
    border: 1px solid #E4D3F5;
    border-radius: 17px;
    background:
        radial-gradient(
            circle at 0% 0%,
            rgba(139, 53, 232, 0.09),
            transparent 48%
        ),
        #F8F4FC;
    color: #2A2430;
}

#report .report-grade-copy {
    min-width: 0;
}

#report .report-grade-copy h3 {
    margin: 12px 0 8px;
    color: #8138D9;
    font-size: clamp(52px, 8vw, 76px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -2px;
    overflow-wrap: anywhere;
}

#report .report-grade-copy p {
    max-width: 430px;
    margin: 0;
    color: #77717E;
    font-size: 13px;
    line-height: 1.7;
}

#report .report-percentage {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
}

#report .report-percentage strong {
    color: #17121F;
    font-size: clamp(25px, 4vw, 38px);
    font-weight: 800;
    letter-spacing: -1px;
    white-space: nowrap;
}

#report .report-percentage span {
    color: #938B98;
    font-size: 12px;
    text-align: right;
}

/* =========================================================
   REPORT FOOTER
========================================================= */

#report .report-card-footer {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 0 26px 25px;
    color: #77717E;
}

#report .report-card-footer svg {
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    margin-top: 2px;
    color: #8B35E8;
}

#report .report-card-footer p {
    margin: 0;
    color: inherit;
    font-size: 12px;
    line-height: 1.7;
}

/* =========================================================
   EMPTY AND LOADING STATES
========================================================= */

#report .report-empty-state,
#report .report-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 230px;
    padding: 30px;
    border: 1px dashed #DCCFE7;
    border-radius: 18px;
    background: #FFFFFF;
    color: #2A2430;
    text-align: center;
}

#report .report-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
    border: 1px solid #E4D3F5;
    border-radius: 16px;
    background: #F3EAFA;
    color: #8138D9;
}

#report .report-empty-icon svg {
    width: 25px;
    height: 25px;
    color: inherit;
}

#report .report-empty-state h3,
#report .report-message h3 {
    margin: 0 0 8px;
    color: #17121F;
    font-size: 17px;
    font-weight: 700;
}

#report .report-empty-state p,
#report .report-message p,
#report .report-loading-state p {
    max-width: 480px;
    margin: 0;
    color: #77717E;
    font-size: 13px;
    line-height: 1.7;
}

#report .report-loading-state p {
    color: #77717E;
}

#report .report-spinner {
    width: 32px;
    height: 32px;
    margin-bottom: 15px;
    border: 3px solid #E6DCED;
    border-top-color: #8B35E8;
    border-radius: 50%;
    animation: reportSpin 0.8s linear infinite;
}

@keyframes reportSpin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================
   ERROR STATE
========================================================= */

#report .report-message {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 22px;
    border: 1px solid #F0CACA;
    border-radius: 15px;
    background: #FFF6F6;
    color: #2A2430;
}

#report .report-message > svg {
    flex: 0 0 22px;
    color: #C53B48;
}

#report .report-message h3 {
    color: #9F2633;
}

#report .report-message p {
    color: #79545A;
}

#report .report-message button {
    margin-top: 15px;
    padding: 10px 14px;
    border: 1px solid #DCC6F2;
    border-radius: 9px;
    background: #F3EAFA;
    color: #7130B5;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

#report .report-message button:hover {
    border-color: #C9A8EB;
    background: #E8D8F8;
    color: #57228F;
}

#report .report-message button:focus-visible {
    outline: 3px solid #D8B8FF;
    outline-offset: 3px;
}

/* =========================================================
   RESPONSIVE LAYOUT
========================================================= */

@media (max-width: 700px) {
    #report .report-card-page {
        padding: 20px 14px;
    }

    #report .student-report-banner {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 20px;
    }

    #report .report-status {
        margin-left: 72px;
    }

    #report .report-student-details {
        gap: 18px;
        padding: 20px;
    }

    #report .report-grade-panel {
        align-items: flex-start;
        flex-direction: column;
        gap: 24px;
        margin: 14px;
        padding: 22px;
    }

    #report .report-percentage {
        align-items: flex-start;
    }

    #report .report-percentage span {
        text-align: left;
    }

    #report .report-card-footer {
        padding: 0 20px 22px;
    }
}

@media (max-width: 420px) {
    #report .report-student-details {
        grid-template-columns: 1fr;
    }

    #report .report-status {
        margin-left: 0;
    }

    #report .report-generate-section {
        align-items: stretch;
    }

    #report .report-generate-button {
        width: 100%;
    }
}

/* =========================================================
   ACCESSIBILITY AND REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
    #report .report-spinner {
        animation: none;
    }

    #report .report-generate-button,
    #report .report-message button {
        transition: none;
    }

    #report .report-generate-button .report-spinner {
        animation: none;
    }
}
