/*
 * CSC 648 Fall 2026
 * Authors: Papat Thanitkhunkitti, Manisha Chand
 * File: tutoring.css
 * Description: Styles for the home page and the /search results page,
 * including the joined search bar (department pull-down, text box, button)
 * and its phone layout.
 */

/* Only affects the tutoring homepage. */
.tutoring-demo {
    --demo-accent: #4dd0e1;
    --demo-muted: #a1bac3;
    --demo-border: #29444e;
}

/* Main page width */
.tutoring-demo .container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px 40px;
}

.tutoring-demo h1,
.tutoring-demo h2,
.tutoring-demo h3,
.tutoring-demo p {
    margin-top: 0;
}

/* Buttons. Scoped to <main> so they do not restyle the shared Tailwind header
   (its Search button must stay cyan on every page). */
.tutoring-demo main button,
.tutoring-demo .demo-button {
    display: inline-block;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--demo-border);
    border-radius: 8px;
    background: #131e27;
    color: #d7f5fa;
    font: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.tutoring-demo main button:hover,
.tutoring-demo .demo-button:hover {
    background: #203944;
}

.tutoring-demo .primary {
    background: var(--demo-accent);
    border-color: var(--demo-accent);
    color: #081419;
    font-weight: 600;
}

.tutoring-demo .primary:hover {
    background: #80deea;
}

.tutoring-demo :focus-visible {
    outline: 3px solid var(--demo-accent);
    outline-offset: 3px;
}

/* Homepage introduction */
.tutoring-demo .intro {
    padding: 60px 0 45px;
}

.tutoring-demo .eyebrow {
    color: var(--demo-accent);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1.5px;
}

.tutoring-demo h1 {
    margin-bottom: 20px;
    font-size: clamp(38px, 6vw, 64px);
    line-height: 1.12;
}

.tutoring-demo .muted,
.tutoring-demo .intro > p:not(.eyebrow) {
    color: var(--demo-muted);
}

.tutoring-demo .entry-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

/* Search section */
.tutoring-demo #find-tutors {
    padding-top: 30px;
    border-top: 1px solid var(--demo-border);
}

.tutoring-demo .search-box {
    display: flex;
    align-items: end;
    gap: 12px;
    padding: 20px;
    background: #101922;
    border: 1px solid var(--demo-border);
    border-radius: 12px;
}

.tutoring-demo .search-box label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: bold;
}

.tutoring-demo .search-box input,
.tutoring-demo .search-box select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px;
    border: 1px solid var(--demo-border);
    border-radius: 7px;
    background: #0a1218;
    color: #e0f7fa;
    color-scheme: dark;
    font: inherit;
}

.tutoring-demo .search-input {
    flex: 1;
    min-width: 0;
}

.tutoring-demo #result-count {
    margin: 20px 0;
    color: var(--demo-muted);
    font-size: 14px;
}

/* Tutor cards */
.tutoring-demo .tutor-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.tutoring-demo .tutor-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: #101922;
    border: 1px solid var(--demo-border);
    border-radius: 12px;
}

.tutoring-demo .tutor-card h3 {
    margin-bottom: 5px;
}

.tutoring-demo .course-label {
    color: var(--demo-accent);
    font-size: 13px;
    font-weight: bold;
}

.tutoring-demo .topics {
    flex: 1;
    color: var(--demo-muted);
    font-size: 14px;
}

.tutoring-demo .tutor-card button {
    width: 100%;
    margin-top: 12px;
}

/* Profile popup */
.tutoring-demo dialog {
    width: min(520px, calc(100% - 32px));
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    border: 1px solid var(--demo-border);
    border-radius: 16px;
    background: #101922;
    color: #e0f7fa;
}

.tutoring-demo dialog::backdrop {
    background: rgb(0 0 0 / 70%);
}

.tutoring-demo .dialog-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.tutoring-demo .dialog-top p {
    margin: 0;
}

.tutoring-demo .time-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tutoring-demo #booking-message {
    margin-top: 16px;
    color: #93e5bb;
}

.tutoring-demo main button:disabled {
    background: #233039;
    color: var(--demo-muted);
    cursor: default;
}

/* Demo explanation */
.tutoring-demo .demo-note {
    margin: 30px 0;
    padding: 18px;
    border-radius: 8px;
    background: #13252d;
    color: var(--demo-muted);
    font-size: 12px;
}

.tutoring-demo [hidden] {
    display: none !important;
}

/* Smaller screens */
@media (max-width: 750px) {
    .tutoring-demo .tutor-grid {
        grid-template-columns: 1fr;
    }

    .tutoring-demo .search-box {
        flex-direction: column;
        align-items: stretch;
    }

    .tutoring-demo .intro {
        padding-top: 38px;
    }

    .tutoring-demo .entry-options > * {
        flex: 1 1 180px;
    }
}

/* Joined search bar (home page and /search).
   The pull-down, text box and button sit in one bar:
   one outer border, no gaps, no inner rounded corners. */
.tutoring-demo .search-bar {
    display: flex;
    max-width: 760px;
    margin-top: 28px;
    border: 2px solid var(--demo-accent);
    border-radius: 10px;
    overflow: hidden;          /* clips the inner corners to the outer rounding */
    background: #0a1218;
}

/* The whole bar glows when any part has focus, so keyboard users
   can still see where they are. */
.tutoring-demo .search-bar:focus-within {
    box-shadow: 0 0 0 3px rgb(77 208 225 / 35%);
}

.tutoring-demo .search-bar :focus-visible {
    outline: none;
}

.tutoring-demo .search-bar select,
.tutoring-demo .search-bar input,
.tutoring-demo .search-bar button {
    min-height: 48px;
    border: 0;
    border-radius: 0;
    font: inherit;
}

.tutoring-demo .search-bar select {
    flex: 0 0 auto;
    max-width: 220px;
    padding: 0 12px;
    border-right: 1px solid var(--demo-border);
    background: #1b2a33;       /* lighter box on the left */
    color: #e0f7fa;
    color-scheme: dark;
    cursor: pointer;
}

.tutoring-demo .search-bar input {
    flex: 1;
    min-width: 0;
    padding: 0 14px;
    background: transparent;
    color: #e0f7fa;
}

.tutoring-demo .search-bar input::placeholder {
    color: var(--demo-muted);
}

.tutoring-demo .search-bar button {
    padding: 0 22px;
}

/* Results page: Manisha's form wraps each field in a <div>. display: contents
   makes those wrappers "invisible" to the layout, so the fields still join
   into one bar like on the home page. */
.tutoring-demo .search-bar > div {
    display: contents;
}

/* Results page: space between the search bar and "N tutors found". */
.tutoring-demo .search-page .search-bar {
    margin-bottom: 8px;
}

/* Hides a label on screen but keeps it for screen readers. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 750px) {
    .tutoring-demo .search-bar select {
        max-width: 140px;
    }
}

/* Phones: stack the department pull-down above the text box so the search
   text stays readable. */
@media (max-width: 480px) {
    .tutoring-demo .search-bar {
        flex-wrap: wrap;
    }

    .tutoring-demo .search-bar select {
        flex: 1 1 100%;
        max-width: none;
        border-right: 0;
        border-bottom: 1px solid var(--demo-border);
    }
}
