/* This app's own styles. Colors/typography lean entirely on the CSS
   variables + .dark-mode toggling already defined by the main Quarks
   site's main.css (loaded by _layouts/default.html), so this stays
   in sync with the rest of the site automatically. */

/* Same "dek" style the club pages use under their hero header
   (normally injected by _includes/club-dek.html) */
.club-dek {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.45rem;
    line-height: 1.6;
    color: var(--text-color);
    max-width: 820px;
    margin: 1.35rem auto 2.5rem;
    text-align: center;
    padding: 0 1.25rem;
}
@media (max-width: 767px) { .club-dek { font-size: 1.2rem; } }

#login-panel,
#status,
#protected-content {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}


/* =========================
   PANELS
   ========================= */

.panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: var(--card-shadow);
    padding: 26px;
}


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

#login-panel {
    text-align: center;
    max-width: 540px;
    margin: 0 auto 30px;
}

/* Same solid-swap button treatment the rest of the site uses (e.g. the
   newsletter form's .btn-dark): dark-on-light in light mode, flips to
   light-on-dark automatically, instead of a flat link-blue fill that
   goes washed-out/low-contrast once --link-color turns pale in dark mode. */
#loginBtn {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    padding: 12px 20px;

    border: none;
    border-radius: 8px;

    background: var(--heading-color);
    color: var(--bg-color);

    font-family: inherit;
    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition: opacity 0.2s ease, transform 0.15s ease;
}

#loginBtn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

#loginBtn:active {
    opacity: 1;
    transform: translateY(0);
}

#retryBtn {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin: 10px 0 0;
    padding: 8px 16px;

    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

#retryBtn:hover {
    color: var(--link-color);
    border-color: var(--link-color);
}

.login-note {
    margin: 14px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

#status.status-error {
    color: #dc3545;
    font-weight: 600;
}


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

#status {
    margin: 0 auto 18px;

    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

#output {
    display: none;
}


/* =========================
   FILTER PANEL
   ========================= */

#filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
    margin-bottom: 28px;
}

#filters label {
    display: block;

    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

#filters label[for="courseSearch"] {
    grid-column: 1;
    grid-row: 1;
}

#filters .autocomplete:has(#courseSearch) {
    grid-column: 1;
    grid-row: 2;
}

#filters label[for="professorSearch"] {
    grid-column: 2;
    grid-row: 1;
}

#filters .autocomplete:has(#professorSearch) {
    grid-column: 2;
    grid-row: 2;
}


/* =========================
   AUTOCOMPLETE
   ========================= */

.autocomplete {
    position: relative;
    width: 100%;
}

#courseSearch,
#professorSearch {
    width: 100%;
    height: 44px;

    padding: 12px 14px;

    background: var(--bg-color);
    color: var(--text-color);

    border: 1px solid var(--border-color);
    border-radius: 8px;

    outline: none;

    font-family: inherit;
    font-size: 15px;

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

#courseSearch:hover,
#professorSearch:hover {
    border-color: var(--link-color);
}

#courseSearch:focus,
#professorSearch:focus {
    border-color: var(--link-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--link-color) 20%, transparent);
}

#courseSearch::placeholder,
#professorSearch::placeholder {
    color: var(--text-muted);
}

#courseSearch.selected,
#professorSearch.selected {
    border-color: var(--link-color);
}


/* =========================
   SUGGESTIONS
   ========================= */

#courseSuggestions,
#professorSuggestions {
    position: absolute;

    top: calc(100% + 6px);
    left: 0;

    width: 100%;
    max-height: 300px;

    background: var(--card-bg);

    border: 1px solid var(--border-color);
    border-radius: 8px;

    overflow-x: hidden;
    overflow-y: auto;

    z-index: 100;

    box-shadow: var(--card-shadow-hover);

    display: none;
}

#courseSuggestions.visible,
#professorSuggestions.visible {
    display: block;
}

.autocomplete-option {
    padding: 11px 14px;

    color: var(--text-color);

    cursor: pointer;

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

    font-size: 15px;

    transition: background 0.12s ease, color 0.12s ease;
}

.autocomplete-option:last-child {
    border-bottom: none;
}

.autocomplete-option:hover,
.autocomplete-option.active {
    background: var(--blockquote-bg);
    color: var(--link-color);
}

.autocomplete-empty {
    padding: 12px 14px;
    color: var(--text-muted);
    font-size: 14px;
    cursor: default;
}

#courseSuggestions::-webkit-scrollbar,
#professorSuggestions::-webkit-scrollbar {
    width: 7px;
}

#courseSuggestions::-webkit-scrollbar-track,
#professorSuggestions::-webkit-scrollbar-track {
    background: transparent;
}

#courseSuggestions::-webkit-scrollbar-thumb,
#professorSuggestions::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}


/* =========================
   LOAD REVIEWS BUTTON
   ========================= */

#loadReviewsBtn {
    grid-column: 1 / 3;
    grid-row: 3;

    justify-self: center;

    width: 220px;
    margin-top: 4px;

    padding: 12px 20px;

    border: none;
    border-radius: 8px;

    background: var(--heading-color);
    color: var(--bg-color);

    font-family: inherit;
    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition: opacity 0.2s ease, transform 0.15s ease;
}

#loadReviewsBtn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

#loadReviewsBtn:active {
    opacity: 1;
    transform: translateY(0);
}


/* =========================
   REVIEWS
   ========================= */

#reviews {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: var(--card-shadow);
    padding: 22px 26px;

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

.review-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.review-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: var(--heading-color);
    margin: 0 0 10px;
}

.review-card p {
    margin: 6px 0;
    line-height: 1.6;
    color: var(--text-color);
}

.review-card strong {
    color: var(--heading-color);
}


/* =========================
   MOBILE
   ========================= */

@media (max-width: 700px) {

    .panel {
        padding: 20px;
    }

    #filters {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    #filters label[for="courseSearch"] {
        grid-column: 1;
        grid-row: 1;
    }

    #filters .autocomplete:has(#courseSearch) {
        grid-column: 1;
        grid-row: 2;
    }

    #filters label[for="professorSearch"] {
        grid-column: 1;
        grid-row: 3;
    }

    #filters .autocomplete:has(#professorSearch) {
        grid-column: 1;
        grid-row: 4;
    }

    #loadReviewsBtn {
        grid-column: 1;
        grid-row: 5;
        width: 100%;
    }
}
