body {
    background: #f7f7f9;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, 'sans-serif';
    font-size: 1rem;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100vw;
}

.container {
    max-width: 600px;
    width: 100%;
    margin: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.10);
    padding: 32px 20px 20px 20px;
    box-sizing: border-box;
}

.header-date {
    font-size: 1.1rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
    text-align: center;
}

.teacher-select {
    margin: 24px 0 16px 0;
}
.teacher-select label {
    font-weight: 500;
    margin-right: 12px;
}
select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1rem;
}
/* Dropdown visual grouping for pairs */
.teacher-dropdown option[data-pair="g6"],
.teacher-dropdown option[data-pair="g7"],
.teacher-dropdown option[data-pair="g8"] {
    background: #e7f2ff;
    font-weight: bold;
    border-bottom: 1px solid #99c;
}
.teacher-dropdown option.pair-separator {
    background: #d6e1f7;
    color: #444;
    font-style: italic;
    font-weight: normal;
}

.slot-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    justify-content: center;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    box-sizing: border-box;
}

.slot-card {
    background: #e3eaef;
    border-radius: 10px;
    width: 180px;
    min-width: 120px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    padding: 10px 8px;
    font-size: 1rem;
    box-sizing: border-box;
    margin-bottom: 4px;
}

.slot-time {
    font-size: 1.1rem;
    color: #222;
}

.book-btn {
    margin-top: 8px;
    padding: 4px 12px;
    font-size: 1rem;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    width: auto;
    min-width: 0;
    white-space: nowrap;
}
.book-btn:active,
.book-btn:focus {
    background: #0056b3;
}
.booked {
    background: #d1d1d6;
    color: #888;
    cursor: not-allowed;
}
.modal {
    display: none;
    position: fixed;
    z-index: 101;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.35);
}
.modal-content {
    background: #fff;
    margin: 18% auto;
    padding: 24px;
    width: 90%;
    max-width: 360px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 16px rgba(0,0,0,0.12);
}

/* ---------- MOBILE STYLES ---------- */
@media (max-width: 600px) {
    body, html {
        overflow-x: hidden;
        width: 100vw;
        margin: 0;
        padding: 0;
    }
    .container {
        padding: 12px 2px 12px 2px;
        border-radius: 0;
        box-shadow: none;
        width: 100vw;
        max-width: 100vw;
    }
    .header-date {
        font-size: 0.98rem;
    }
    h2 {
        font-size: 1.11rem;
    }
    .slot-list {
        gap: 8px;
        margin-left: 0;
        margin-right: 0;
        padding: 0;
    }
    .slot-card {
        width: 44vw;
        min-width: 0;
        max-width: 98vw;
        font-size: 0.97rem;
        padding: 7px 3px;
        margin-bottom: 4px;
        box-sizing: border-box;
    }
    .book-btn {
        font-size: 0.93rem;
        padding: 5px 6px;
        min-width: 0;
        width: auto;
        white-space: nowrap;
    }
    .modal-content {
        padding: 14px 5px;
        margin: 34% auto;
    }
}

@media (max-width: 400px) {
    .slot-card {
        width: 98vw;
        min-width: 0;
        max-width: 100vw;
        margin-bottom: 6px;
    }
    .slot-list {
        gap: 6px;
    }
}
