/* =========================================================
   REPORTS.CSS
   Student Performance Analytics Portal
   Reports Page
   ========================================================= */


/* =========================================================
   1. REPORTS PAGE FOUNDATION
   ========================================================= */

#main-content {
    width: 100%;
}

#main-content>section,
#main-content>header {
    width: min(1200px, 92%);
    margin-left: auto;
    margin-right: auto;
}


/* =========================================================
   2. REPORT PAGE HEADER
   ========================================================= */

#main-content>.dashboard-header {
    margin-top: 35px;
    margin-bottom: 30px;
    padding: 45px 30px;

    text-align: center;

    border-radius: 22px;

    background:
        linear-gradient(135deg,
            rgba(49, 46, 129, 0.96),
            rgba(67, 56, 202, 0.90));

    color: #ffffff;

    box-shadow:
        0 15px 40px rgba(49, 46, 129, 0.20);

    position: relative;
    overflow: hidden;
}

#main-content>.dashboard-header::before {
    content: "";
    position: absolute;

    width: 220px;
    height: 220px;

    top: -100px;
    right: -80px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.08);

    pointer-events: none;
}

#main-content>.dashboard-header::after {
    content: "";
    position: absolute;

    width: 180px;
    height: 180px;

    bottom: -100px;
    left: -70px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.06);

    pointer-events: none;
}

#main-content>.dashboard-header h1,
#main-content>.dashboard-header h2 {
    position: relative;
    z-index: 1;

    margin: 0 0 10px;

    text-align: center;
}

#main-content>.dashboard-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
}

#main-content>.dashboard-header h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

#main-content>.dashboard-header p {
    position: relative;
    z-index: 1;

    margin: 0 auto;

    max-width: 750px;

    text-align: center;

    color: rgba(255, 255, 255, 0.90);

    font-size: 1rem;
    line-height: 1.7;
}


/* =========================================================
   3. REPORT SUMMARY CARDS
   ========================================================= */

#reportSummary {
    margin-bottom: 35px;

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 20px;
}

#reportSummary .card {
    min-height: 145px;

    padding: 25px;

    text-align: center;

    border-radius: 18px;

    background: var(--card-bg, #ffffff);

    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.07);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

#reportSummary .card:hover {
    transform: translateY(-5px);

    box-shadow:
        0 16px 35px rgba(0, 0, 0, 0.11);
}

#reportSummary .card h2 {
    margin: 0 0 8px;

    font-size: 2rem;

    font-weight: 700;

    color: #312e81;
}

#reportSummary .card p {
    margin: 0;

    color: var(--text-secondary, #64748b);

    font-size: 0.95rem;
}


/* =========================================================
   4. SEARCH & FILTER SECTION
   ========================================================= */

#reportFilters {
    margin-bottom: 30px;

    padding: 28px;

    border-radius: 20px;

    background: var(--card-bg, #ffffff);

    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.06);
}

#reportFilters h2 {
    margin: 0 0 22px;

    font-size: 1.35rem;

    text-align: center;

    color: var(--heading-color, #1e293b);
}

.filter-container {
    display: grid;

    grid-template-columns:
        minmax(220px, 1.5fr) repeat(3, minmax(150px, 1fr)) auto;

    gap: 14px;

    align-items: center;
}

.search-box {
    width: 100%;
}

.search-box input,
.filter-container select {
    width: 100%;

    min-height: 46px;

    padding: 11px 14px;

    border-radius: 10px;

    border: 1px solid var(--border-color, #d1d5db);

    background: var(--input-bg, #ffffff);

    color: var(--text-color, #1e293b);

    font-family: inherit;

    font-size: 0.92rem;

    outline: none;

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.search-box input:focus,
.filter-container select:focus {
    border-color: #312e81;

    box-shadow:
        0 0 0 3px rgba(49, 46, 129, 0.12);
}

#resetFilters {
    min-height: 46px;

    white-space: nowrap;
}


/* =========================================================
   5. EXPORT SECTION
   ========================================================= */

#reportExports {
    margin-bottom: 30px;

    display: flex;

    justify-content: center;

    align-items: center;
}

.export-buttons {
    width: 100%;

    display: flex;

    justify-content: center;

    align-items: center;

    flex-wrap: wrap;

    gap: 14px;
}

.export-buttons .btn {
    min-width: 150px;
}


/* =========================================================
   6. REPORT TABLE SECTION
   ========================================================= */

#reportTableSection {
    margin-bottom: 35px;

    padding: 28px;

    border-radius: 20px;

    background: var(--card-bg, #ffffff);

    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.06);
}

#reportTableSection>h2 {
    margin: 0 0 22px;

    text-align: center;

    font-size: 1.5rem;

    color: var(--heading-color, #1e293b);
}

.table-wrapper {
    width: 100%;

    overflow-x: auto;

    border-radius: 14px;
}

#studentTable {
    width: 100%;

    min-width: 760px;

    border-collapse: collapse;

    overflow: hidden;
}

#studentTable caption {
    caption-side: top;

    padding: 0 0 15px;

    text-align: left;

    color: var(--text-secondary, #64748b);

    font-size: 0.9rem;
}

#studentTable thead {
    background: #312e81;

    color: #ffffff;
}

#studentTable th {
    padding: 15px 14px;

    text-align: left;

    font-size: 0.9rem;

    font-weight: 600;

    white-space: nowrap;
}

#studentTable td {
    padding: 14px;

    border-bottom:
        1px solid var(--border-color, #e5e7eb);

    color: var(--text-color, #334155);

    font-size: 0.9rem;
}

#studentTable tbody tr {
    transition:
        background 0.2s ease;
}

#studentTable tbody tr:hover {
    background:
        rgba(49, 46, 129, 0.05);
}

#studentTable tbody tr:last-child td {
    border-bottom: none;
}


/* =========================================================
   7. STATUS BADGES
   ========================================================= */

.status {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 90px;

    padding: 6px 12px;

    border-radius: 999px;

    font-size: 0.78rem;

    font-weight: 600;

    white-space: nowrap;
}

.status.excellent {
    color: #166534;

    background: #dcfce7;

    border: 1px solid #bbf7d0;
}

.status.good {
    color: #1d4ed8;

    background: #dbeafe;

    border: 1px solid #bfdbfe;
}


/* =========================================================
   8. PAGINATION
   ========================================================= */

.pagination {
    width: min(1200px, 92%);

    margin: 25px auto 40px;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 18px;
}

.pagination .btn {
    min-width: 110px;
}

#pageInfo {
    min-width: 90px;

    text-align: center;

    font-size: 0.95rem;

    font-weight: 600;

    color: var(--text-color, #334155);
}


/* =========================================================
   9. ANALYTICS TOOLBAR
   ========================================================= */

#analyticsToolbar {
    width: min(1200px, 92%);

    margin: 0 auto 30px;

    padding: 18px 20px;

    display: flex;

    justify-content: flex-end;

    align-items: center;

    flex-wrap: wrap;

    gap: 12px;

    border-radius: 16px;

    background: var(--card-bg, #ffffff);

    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.05);
}

#analyticsToolbar select {
    min-height: 42px;

    padding: 9px 13px;

    border-radius: 9px;

    border: 1px solid var(--border-color, #d1d5db);

    background: var(--input-bg, #ffffff);

    color: var(--text-color, #1e293b);

    font-family: inherit;

    outline: none;
}

#analyticsToolbar select:focus {
    border-color: #312e81;

    box-shadow:
        0 0 0 3px rgba(49, 46, 129, 0.12);
}


/* =========================================================
   10. ANALYTICS SECTION
   ========================================================= */

.analytics-section {
    width: min(1200px, 92%);

    margin: 0 auto 40px;
}

.analytics-section>.dashboard-header {
    width: 100%;

    margin-bottom: 25px;

    padding: 35px 25px;

    text-align: center;

    border-radius: 20px;

    background:
        linear-gradient(135deg,
            rgba(49, 46, 129, 0.95),
            rgba(67, 56, 202, 0.88));

    color: #ffffff;
}

.analytics-section>.dashboard-header h2 {
    margin: 0 0 8px;

    text-align: center;
}

.analytics-section>.dashboard-header p {
    margin: 0;

    text-align: center;

    color: rgba(255, 255, 255, 0.88);
}


/* =========================================================
   11. CHART GRID
   ========================================================= */

.chart-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 22px;
}

.chart-grid .card {
    min-height: 330px;

    padding: 24px;

    border-radius: 18px;

    background: var(--card-bg, #ffffff);

    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.06);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.chart-grid .card:hover {
    transform: translateY(-4px);

    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.10);
}

.chart-grid .card h3 {
    margin: 0 0 20px;

    text-align: center;

    color: var(--heading-color, #1e293b);

    font-size: 1.05rem;
}

.chart-grid .card canvas {
    display: block;

    width: 100% !important;

    max-height: 260px;
}


/* =========================================================
   12. RECENT ACTIVITY
   ========================================================= */

.activity-section {
    width: 100%;
}

.activity-section>h2 {
    margin: 0 0 22px;

    text-align: center;

    font-size: 1.45rem;

    color: var(--heading-color, #1e293b);
}

.activity-list {
    display: flex;

    flex-direction: column;

    gap: 14px;
}

.activity-item {
    display: flex;

    align-items: flex-start;

    gap: 15px;

    padding: 18px;

    border-radius: 14px;

    background:
        var(--surface-bg, #f8fafc);

    border: 1px solid var(--border-color, #e5e7eb);

    transition:
        transform 0.25s ease,
        border-color 0.25s ease;
}

.activity-item:hover {
    transform: translateX(4px);

    border-color: rgba(49, 46, 129, 0.35);
}

.activity-icon {
    width: 45px;
    height: 45px;

    flex-shrink: 0;

    display: flex;

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

    border-radius: 12px;

    background:
        rgba(49, 46, 129, 0.10);

    font-size: 1.25rem;
}

.activity-content {
    flex: 1;
}

.activity-content h4 {
    margin: 0 0 5px;

    color: var(--heading-color, #1e293b);

    font-size: 0.98rem;
}

.activity-content p {
    margin: 0 0 5px;

    color: var(--text-secondary, #64748b);

    font-size: 0.88rem;

    line-height: 1.6;
}

.activity-content small {
    color: #94a3b8;

    font-size: 0.76rem;
}


/* =========================================================
   13. NOTIFICATION PANEL
   ========================================================= */

.notification-panel {
    position: fixed;

    top: 80px;

    right: 20px;

    width: min(380px, calc(100vw - 40px));

    max-height: 70vh;

    display: flex;

    flex-direction: column;

    background: var(--card-bg, #ffffff);

    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.10));

    border-radius: 16px;

    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.18);

    overflow: hidden;

    z-index: 9999;

    opacity: 0;

    visibility: hidden;

    transform: translateY(-12px);

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease;
}

.notification-panel.active,
.notification-panel.show {
    opacity: 1;

    visibility: visible;

    transform: translateY(0);
}

.notification-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    padding: 17px 18px;

    background: #312e81;

    color: #ffffff;
}

.notification-header h3 {
    margin: 0;

    font-size: 1rem;
}

.notification-header button {
    width: 32px;
    height: 32px;

    border: none;

    border-radius: 8px;

    background: rgba(255, 255, 255, 0.12);

    color: #ffffff;

    cursor: pointer;

    font-size: 1rem;

    transition:
        background 0.2s ease;
}

.notification-header button:hover {
    background: rgba(255, 255, 255, 0.22);
}

.notification-search {
    margin: 14px;

    padding: 10px 12px;

    border-radius: 9px;

    border: 1px solid var(--border-color, #d1d5db);

    background: var(--input-bg, #ffffff);

    color: var(--text-color, #1e293b);

    font-family: inherit;

    outline: none;
}

.notification-search:focus {
    border-color: #312e81;

    box-shadow:
        0 0 0 3px rgba(49, 46, 129, 0.10);
}

#notificationList {
    padding: 0 14px 14px;

    overflow-y: auto;
}

.notification-item {
    padding: 14px;

    margin-bottom: 10px;

    border-radius: 11px;

    background:
        var(--surface-bg, #f8fafc);

    border: 1px solid var(--border-color, #e5e7eb);
}

.notification-item:last-child {
    margin-bottom: 0;
}


/* =========================================================
   14. DARK MODE
   ========================================================= */

[data-theme="dark"] #reportSummary .card,
[data-theme="dark"] #reportFilters,
[data-theme="dark"] #reportTableSection,
[data-theme="dark"] #analyticsToolbar,
[data-theme="dark"] .chart-grid .card {
    background: #111827;

    border-color: rgba(255, 255, 255, 0.08);

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.30);
}

[data-theme="dark"] #reportSummary .card h2 {
    color: #a5b4fc;
}

[data-theme="dark"] #reportFilters h2,
[data-theme="dark"] #reportTableSection>h2,
[data-theme="dark"] .chart-grid .card h3,
[data-theme="dark"] .activity-section>h2 {
    color: #f8fafc;
}

[data-theme="dark"] #reportFilters,
[data-theme="dark"] #reportTableSection,
[data-theme="dark"] #analyticsToolbar {
    color: #e5e7eb;
}

[data-theme="dark"] .search-box input,
[data-theme="dark"] .filter-container select,
[data-theme="dark"] #analyticsToolbar select,
[data-theme="dark"] .notification-search {
    background: #0f172a;

    color: #f8fafc;

    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .search-box input::placeholder,
[data-theme="dark"] .notification-search::placeholder {
    color: #94a3b8;
}

[data-theme="dark"] #studentTable td {
    color: #e2e8f0;

    border-color:
        rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] #studentTable tbody tr:hover {
    background:
        rgba(99, 102, 241, 0.10);
}

[data-theme="dark"] .activity-item {
    background: #0f172a;

    border-color:
        rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .activity-content h4 {
    color: #f8fafc;
}

[data-theme="dark"] .activity-content p {
    color: #94a3b8;
}

[data-theme="dark"] .activity-icon {
    background:
        rgba(129, 140, 248, 0.12);
}

[data-theme="dark"] .notification-panel {
    background: #111827;

    border-color:
        rgba(255, 255, 255, 0.10);

    box-shadow:
        0 20px 55px rgba(0, 0, 0, 0.50);
}

[data-theme="dark"] .notification-item {
    background: #0f172a;

    border-color:
        rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] #pageInfo {
    color: #e2e8f0;
}


/* =========================================================
   15. PRINT STYLES
   ========================================================= */

@media print {

    .site-header,
    .notification-panel,
    #reportFilters,
    #reportExports,
    #analyticsToolbar,
    .pagination,
    .site-footer {
        display: none !important;
    }

    #main-content {
        width: 100%;
    }

    #main-content>section,
    #main-content>header,
    .analytics-section {
        width: 100%;

        margin: 0 0 20px;

        box-shadow: none;

        border: none;
    }

    #main-content>.dashboard-header,
    .analytics-section>.dashboard-header {
        color: #000000;

        background: none;

        padding: 20px 0;
    }

    #main-content>.dashboard-header h1,
    #main-content>.dashboard-header h2,
    #main-content>.dashboard-header p {
        color: #000000;
    }

    #reportSummary {
        grid-template-columns:
            repeat(4, 1fr);
    }

    .chart-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .chart-grid .card {
        break-inside: avoid;

        box-shadow: none;
    }

    #studentTable {
        min-width: 0;
    }
}


/* =========================================================
   16. LARGE TABLET
   ========================================================= */

@media (max-width: 1100px) {

    #reportSummary {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .filter-container {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .filter-container .search-box {
        grid-column: 1 / -1;
    }

    #resetFilters {
        width: 100%;
    }

    .chart-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   17. TABLET
   ========================================================= */

@media (max-width: 768px) {

    #main-content>.dashboard-header {
        margin-top: 25px;

        padding: 35px 20px;

        border-radius: 18px;
    }

    #main-content>.dashboard-header h1 {
        font-size: 1.75rem;
    }

    #main-content>.dashboard-header p {
        font-size: 0.9rem;
    }

    #reportSummary {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 15px;
    }

    #reportSummary .card {
        min-height: 125px;

        padding: 20px;
    }

    #reportSummary .card h2 {
        font-size: 1.7rem;
    }

    #reportFilters,
    #reportTableSection {
        padding: 20px;
    }

    .filter-container {
        grid-template-columns:
            1fr;
    }

    .filter-container .search-box {
        grid-column: auto;
    }

    .export-buttons {
        flex-direction: column;
    }

    .export-buttons .btn {
        width: 100%;

        max-width: 300px;
    }

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

    .chart-grid .card {
        min-height: 300px;
    }

    #analyticsToolbar {
        justify-content: center;
    }

    .activity-item {
        padding: 15px;
    }
}


/* =========================================================
   18. MOBILE
   ========================================================= */

@media (max-width: 576px) {

    #main-content>section,
    #main-content>header {
        width: 94%;
    }

    #main-content>.dashboard-header {
        margin-top: 20px;

        padding: 30px 16px;

        border-radius: 16px;
    }

    #main-content>.dashboard-header h1 {
        font-size: 1.45rem;
    }

    #main-content>.dashboard-header p {
        font-size: 0.82rem;

        line-height: 1.6;
    }

    #reportSummary {
        grid-template-columns: 1fr;

        gap: 12px;
    }

    #reportSummary .card {
        min-height: auto;

        padding: 18px;
    }

    #reportSummary .card h2 {
        font-size: 1.55rem;
    }

    #reportFilters,
    #reportTableSection {
        padding: 16px;

        border-radius: 15px;
    }

    #reportFilters h2,
    #reportTableSection>h2 {
        font-size: 1.2rem;
    }

    .pagination {
        width: 94%;

        gap: 10px;
    }

    .pagination .btn {
        min-width: 90px;

        padding: 9px 12px;
    }

    #pageInfo {
        min-width: 70px;

        font-size: 0.85rem;
    }

    #analyticsToolbar {
        width: 94%;

        flex-direction: column;

        align-items: stretch;
    }

    #analyticsToolbar select,
    #analyticsToolbar .btn {
        width: 100%;
    }

    .analytics-section {
        width: 94%;
    }

    .analytics-section>.dashboard-header {
        padding: 28px 16px;

        border-radius: 16px;
    }

    .analytics-section>.dashboard-header h2 {
        font-size: 1.35rem;
    }

    .chart-grid {
        gap: 15px;
    }

    .chart-grid .card {
        min-height: 270px;

        padding: 16px;
    }

    .chart-grid .card canvas {
        max-height: 220px;
    }

    .activity-item {
        gap: 10px;

        padding: 13px;
    }

    .activity-icon {
        width: 38px;
        height: 38px;

        font-size: 1rem;
    }

    .activity-content h4 {
        font-size: 0.9rem;
    }

    .activity-content p {
        font-size: 0.8rem;
    }

    .notification-panel {
        top: 70px;

        right: 10px;

        width: calc(100vw - 20px);
    }
}


/* =========================================================
   19. VERY SMALL DEVICES
   ========================================================= */

@media (max-width: 380px) {

    #main-content>.dashboard-header h1 {
        font-size: 1.3rem;
    }

    #reportSummary .card h2 {
        font-size: 1.4rem;
    }

    #studentTable th,
    #studentTable td {
        padding: 10px;

        font-size: 0.8rem;
    }

    .status {
        min-width: 75px;

        padding: 5px 8px;

        font-size: 0.7rem;
    }
}


/* =========================================================
   END OF REPORTS.CSS
   ========================================================= */