/* =====================================================
   Classroom Seating — Main Styles v1.1.4 (Dark Theme)
===================================================== */

/* ── Page Background ── */
body { background: #000 !important; color: #e0e0e0; }

/* ── General ── */
.cs-wrap,.cs-dash-wrap,.cs-home-wrap { max-width: 960px; margin: 0 auto; padding: 20px 0; font-family: inherit; }
.cs-notice { padding: 14px 18px; border-left: 4px solid #4a9fd4; background: #0d1f30; border-radius: 4px; margin: 16px 0; color: #a8d4f0; }
.cs-notice a { color: #4a9fd4; }
.cs-error { border-left-color: #e05555; background: #2a0f0f; color: #f0a0a0; }

/* ── Buttons ── */
.cs-btn { display: inline-block; padding: 10px 20px; background: #2271b1; color: #fff; border-radius: 6px; text-decoration: none; border: none; cursor: pointer; font-size: 14px; font-weight: 600; transition: background .2s, opacity .2s; }
.cs-btn:hover { background: #135e96; color: #fff; }
.cs-btn-full { width: 100%; text-align: center; padding: 12px; font-size: 16px; }
.cs-btn-sm { padding: 6px 12px; font-size: 13px; }
.cs-btn-outline { background: transparent; border: 2px solid #4a9fd4; color: #4a9fd4; }
.cs-btn-outline:hover { background: #4a9fd4; color: #000; }
.cs-btn-danger { background: #d63638; }
.cs-btn-danger:hover { background: #b02929; }
.cs-btn-refresh { background: #2271b1; margin-bottom: 16px; }
.cs-btn-disabled { background: #333; color: #666; cursor: not-allowed; opacity: .7; }
.cs-btn-back { background: #3a3a3a; color: #ccc; }
.cs-btn-back:hover { background: #4a4a4a; color: #fff; }

/* ── Homepage ── */
.cs-home-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; padding: 40px 20px; }
.cs-home-card { background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 16px; box-shadow: 0 4px 32px rgba(0,0,0,.6); padding: 48px 40px; max-width: 440px; width: 100%; text-align: center; }
.cs-home-icon { font-size: 52px; margin-bottom: 12px; }
.cs-home-title { font-size: 24px; font-weight: 700; color: #fff; margin: 0 0 10px; line-height: 1.3; }
.cs-home-subtitle { color: #999; margin: 0 0 28px; font-size: 15px; }
.cs-login-form { text-align: left; }
.cs-form-group { margin-bottom: 16px; }
.cs-form-group label { display: block; font-size: 13px; font-weight: 600; color: #bbb; margin-bottom: 6px; }
.cs-input { width: 100%; padding: 10px 14px; border: 1.5px solid #333; border-radius: 6px; font-size: 15px; box-sizing: border-box; transition: border-color .2s; background: #111; color: #eee; }
.cs-input:focus { outline: none; border-color: #2271b1; box-shadow: 0 0 0 3px rgba(34,113,177,.25); }
.cs-login-error { background: #2a0f0f; border: 1px solid #e05555; color: #f0a0a0; border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }

/* ── Dashboard ── */
.cs-dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 12px; }
.cs-dash-greeting { display: flex; align-items: center; gap: 14px; }
.cs-dash-wave { font-size: 32px; }
.cs-dash-greeting h2 { margin: 0; font-size: 22px; color: #fff; }
.cs-dash-greeting p { margin: 4px 0 0; color: #999; font-size: 14px; }
.cs-dash-updated-notice { background: #0d2a0f; border: 1px solid #2e7d32; color: #81c784; border-radius: 8px; padding: 12px 16px; margin-bottom: 20px; font-weight: 600; }
.cs-dash-sessions { display: grid; gap: 16px; }
.cs-dash-card { background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.cs-dash-card-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 20px 14px; border-bottom: 1px solid #2a2a2a; gap: 12px; }
.cs-dash-session-name { margin: 0 0 4px; font-size: 17px; font-weight: 700; color: #fff; }
.cs-dash-turma { font-size: 12px; background: #0d1f30; color: #4a9fd4; padding: 2px 10px; border-radius: 20px; font-weight: 600; }
.cs-dash-date { text-align: right; flex-shrink: 0; }
.cs-dash-day { display: block; font-size: 18px; font-weight: 700; color: #4a9fd4; }
.cs-dash-time { display: block; font-size: 13px; color: #666; }
.cs-dash-card-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.cs-dash-reservation { font-size: 14px; padding: 8px 14px; border-radius: 6px; }
.cs-reservation-mine { background: #0d2a0f; color: #81c784; border: 1px solid #2e7d32; font-weight: 600; }
.cs-reservation-none { background: #1a1a1a; color: #666; border: 1px solid #2a2a2a; }
.cs-dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Booking Status ── */
.cs-booking-status { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; font-size: 14px; flex-wrap: wrap; }
.cs-booking-icon { font-size: 18px; flex-shrink: 0; }
.cs-booking-scheduled { background: #1f1800; border: 1px solid #5d4a00; color: #ffc947; align-items: flex-start; }
.cs-booking-scheduled small { display: block; color: #888; margin-top: 4px; }
.cs-booking-open { background: #0d2a0f; border: 1px solid #2e7d32; color: #81c784; }
.cs-booking-until { color: #4a9fd4; font-weight: 600; font-size: 13px; margin-left: 4px; }
.cs-booking-closed { background: #1a1a1a; border: 1px solid #333; color: #666; }
.cs-countdown { font-size: 16px; font-weight: 700; color: #ffa726; margin: 4px 0; }

/* ── Seating Chart ── */
.cs-back { display: inline-block; margin-bottom: 12px; color: #4a9fd4; text-decoration: none; font-size: 14px; }
.cs-back:hover { text-decoration: underline; }
.cs-meta { color: #999; margin: 0 0 16px; }
.cs-wrap h2 { color: #fff; }
.cs-my-seat { background: #0d2a0f; border: 1px solid #2e7d32; border-radius: 6px; padding: 10px 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: #81c784; }
.cs-legend { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.cs-legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #bbb; }
.cs-legend-item::before { content: ''; display: inline-block; width: 22px; height: 22px; border-radius: 4px; }
.cs-free-demo::before    { background: #0d2a0f; border: 2px solid #4caf50; }
.cs-mine-demo::before    { background: #1565c0; border: 2px solid #0d47a1; }
.cs-taken-demo::before   { background: #2a0f0f; border: 2px solid #e05555; }
.cs-blocked-demo::before { background: #1a1a1a; border: 2px dashed #444; }
.cs-board { background: #111; border: 1px solid #2a2a2a; border-radius: 8px; padding: 20px; margin-top: 10px; position: relative; }
.cs-admin-board { margin-top: 20px; }
.cs-teacher-label { text-align: center; background: #0d1f30; border: 1px solid #1e3a55; border-radius: 6px; padding: 8px 16px; margin-bottom: 20px; font-weight: 600; color: #4a9fd4; }
.cs-grid { display: grid; gap: 8px; }
.cs-seat { aspect-ratio: 1; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; border: 2px solid transparent; transition: transform .15s, box-shadow .15s; min-width: 44px; min-height: 44px; }
.cs-seat:hover:not(.cs-blocked):not(.cs-taken):not(.cs-booking-disabled) { transform: scale(1.08); box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.cs-seat-id   { font-size: 11px; font-weight: 700; line-height: 1; }
.cs-seat-icon { font-size: 14px; line-height: 1; margin-top: 2px; }
.cs-seat-name { font-size: 9px; line-height: 1.2; text-align: center; overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; margin-top: 2px; }
.cs-free     { background: #0d2a0f; border-color: #4caf50; color: #81c784; }
.cs-mine     { background: #1565c0; border-color: #0d47a1; color: #fff; }
.cs-taken    { background: #2a0f0f; border-color: #e05555; color: #f0a0a0; cursor: not-allowed; }
.cs-blocked  { background: #1a1a1a; border-color: #333; color: #444; cursor: not-allowed; border-style: dashed; }
.cs-booking-disabled { cursor: not-allowed; opacity: .5; }
.cs-map-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }

/* ── Loader ── */
.cs-loader { position: absolute; top:0; left:0; right:0; bottom:0; background: rgba(0,0,0,.75); border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 14px; color: #4a9fd4; font-weight: 600; z-index: 10; }
.cs-spinner { width: 22px; height: 22px; border: 3px solid #1e3a55; border-top-color: #4a9fd4; border-radius: 50%; animation: cs-spin .7s linear infinite; }
@keyframes cs-spin { to { transform: rotate(360deg); } }

/* ── Message ── */
.cs-message { padding: 12px 16px; border-radius: 6px; margin-top: 14px; font-weight: 500; display: none; }
.cs-message.cs-success { background: #0d2a0f; color: #81c784; border: 1px solid #2e7d32; }
.cs-message.cs-error   { background: #2a0f0f; color: #f0a0a0; border: 1px solid #e05555; }

/* ── Admin layout preview (keep light for admin usability) ── */
.cs-admin-grid-preview { background: #fafafa; border: 1px solid #e0e0e0; border-radius: 8px; padding: 20px; max-width: 720px; margin: 16px 0; }
.cs-admin-grid-preview .cs-seat { cursor: pointer; }
.cs-admin-grid-preview .cs-seat.cs-blocked-toggle { background: #eeeeee; border-color: #bdbdbd; color: #9e9e9e; border-style: dashed; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .cs-home-card { padding: 32px 20px; }
    .cs-home-title { font-size: 20px; }
    .cs-dash-header { flex-direction: column; align-items: flex-start; }
    .cs-grid { gap: 5px; }
    .cs-seat { min-width: 32px; min-height: 32px; }
    .cs-seat-id { font-size: 9px; }
    .cs-legend { gap: 10px; }
    .cs-dash-card-header { flex-direction: column; }
}
