
/* =================================
   INDEX.PHP | ASSESSMENT TRACKER
   ================================= */

:root {
    --page-bg: #eef4fb;
    --header-bg: #b7cee3;
    --card-bg: #ffffff;
    --navy: #233b59;
    --text: #344256;
    --muted: #8795a8;
    --blue: #668fb8;
    --blue-light: #dce9f6;
    --purple: #8064b5;
    --pink: #d94c91;
    --border: #dbe5ef;
    --green-bg: #e0f3e6;
    --green-text: #32784c;
    --red-bg: #fbe4e8;
    --red-text: #b33c53;
    --orange-bg: #fff0dc;
    --orange-text: #a96a1e;
}

* {
    box-sizing: border-box;
}

body.assessments-body {
    margin: 0;
    min-height: 100vh;
    background: var(--page-bg);
    color: var(--text);
    font-family: "Commissioner", sans-serif;
}

/* HEADER */

.assessments-body header.bg-purple {
    background: var(--header-bg);
    width: 100%;
    padding: 0 5%;
    box-shadow: 0 2px 8px rgb(35 59 89 / 5%);
}

.assessments-body header a {
    color: var(--navy);
    text-decoration: none;
}

/* MAIN PAGE */

.assessments-main {
    width: min(1100px, 92%);
    margin: 42px auto 70px;
}

/* SEARCH */

.search-container {
    float: right;
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(280px, 42%);
    padding: 5px 14px;
    background: #e0ebf6;
    border: 1px solid #d4e2f0;
    border-radius: 999px;
}

.search-input {
    width: 100%;
    min-width: 0;
    padding: 9px 2px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--navy);
    font: inherit;
}

.search-input::placeholder {
    color: var(--muted);
}

.search-container button {
    display: grid;
    place-items: center;
    padding: 4px;
    color: #64788f;
    background: transparent;
    border: none;
    cursor: pointer;
}

.search-container button span {
    font-size: 23px;
}

/* SECTION TITLES */

.assessments-main h2 {
    margin: 0 0 24px;
    color: var(--navy);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 750;
    letter-spacing: -0.7px;
}

.assessments-main h2:not(:first-child) {
    margin-top: 42px;
}

#completed-assessments {
    clear: both;
    padding-top: 4px;
}

/* FILTERS */

.actions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
    clear: both;
}

.left-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.left-actions form {
    margin: 0;
}

.btn-sort {
    min-height: 38px;
    padding: 9px 15px;
    background: #fff;
    color: #56667b;
    border: 1px solid #d3e0ed;
    border-radius: 999px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
}

.btn-sort:hover,
.btn-sort:focus-visible {
    border-color: var(--blue);
    background: #f6faff;
    outline: none;
}

/* Hide the empty decorative column labels */

.columns-titles {
    display: none;
}

/* ASSESSMENT LIST */

.assessment-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.assessment-wrapper {
    min-width: 0;
}

.assessment-row-card {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 185px;
    align-items: center;
    gap: 16px;
    min-height: 132px;
    padding: 20px 22px;
    background: var(--card-bg);
    border: 1px solid #e5ebf2;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgb(35 59 89 / 4%);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.assessment-row-card:hover {
    box-shadow: 0 7px 20px rgb(35 59 89 / 8%);
    transform: translateY(-1px);
}

/* SUBJECT TAG */

.badge-subject {
    position: absolute;
    top: 18px;
    left: 80px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 43px;
    padding: 5px 9px;
    background: var(--blue);
    border-radius: 6px;
    color: white;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.5px;
}

.badge-subject p {
    margin: 0;
}

/* ASSESSMENT INFORMATION */

.assessment-content {
    grid-column: 2;
    min-width: 0;
    padding-top: 22px;
}

.card-title h3 {
    margin: 0 0 12px;
    color: #303b49;
    font-size: 16px;
    font-weight: 750;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.assessment-details {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.card-data-field {
    color: var(--muted);
    font-size: 11px;
}

.card-data-field p {
    margin: 0;
}

.card-data-field:not(:last-child) {
    padding-right: 8px;
    border-right: 1px solid var(--border);
}

.type-badge {
    color: #687d95;
}

/* DATE, PRIORITY AND SAVE FORM */

.due-date-priority {
    grid-column: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 13px;
    min-width: 0;
    margin: 0;
}

.due {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.due::before {
    content: "DUE DATE";
    color: var(--muted);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 1px;
}

.due input[type="date"] {
    width: 145px;
    max-width: 100%;
    padding: 5px 0;
    color: var(--purple);
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
}

.priority {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
}

.priority select {
    max-width: 120px;
    padding: 8px 12px;
    appearance: auto;
    background: var(--green-bg);
    border: none;
    border-radius: 999px;
    color: var(--green-text);
    font-family: inherit;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

.priority select:has(option[value="high"]:checked) {
    background: var(--red-bg);
    color: var(--red-text);
}

.priority select:has(option[value="medium"]:checked) {
    background: var(--orange-bg);
    color: var(--orange-text);
}

/* COMPLETION CHECKBOX */

.completed-checkbox {
    position: absolute;
    top: 50%;
    left: 22px;
    width: 19px;
    height: 19px;
    margin: 0;
    accent-color: var(--purple);
    cursor: pointer;
    transform: translateY(-50%);
}

/* SAVE BUTTON */

.priority button {
    display: grid;
    place-items: center;
    padding: 3px;
    color: #91abc7;
    background: transparent;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.priority button:hover {
    color: var(--purple);
    background: #f0ebfa;
}

.priority button span {
    font-size: 22px;
}

/* EMPTY SEARCH RESULTS */

.no-results {
    padding: 28px;
    color: var(--muted);
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    text-align: center;
}

/* COMPLETED ASSESSMENTS */

.completed-assessment-wrapper .assessment-row-card {
    background: #f9fbfd;
    box-shadow: none;
}

.completed-assessment-wrapper .badge-subject,
.completed-assessment-wrapper .due,
.completed-assessment-wrapper .priority {
    opacity: 0.58;
}

.completed-assessment-wrapper .card-title h3,
.completed-assessment-wrapper .card-data-field {
    color: #a0aaba;
}

.completed-assessment-wrapper .completed-checkbox {
    accent-color: var(--purple);
}

/* RESPONSIVE LAYOUT */

@media (max-width: 700px) {
    .assessments-main {
        width: 94%;
        margin-top: 28px;
    }

    .search-container {
        float: none;
        width: 100%;
        margin-bottom: 22px;
    }

    .assessments-main h2 {
        margin-bottom: 18px;
    }

    .left-actions {
        width: 100%;
    }

    .left-actions form {
        max-width: 100%;
    }

    .btn-sort {
        max-width: 100%;
        font-size: 10px;
    }

    .assessment-row-card {
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 10px;
        padding: 18px 14px;
    }

    .completed-checkbox {
        left: 15px;
        top: 24px;
        transform: none;
    }

    .badge-subject {
        left: 52px;
        top: 17px;
    }

    .assessment-content {
        grid-column: 2;
        padding-top: 24px;
    }

    .due-date-priority {
        grid-column: 2;
        align-items: flex-start;
        padding-top: 10px;
        border-top: 1px solid var(--border);
    }

    .due {
        align-items: flex-start;
    }

    .priority {
        justify-content: flex-start;
    }

    .card-title h3 {
        font-size: 14px;
    }
}
