/* ==========================================
   FcitIndex - Dark Theme
   ========================================== */

:root {
    --bg-primary: #0a0a14;
    --bg-secondary: #12121f;
    --bg-card: #1a1a2e;
    --bg-input: #16162a;
    --border-color: #2a2a4a;
    --accent-primary: #00d4ff;
    --accent-secondary: #00a8cc;
    --accent-glow: rgba(0, 212, 255, 0.3);
    --danger-glow: rgba(255, 116, 142, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6a6a8a;
    --success: #00ff88;
    --success-bg: rgba(0, 255, 136, 0.15);
    --warning: #ffaa00;
    --danger: #ff4466;
    --grid-line: rgba(0, 212, 255, 0.08);
    --course-box-bg: linear-gradient(135deg, #1e3a5f 0%, #16213e 100%);
    --course-box-border: var(--accent-primary);
    --section-header-bg: #1a1a2e;

    --select-arrow: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
}

[data-theme="light"] {
    --bg-primary: #f0f4f8;
    --bg-secondary: #e8ecf0;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --border-color: #d0d8e0;
    --accent-primary: #0088cc;
    --accent-secondary: #006699;
    --accent-glow: rgba(0, 136, 204, 0.5);
    --danger-glow: rgba(136, 19, 40, 0.5);
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #8a8aa8;
    --grid-line: rgba(0, 136, 204, 0.1);
    --course-box-bg: #e0f4ff;
    --course-box-border: #0088cc;
    --section-header-bg: #e0f4ff;

    --success: #008844;
    --success-bg: #d4f5e0;
    --warning: #cc8800;
    --danger: #cc3355;

    --select-arrow: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%231a1a2e" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

body {
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
    margin: 0;
    padding: 40px;
    background-color: var(--bg-primary);
    background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 50px 50px;
    min-height: 100vh;
    color: var(--text-primary);
}

.site-header {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.logo-section:hover {
    transform: none;
    box-shadow: none;
    background: none;
}

.logo {
    color: var(--accent-primary);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 0 30px var(--accent-glow);
}

.logo-tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 5px;
    font-weight: 500;
}

.theme-toggle {
    position: absolute;
    top: 25px;
    right: 25px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
    transform: scale(1.1);
}

.theme-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

h3 {
    color: var(--accent-primary);
    text-align: center;
    font-size: 1.3rem;
}

main {
    max-width: 900px;
    margin: 30px auto;
    padding: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px 30px;
    align-items: end;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.year-term-combo {
    display: flex;
    gap: 10px;
}

.year-term-combo select {
    flex: 1;
}

label {
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

select {
    padding: 12px 35px 12px 15px;
    font-size: 15px;
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: var(--select-arrow);
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
}

select:hover {
    border-color: var(--accent-secondary);
}

select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-glow);
}

button {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 25px var(--accent-glow);
}

button:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

form button[type="submit"] {
    grid-column: 1 / -1;
    width: 100%;
}

#schedule {
    max-width: 1200px;
    margin: 40px auto;
}

section {
    display: none;
    margin-top: 40px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.hidden {
    display: none !important;
}

/* Grid */
.schedule-title {
    color: var(--accent-primary);
    margin-bottom: 20px;
}

.timetable-grid {
    background: var(--bg-card);
    border: 2px solid var(--accent-primary);
    border-radius: 12px;
    overflow: visible;
}

.grid-header {
    display: flex;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border-bottom: 2px solid var(--accent-primary);
    border-radius: 10px 10px 0 0;
}

.header-cell {
    flex: 1;
    padding: 15px 10px;
    text-align: center;
    color: var(--accent-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 13px;
}

.time-header {
    flex: 0 0 50px;
    border-right: 1px solid var(--border-color);
}

.grid-body {
    display: flex;
    height: var(--grid-height, 600px);
    min-height: 400px;
    padding: 10px 0 10px 20px;
    border-radius: 0 0 10px 10px;
}

.time-column {
    flex: 0 0 50px;
    position: relative;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
}

.time-label {
    position: absolute;
    right: 10px;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.day-column {
    flex: 1;
    position: relative;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
}

.day-column:last-child {
    border-right: none;
}

.hour-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

/* Course Box */
.course-box {
    position: absolute;
    left: 4px;
    right: 4px;
    background: var(--course-box-bg);
    border-left: 4px solid var(--course-box-border);
    border-radius: 6px;
    padding: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    color: var(--text-primary);
    transition: all 0.2s ease;
    z-index: 1;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    justify-content: flex-start;
    gap: 4px;
}

.course-box:hover {
    transform: scale(1.02);
    z-index: 10;
    box-shadow: 0 5px 15px var(--accent-glow);
}

/* Header row for grid box (Code + Badge) */
.course-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.course-section-badge {
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}

.course-code {
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 12px;
}

.course-detail-inline {
    display: flex;
    align-items: center;
    font-size: 10px;
    color: var(--text-primary);
    white-space: normal;
    line-height: 1.2;
}

.course-detail-inline.loc {
    color: var(--text-secondary);
}

.detail-icon {
    width: 10px;
    height: 10px;
    margin-right: 4px;
    flex-shrink: 0;
    object-fit: contain;
}

#scheduleControls {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

#clearScheduleBtn {
    padding: 12px 30px;
    background: transparent;
    border: 2px solid var(--danger);
    color: var(--danger);
    border-radius: 8px;
    font-size: 14px;
    width: auto;
}

#clearScheduleBtn:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 5px 25px var(--danger-glow);
}

#suggestions {
    margin-bottom: 30px;
}

#suggestions p {
    margin: 0 0 15px 0;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

#suggestedButtons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

#suggestedButtons button {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    width: auto;
}

#suggestedButtons button:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.all-found-msg {
    color: var(--success) !important;
    font-style: normal;
    padding: 10px 20px;
    background: var(--success-bg);
    border-radius: 8px;
    border: 1px solid var(--success);
}

.search-container {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.search-pill {
    display: flex;
    align-items: stretch;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    overflow: hidden;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
}

.search-pill:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

#courseInput {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    min-width: 0;
}

#courseInput::placeholder {
    color: var(--text-muted);
}

#fetchBtn {
    padding: 12px 20px;
    font-size: 14px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    width: auto;
    flex-shrink: 0;
    border-radius: 0 50px 50px 0;
    /* Straight left corners, rounded right to match pill */
}

#fetchBtn:hover {
    transform: none;
    box-shadow: 0 0 15px var(--accent-glow), 0 0 20px rgba(0, 136, 204, 0.3);
}

.search-icon {
    width: 24px;
    height: 24px;
    display: block;
}

/* Modal - Sidebar Layout */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    padding: 0;
    border-radius: 16px;
    max-width: 750px;
    /* Wider for sidebar */
    width: 90%;
    max-height: 85%;
    overflow: hidden;
    border: 1px solid var(--accent-primary);
    box-shadow: 0 10px 50px rgba(0, 212, 255, 0.2);
    display: flex;
    flex-direction: column;
}

/* Sidebar Wrapper */
.modal-body-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* Filters Panel */
.filters-panel {
    background: var(--bg-secondary);
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .modal-body-wrapper {
        flex-direction: row;
    }

    .filters-panel {
        width: 300px;
        border-right: 1px solid var(--border-color);
        border-bottom: none;
        overflow-y: auto;
        flex-shrink: 0;
    }

    /* On desktop, filter-row-pair children stack vertically */
    .filter-row-pair {
        display: block;
    }

    .filter-row-pair .filter-row {
        margin-bottom: 12px;
    }

    /* Consistent spacing for all filter rows on desktop */
    .filters-panel>.filter-row,
    .filters-panel>.filter-row-pair {
        margin-bottom: 12px;
    }

    .filters-panel>.filter-row:last-child,
    .filters-panel>.filter-row-pair:last-child {
        margin-bottom: 0;
    }
}

.modal-scroll-container {
    overflow-y: auto;
    flex: 1;
}

.modal-header {
    background: var(--bg-card);
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--accent-primary);
}

.modal-header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Mobile filter toggle - hidden on desktop */
.mobile-filter-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
}

.mobile-filter-toggle:hover {
    border-color: var(--accent-primary);
}

.filter-toggle-icon {
    width: 18px;
    height: 18px;
}

/* Mobile: show filter toggle and collapse filters */
@media (max-width: 767px) {
    .mobile-filter-toggle {
        display: flex;
    }

    .modal-body-wrapper {
        position: relative;
    }

    .modal-scroll-container {
        min-height: 200px;
    }

    .filters-panel {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 2px solid var(--accent-primary);
        padding: 12px 15px;
        z-index: 30;
        transform: translateY(-100%);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
        pointer-events: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .filters-panel.expanded {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    /* Two inputs per row layout */
    .filter-row-pair {
        display: flex;
        gap: 8px;
        margin-bottom: 8px;
    }

    .filter-row-pair .filter-row {
        flex: 1;
        margin-bottom: 0;
    }

    .filters-panel>.filter-row {
        margin-bottom: 8px;
    }

    .filters-panel input[type="text"],
    .filters-panel select {
        font-size: 12px;
        padding: 8px 10px;
        width: 100%;
    }

    .filters-panel input[type="text"]::placeholder {
        font-size: 11px;
    }

    .filters-panel .day-checkboxes {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }

    /* On mobile, days-container is simple flex row */
    .filters-panel .days-container {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .filters-panel .day-chip {
        font-size: 11px;
        padding: 5px 8px;
        min-width: 40px;
    }

    .filters-panel .conflict-toggle {
        font-size: 11px;
    }
}

.modal-close-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 0.3s ease;
}

.modal-close-btn:hover {
    background: var(--text-muted);
    color: var(--bg-primary);
    border-color: var(--text-muted);
}

.filter-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filters-panel input[type="text"],
.filters-panel select,
.custom-select {
    flex: 1;
    height: 70px;
    min-height: 30px;
    padding: 0 18px;
    font-size: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    width: 100%;
}

.custom-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: var(--select-arrow);
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
    padding-right: 35px;
    cursor: pointer;
}

.filters-panel input:focus,
.custom-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.day-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 6px 0;
    min-width: 50px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.2s;
    text-transform: none;
}

.day-chip:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.day-chip:has(input:checked) {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
    font-weight: 700;
}

.day-chip input {
    display: none;
}

.conflict-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: none;
}

#sectionList {
    padding: 20px 25px;
}

.section-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.section-card:hover {
    border-color: var(--accent-secondary);
}

.section-header {
    background: var(--section-header-bg);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.section-course-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-primary);
}

.section-info-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Uniform Badge Heights */
.section-number,
.section-crn,
.conflict-warning,
.credits-badge {
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 0 10px;
    box-sizing: border-box;
}

.section-number {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.section-crn {
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.conflict-warning {
    background: var(--danger);
    color: white;
}

.credits-badge {
    background: var(--bg-card);
    border: 1px solid var(--accent-secondary);
    color: var(--accent-secondary);
}

.section-card.has-conflict {
    border-color: var(--danger);
}

.section-details {
    padding: 15px 20px;
}

.schedule-row {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
}

.schedule-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.detail-label {
    flex: 0 0 90px;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.detail-value {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.section-icon {
    width: 14px;
    height: 14px;
    margin-right: 5px;
    opacity: 0.7;
}

/* Modal section buttons - glow but no transform */
.add-section-btn {
    width: 100%;
    margin: 0;
    border-radius: 0;
    padding: 12px;
    background: transparent;
    border: none;
    border-top: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.add-section-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    transform: none;
    box-shadow: 0 0 15px var(--accent-glow);
}

.details-modal {
    max-width: 450px;
}

.details-body {
    padding: 25px;
    max-height: 400px;
    overflow-y: auto;
}

.details-row {
    display: flex;
    margin-bottom: 12px;
    font-size: 14px;
}

.details-label {
    width: 100px;
    color: var(--text-muted);
    font-weight: 600;
}

.details-value {
    color: var(--text-primary);
    flex: 1;
}

.details-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 13px;
    width: 100%;
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 5px 25px var(--danger-glow);
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--text-primary);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    padding: 12px 25px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    animation: slideUp 0.3s ease;
    /* Prevent shrinking too much */
    min-width: fit-content;

}

.toast.toast-exit {
    animation: slideDown 0.3s ease forwards;
}

#toastMessage {
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
    white-space: nowrap;

}

#undoBtn {
    background: transparent;
    color: var(--accent-primary);
    border: none;
    padding: 0;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    text-transform: uppercase;

    /* FIX FOR MOBILE SIZE ISSUE */
    flex-grow: 0;
    width: auto;


}

#undoBtn:hover {
    text-decoration: underline;
    box-shadow: none;
    transform: none;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    to {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
}

.confirm-modal {
    max-width: 400px;
    text-align: center;
    padding: 30px;
}

.confirm-modal h3 {
    margin-top: 0;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.confirm-buttons button {
    flex: 1;
    min-width: 100px;
}

.confirm-yes-btn {
    padding: 10px 25px;
    background: var(--danger);
    color: white;
    width: auto;
}

.confirm-yes-btn:hover {
    box-shadow: 0 5px 25px var(--danger-glow);
}

.confirm-no-btn {
    padding: 10px 25px;
    background: var(--accent-primary);
    border: 1px solid var(--border-color);
    color: white;
    width: auto;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    main {
        padding: 20px;
    }

    form {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    button {
        width: 100%;
    }

    .timetable-grid {
        display: none !important;
    }

    .mobile-schedule-list {
        display: block !important;
    }

    /* Mobile Search Bar Fixes */
    .search-pill {
        width: 100%;
    }

    #fetchBtn {
        padding: 12px 18px;
        width: auto;
    }

    #courseInput {
        padding: 12px 15px;
        font-size: 11px;
    }
}

.mobile-schedule-list {
    display: none;
    padding: 10px 0;
}

.empty-schedule-msg {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-size: 14px;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    margin: 10px 0;
}

.no-results-msg {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-size: 14px;
    margin: 20px 0;
}

.mobile-day-group {
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
}

.mobile-day-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--bg-primary);
    padding: 10px 15px;
    background: var(--accent-primary);
}

.mobile-course-card {
    background: var(--course-box-bg);
    border-left: 4px solid var(--course-box-border);
    padding: 12px 15px;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.mobile-course-card:last-child {
    border-bottom: none;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.card-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Mobile Colors/Typography */
.mobile-course-code {
    font-weight: 800;
    color: var(--accent-primary);
    /* Fixed to blue */
    font-size: 15px;
}

.mobile-course-title {
    font-size: 12px;
    color: var(--text-primary);
}

.section-badge,
.crn-badge,
.credits-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.section-badge {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.crn-badge {
    background: var(--accent-secondary);
    color: var(--bg-primary);
}

.credits-badge {
    background: var(--bg-card);
    border: 1px solid var(--accent-secondary);
    color: var(--accent-secondary);
}

.remove-mobile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
}

.course-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.meta-row {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.meta-icon {
    width: 14px;
    height: 14px;
    margin-right: 4px;
    vertical-align: middle;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--accent-primary);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 280px;
    max-width: calc(100vw - 40px);
}

.toast.hidden {
    display: none;
}

.toast.toast-exit {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#toastMessage {
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
}

#undoBtn {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Body scroll lock when modal open */
body.modal-open {
    overflow: hidden;
}

/* Filter panel labels */
.filter-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}