/* ===========================================
   RESERVATIONS STYLES
   Branch reservations, public booking wizard & slots
   =========================================== */

.reservations-container, .reservations-view {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.reservations-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.res-controls-wrap {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.res-control-search, .res-control-date, .reservation-form__input {
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--surface-white);
  color: var(--text-main);
  font-size: 0.9rem;
}

body.dark-theme .res-control-search,
body.dark-theme .res-control-date,
body.dark-theme .reservation-form__input {
  background: rgba(15, 23, 42, 0.6);
  border-color: var(--border-color-dark);
  color: var(--text-main-dark);
}

.res-control-btn {
  padding: 0.6rem 1rem;
  border-radius: 8px;
}

.table-responsive-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.reservations-table, .custom-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

body.dark-theme .reservations-table, body.dark-theme .custom-table {
  background: var(--surface-card-dark);
}

.reservations-table th, .reservations-table td,
.custom-table th, .custom-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

body.dark-theme .reservations-table th, body.dark-theme .reservations-table td,
body.dark-theme .custom-table th, body.dark-theme .custom-table td {
  border-bottom-color: var(--border-color-dark);
}

.reservation-row:hover {
  background: rgba(0, 82, 255, 0.03);
}

.allergy-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
}

/* Settings Drawer & Modal */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease-out;
}

.settings-overlay.active,
.settings-overlay.is-open {
  display: block !important;
  opacity: 1 !important;
}

.settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 90vw;
  background: #FFFFFF;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
  z-index: 10001;
  padding: 2rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-theme .settings-drawer {
  background: var(--surface-card-dark);
}

.settings-drawer.active,
.settings-drawer.is-open {
  transform: translateX(0) !important;
}

.settings-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.settings-drawer__title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
}

.settings-drawer__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.reservation-form__group {
  margin-bottom: 1.25rem;
}

.reservation-form__label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  display: block;
}

/* Booking Wizard Public Styling */
.booking-wizard {
  max-width: 760px;
  margin: 2rem auto 4rem;
  background: var(--surface-white);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08);
}

body.dark-theme .booking-wizard {
  background: var(--surface-card-dark);
  border-color: var(--border-color-dark);
}

.booking-brand-avatar, .booking-brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.booking-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  position: relative;
}

.booking-progress__bar {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: #E2E8F0;
  z-index: 0;
  transform: translateY(-50%);
}

.booking-progress__step {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #E2E8F0;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

.booking-progress__step--active {
  background: var(--brand-accent);
  color: #FFFFFF;
  box-shadow: 0 0 0 4px var(--brand-accent-glow);
}

.booking-step {
  display: none;
}

.booking-step--active {
  display: block;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.slots-grid-placeholder {
  text-align: center;
  padding: 1.5rem 1.25rem;
  color: var(--text-muted, #64748B);
  font-size: 0.85rem;
  background: var(--bg-light, #F8FAFC);
  border: 1px dashed var(--border-color, #E2E8F0);
  border-radius: 12px;
  grid-column: 1 / -1;
}

.booking-alert {
  display: none;
  padding: 0.9rem 1.25rem;
  border-radius: 12px;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.booking-alert--error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #EF4444;
}

.booking-alert--success {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10B981;
}

/* Slot Selection Buttons */
.slot-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-color, #E2E8F0);
  background: var(--surface-white, #FFFFFF);
  color: var(--text-main, #0F172A);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
}

.slot-btn:hover:not(:disabled) {
  border-color: var(--brand-accent, #0052FF);
  color: var(--brand-accent, #0052FF);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 82, 255, 0.12);
}

.slot-btn--active {
  background: var(--brand-accent, #0052FF) !important;
  color: #FFFFFF !important;
  border-color: var(--brand-accent, #0052FF) !important;
  box-shadow: 0 4px 14px var(--brand-accent-glow, rgba(0, 82, 255, 0.3)) !important;
}

.slot-btn--active .slot-btn__status {
  color: rgba(255, 255, 255, 0.95) !important;
}

.slot-btn--disabled {
  opacity: 0.45;
  background: #F1F5F9 !important;
  border-color: #E2E8F0 !important;
  color: #94A3B8 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}

.slot-btn__status {
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 2px;
  color: var(--text-muted, #64748B);
}

/* ===========================================
   RESPONSIVE DESIGN (TABLET & MOBILE PRIMARIES)
   =========================================== */

/* Tablet View (768px - 1024px) - Principal Device */
@media (max-width: 1024px) {
  .reservations-container, .reservations-view {
    padding: 1rem 0;
  }

  .dashboard-panel-card {
    padding: 1.25rem !important;
    border-radius: 12px !important;
  }

  .res-controls-wrap {
    width: 100%;
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .res-control-search {
    flex-grow: 1;
    min-width: 200px;
  }

  .res-control-date {
    width: auto;
    min-width: 150px;
  }

  .custom-table th, .custom-table td {
    padding: 0.75rem 0.85rem !important;
    font-size: 0.82rem !important;
  }

  .btn-res-tab {
    padding: 5px 14px !important;
    font-size: 0.8rem !important;
  }

  .settings-drawer {
    width: 380px;
  }
}

/* Mobile View (< 768px) - Secondary Device */
@media (max-width: 767px) {
  .main-panel__header {
    margin-bottom: 0.75rem !important;
    padding-bottom: 0.5rem !important;
  }

  .main-panel__title {
    font-size: 1.35rem !important;
  }

  .main-panel__subtitle {
    font-size: 0.82rem !important;
  }

  .dashboard-panel-card {
    padding: 1rem !important;
    border-radius: 10px !important;
  }

  #res-tabs-wrapper {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .btn-res-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .res-controls-wrap {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .res-control-search, .res-control-date, .res-control-btn {
    width: 100% !important;
  }

  .custom-table th, .custom-table td {
    padding: 0.65rem 0.6rem !important;
    font-size: 0.78rem !important;
  }

  .settings-drawer {
    width: 100%;
  }
}

/* ==========================================================================
   Weekly Operating Schedule & Switches
   ========================================================================== */
.schedule-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  margin: 0;
  flex-shrink: 0;
}

.schedule-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.schedule-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #CBD5E1;
  transition: .2s ease;
  border-radius: 20px;
}

.schedule-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.schedule-switch input:checked + .schedule-slider {
  background-color: #10B981;
}

.schedule-switch input:checked + .schedule-slider:before {
  transform: translateX(16px);
}

.schedule-day-row--closed {
  background-color: #F8FAFC !important;
  border-color: #E2E8F0 !important;
}

.schedule-day-row--closed .schedule-time-inputs {
  opacity: 0.35 !important;
  pointer-events: none !important;
}

.schedule-time-field:focus {
  border-color: #2563EB !important;
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

