@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ===================== BASE ===================== */
#bs-app *, #bs-my-bookings * { box-sizing: border-box; margin: 0; padding: 0; }

#bs-app, #bs-my-bookings, .bs-app-wrap {
    --bg:      #080e1a;
    --surface: #0f1929;
    --surface2:#162035;
    --border:  rgba(255,255,255,0.07);
    --accent:  #3b82f6;
    --accent2: #8b5cf6;
    --green:   #10b981;
    --red:     #ef4444;
    --text:    #ffffff;
    --muted:   rgba(255,255,255,0.45);
    --radius:  16px;
    font-family: 'Sora', sans-serif;
    color: var(--text);
    background: var(--bg);
    min-height: 60vh;
    padding-bottom: 80px;
}

/* ===================== NOTICES ===================== */
.bs-notice {
    max-width: 1100px; margin: 0 auto 0;
    padding: 14px 24px; border-radius: 12px;
    font-size: 14px; font-weight: 600;
    animation: bs-fade-up 0.4s ease both;
}
.bs-notice-success {
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.3);
    color: #34d399;
    margin: 24px 32px 0;
}
.bs-notice-error {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.3);
    color: #f87171;
    margin: 24px 32px 0;
}

/* ===================== HEADER ===================== */
.bs-header {
    background: linear-gradient(135deg, #0f1929 0%, #162035 100%);
    border-bottom: 1px solid var(--border);
    padding: 20px 32px;
    position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(20px);
}
.bs-header-inner {
    max-width: 1100px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
}
.bs-logo {
    display: flex; align-items: center; gap: 12px;
    font-size: 18px; font-weight: 700; letter-spacing: -0.3px; color: #fff;
}
#bs-selected-info {
    font-size: 13px; color: var(--muted);
    display: flex; align-items: center; gap: 16px;
}
#bs-selected-info .tag {
    background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3);
    border-radius: 99px; padding: 4px 12px; color: #93c5fd; font-weight: 500;
}

/* ===================== SECTIONS ===================== */
.bs-section {
    max-width: 1100px; margin: 0 auto;
    padding: 48px 32px 0;
    animation: bs-fade-up 0.4s ease both;
}
.bs-hidden { display: none !important; }

@keyframes bs-fade-up {
    from { opacity:0; transform:translateY(20px); }
    to   { opacity:1; transform:translateY(0); }
}

.bs-section-title {
    font-size: 22px; font-weight: 700; letter-spacing: -0.5px;
    margin-bottom: 28px; color: #fff;
    display: flex; align-items: center; gap: 12px;
}
.bs-section-title::before {
    content: ''; display: inline-block; width: 4px; height: 22px;
    background: linear-gradient(var(--accent), var(--accent2)); border-radius: 4px;
}

/* ===================== SPACES GRID ===================== */
.bs-spaces-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px;
}
.bs-space-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px; cursor: pointer;
    transition: all 0.25s; position: relative; overflow: hidden;
}
.bs-space-card::before {
    content: ''; position: absolute; top:0; left:0; right:0; height:3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    opacity: 0; transition: opacity 0.25s;
}
.bs-space-card:hover, .bs-space-card.active {
    border-color: rgba(59,130,246,0.4); transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(59,130,246,0.2);
}
.bs-space-card:hover::before, .bs-space-card.active::before { opacity: 1; }
.bs-space-icon {
    width: 48px; height: 48px; border-radius: 12px;
    background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(139,92,246,0.2));
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; margin-bottom: 16px;
}
.bs-space-name { font-size: 17px; font-weight: 600; margin-bottom: 8px; color: #fff; }
.bs-space-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ===================== CALENDAR ===================== */
.bs-calendar-wrapper {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px; max-width: 520px;
}
.bs-cal-nav {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px;
}
#bs-month-label { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -0.3px; text-transform: capitalize; }
.bs-nav-btn {
    background: var(--surface2); border: 1px solid var(--border); color: #fff;
    width: 36px; height: 36px; border-radius: 8px; cursor: pointer; font-size: 18px;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.bs-nav-btn:hover { background: var(--accent); border-color: var(--accent); }
.bs-cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; }
.bs-cal-day-name {
    text-align: center; font-size: 11px; font-weight: 600; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.5px; padding-bottom: 8px;
}
.bs-cal-day {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    border-radius: 10px; font-size: 14px; font-weight: 500; cursor: pointer;
    color: #fff; transition: all 0.2s; border: 1px solid transparent;
}
.bs-cal-day.empty { cursor: default; }
.bs-cal-day.past  { color: var(--muted); cursor: default; }
.bs-cal-day.today { border-color: rgba(59,130,246,0.5); color: #93c5fd; }
.bs-cal-day.selected {
    background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
    box-shadow: 0 4px 16px rgba(59,130,246,0.4);
}
.bs-cal-day:not(.past):not(.empty):hover:not(.selected) {
    background: var(--surface2); border-color: var(--border);
}

/* ===================== SLOTS ===================== */
.bs-slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.bs-slot {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 20px; cursor: pointer; transition: all 0.25s; text-align: center;
}
.bs-slot.available:hover, .bs-slot.selected {
    border-color: rgba(16,185,129,0.5); background: rgba(16,185,129,0.08);
    transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(16,185,129,0.2);
}
.bs-slot.selected { border-color: var(--green); }
.bs-slot.booked { cursor: not-allowed; opacity: 0.4; background: rgba(239,68,68,0.05); border-color: rgba(239,68,68,0.2); }
.bs-slot-time { font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.bs-slot-badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 10px; border-radius: 99px; text-transform: uppercase; letter-spacing: 0.5px; }
.bs-slot.available .bs-slot-badge { background: rgba(16,185,129,0.15); color: #34d399; }
.bs-slot.booked .bs-slot-badge    { background: rgba(239,68,68,0.15);  color: #f87171; }
.bs-slot.selected .bs-slot-badge  { background: var(--green); color: #fff; }

/* ===================== BOOKING SUMMARY ===================== */
.bs-booking-summary {
    background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(139,92,246,0.1));
    border: 1px solid rgba(59,130,246,0.25); border-radius: 14px;
    padding: 20px 24px; margin-bottom: 24px;
    display: flex; flex-wrap: wrap; gap: 20px; align-items: center;
}
.bs-sum-item { display: flex; flex-direction: column; gap: 2px; }
.bs-sum-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.bs-sum-value { font-size: 15px; font-weight: 600; color: #fff; }

/* ===================== EXTEND ===================== */
.bs-extend-box {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; padding: 20px 24px; margin-bottom: 24px;
}
.bs-extend-box h4 { font-size: 14px; font-weight: 600; margin-bottom: 14px; color: #fff; }
.bs-extend-slots { display: flex; flex-wrap: wrap; gap: 10px; }
.bs-ext-slot {
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 99px; padding: 6px 16px; cursor: pointer;
    font-size: 13px; font-weight: 500; color: #fff; transition: all 0.2s;
}
.bs-ext-slot.selected { background: rgba(16,185,129,0.15); border-color: var(--green); color: #34d399; }
.bs-ext-slot:hover:not(.selected) { border-color: rgba(255,255,255,0.2); }

/* ===================== FORM ===================== */
.bs-form-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 36px;
}
.bs-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 32px; }
@media(max-width:600px) { .bs-form-grid { grid-template-columns: 1fr; } }
.bs-field { display: flex; flex-direction: column; gap: 8px; }
.bs-field label { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 0.4px; }
.bs-field input {
    background: var(--surface2); border: 1px solid var(--border); color: #fff;
    border-radius: 10px; padding: 14px 16px; font-size: 15px; font-family: 'Sora', sans-serif;
    transition: all 0.2s; outline: none;
}
.bs-field input::placeholder { color: var(--muted); }
.bs-field input:focus { border-color: rgba(59,130,246,0.5); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.bs-form-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* ===================== BUTTONS ===================== */
.bs-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 28px; border-radius: 12px; font-size: 15px; font-weight: 600;
    font-family: 'Sora', sans-serif; cursor: pointer; border: none; transition: all 0.25s;
}
.bs-btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
    box-shadow: 0 4px 20px rgba(59,130,246,0.4);
}
.bs-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(59,130,246,0.5); }
.bs-btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.bs-btn-ghost:hover { color: #fff; border-color: rgba(255,255,255,0.2); }
.bs-btn-danger {
    background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
    color: #f87171; padding: 10px 20px; font-size: 13px;
}
.bs-btn-danger:hover { background: rgba(239,68,68,0.2); }

/* ===================== SUCCESS ===================== */
.bs-success-card {
    background: var(--surface); border: 1px solid rgba(16,185,129,0.3);
    border-radius: var(--radius); padding: 60px 40px; text-align: center;
    max-width: 480px; margin: 0 auto;
}
.bs-success-icon {
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, var(--green), #059669);
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; color: #fff; margin: 0 auto 28px;
    box-shadow: 0 0 40px rgba(16,185,129,0.4);
    animation: bs-pop 0.5s cubic-bezier(.175,.885,.32,1.275) both;
}
@keyframes bs-pop { from { transform:scale(0); opacity:0; } to { transform:scale(1); opacity:1; } }
.bs-success-card h2 { font-size: 26px; font-weight: 700; color: #fff; margin-bottom: 12px; }
.bs-success-card p  { color: var(--muted); font-size: 15px; margin-bottom: 32px; }

/* ===================== MY BOOKINGS ===================== */
.bs-my-booking-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; padding: 24px; margin-bottom: 14px;
    transition: border-color 0.2s;
    animation: bs-fade-up 0.3s ease both;
}
.bs-my-booking-card.bs-cancelled-card { opacity: 0.5; }
.bs-my-booking-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 14px;
}
.bs-my-space { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.bs-my-date  { font-size: 13px; color: var(--muted); }
.bs-my-time  {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px; font-weight: 600; color: #93c5fd;
    background: rgba(59,130,246,0.1); padding: 6px 14px; border-radius: 8px;
}
.bs-my-booking-footer {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
    padding-top: 14px; border-top: 1px solid var(--border);
}
.bs-my-class { font-size: 13px; color: var(--muted); }
.bs-my-cancel-row { margin-top: 14px; }

/* ===================== STATUS BADGES ===================== */
.bs-status { display: inline-block; padding: 3px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.bs-status-confirmed { background: rgba(16,185,129,0.15); color: #34d399; }
.bs-status-cancelled { background: rgba(239,68,68,0.15);  color: #f87171; }

/* ===================== LOADING ===================== */
.bs-loading { color: var(--muted); padding: 40px; text-align: center; font-size: 14px; letter-spacing: 0.3px; }

/* ===================== ADMIN WEEKLY TABLE ===================== */
.bs-weekly-toolbar {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    margin-bottom: 4px;
}
.bs-weekly-table {
    width: 100%; border-collapse: collapse; background: #fff;
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    min-width: 900px;
}
.bs-weekly-table th {
    background: #0f172a; color: #fff; padding: 12px 14px;
    font-size: 12px; font-weight: 600; text-align: left; letter-spacing: 0.3px;
}
.bs-weekly-table th.bs-today-col { background: #1e3a5f; }
.bs-weekly-table td {
    padding: 12px 14px; border-bottom: 1px solid #f1f5f9;
    vertical-align: top; font-size: 13px;
}
.bs-weekly-table td.bs-today-col { background: #eff6ff; }
.bs-weekly-table td.bs-space-cell {
    font-weight: 700; color: #1e293b; background: #f8fafc;
    border-right: 2px solid #e2e8f0; white-space: nowrap;
}
.bs-weekly-table td.has-booking { background: #f0fdf4; }
.bs-week-booking {
    background: #fff; border: 1px solid #d1fae5;
    border-left: 3px solid #10b981; border-radius: 8px;
    padding: 8px 10px; margin-bottom: 6px;
}
.bs-week-time    { display: block; font-weight: 700; color: #065f46; font-size: 12px; font-family: monospace; }
.bs-week-teacher { display: block; color: #1e293b; font-size: 12px; margin-top: 2px; }
.bs-week-class   { display: block; color: #64748b; font-size: 11px; margin-top: 1px; }
.bs-week-free    { color: #cbd5e1; font-size: 18px; }

/* Closed school days */
.bs-cal-day.closed {
    background: rgba(251,191,36,0.08);
    border-color: rgba(251,191,36,0.25);
    color: var(--muted);
    cursor: not-allowed;
    position: relative;
}
.bs-cal-day.closed .bs-cal-lock {
    display: block;
    font-size: 8px;
    line-height: 1;
    margin-top: 1px;
}

.bs-slot.advance { cursor: not-allowed; opacity: 0.55; }
