/* RaniTech Booking v4 visual hardening and responsive polish */
:root {
  --rt-radius-sm: 12px;
  --rt-radius-md: 18px;
  --rt-radius-lg: 24px;
  --rt-shadow-soft: 0 12px 32px rgba(18, 48, 86, 0.09);
  --rt-shadow-card: 0 20px 55px rgba(18, 48, 86, 0.13);
}

html, body, #root { min-height: 100%; }
body {
  min-width: 320px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.public-page,
.admin-shell,
.customer-shell,
.login-page { min-height: 100vh; }

.public-header {
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.94);
}

.public-header nav a,
.btn,
.icon-btn,
.business-tabs button,
.customer-mobile-nav button,
.admin-mobile-nav button { -webkit-tap-highlight-color: transparent; }

.btn:focus-visible,
.icon-btn:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(21, 101, 216, 0.24);
  outline-offset: 2px;
}

.section-heading { max-width: 760px; }
.section-heading.centered { margin-left: auto; margin-right: auto; }

.booking-card,
.public-schedule-card,
.panel,
.customer-card,
.customer-booking-card,
.settings-section,
.toolbar-card {
  box-shadow: var(--rt-shadow-soft);
}

.court-cards { align-items: stretch; }
.court-cards article,
.admin-court-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: var(--rt-radius-md);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.court-cards article:hover,
.admin-court-card:hover {
  transform: translateY(-5px);
  border-color: #c9ddf3;
  box-shadow: var(--rt-shadow-card);
}
.court-card-body,
.admin-court-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.court-card-body > div:first-child { align-items: flex-start; }
.court-card-body h3,
.admin-court-body h3 { overflow-wrap: anywhere; }
.court-card-body ul {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 14px 0 18px;
}
.court-card-body li {
  min-width: 0;
  overflow-wrap: anywhere;
  border: 1px solid #e6edf6;
  background: #f8fbff;
  padding: 8px 10px;
  border-radius: 10px;
}
.court-card-body .btn,
.admin-court-body .btn { margin-top: auto; }

.booking-card { border-radius: var(--rt-radius-lg); }
.booking-grid label,
.form-grid label { min-width: 0; }
.booking-summary {
  gap: 20px;
  padding: 22px;
  margin-left: -4px;
  margin-right: -4px;
  border: 1px solid #dbe8f6;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fbff, #eef6ff);
}
.booking-summary .btn { flex: 0 0 auto; }

.public-schedule-card {
  border-radius: var(--rt-radius-lg);
  box-shadow: var(--rt-shadow-card);
}
.schedule-list > div:not(.public-empty) {
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.schedule-list > div:not(.public-empty):hover {
  transform: translateX(3px);
  border-color: #bbd5f1;
  box-shadow: 0 8px 22px rgba(26, 82, 145, 0.09);
}

.schedule-board {
  border-radius: 18px;
  border: 1px solid #dbe7f4;
  background: #fff;
  box-shadow: var(--rt-shadow-soft);
  scrollbar-color: #b9c9da #eef4fa;
  scrollbar-width: thin;
}
.schedule-board-head {
  position: sticky;
  top: 0;
  z-index: 4;
  background: linear-gradient(180deg, #f7faff, #edf4fc);
}
.schedule-board-head > div,
.time-column { border-color: #dce7f2; }
.schedule-row:nth-child(even) { background: #fbfdff; }
.slot-cell { min-width: 0; }
.slot-cell.available {
  background: linear-gradient(135deg, #fbfffd, #f3faf6);
  color: #488167;
}
.slot-cell.occupied > div {
  min-height: 54px;
  background: linear-gradient(135deg, #edf6ff, #e2f0ff);
  border-left-width: 4px;
  box-shadow: 0 6px 14px rgba(21, 101, 216, 0.08);
}
.schedule-toolbar { position: relative; z-index: 5; }
.schedule-toolbar input,
.schedule-toolbar select { min-width: 150px; }

.panel,
.toolbar-card,
.customer-card { border-radius: 17px; }
.panel-head { gap: 16px; }
.table-wrap { scrollbar-color: #bdcad8 #eef3f8; scrollbar-width: thin; }
table { border-collapse: separate; border-spacing: 0; }
thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f5f9fd;
  box-shadow: inset 0 -1px #dbe5ef;
}
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #f7fbff; }

.customer-welcome,
.welcome-panel { box-shadow: var(--rt-shadow-card); }
.customer-stat-grid article,
.metric-grid article { min-width: 0; }
.customer-stat-grid strong,
.metric-grid strong { overflow-wrap: anywhere; }

.admin-content,
.customer-content { min-width: 0; }
.admin-main,
.customer-main { min-width: 0; }

.asset-load-error {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 99999;
  max-width: 760px;
  margin: auto;
  padding: 15px 18px;
  border: 1px solid #ffd2d8;
  border-radius: 14px;
  background: #fff1f3;
  color: #8c2331;
  font: 600 14px/1.5 Arial, sans-serif;
  box-shadow: 0 18px 50px rgba(90, 24, 34, .22);
}

@media (max-width: 1100px) {
  .section-shell,
  .hero-grid { width: min(100% - 32px, 1180px); }
  .court-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-court-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .public-header { height: 68px; padding-left: 16px; padding-right: 16px; }
  .public-brand img { width: 42px; height: 42px; }
  .public-brand strong { font-size: 18px; }
  .hero-grid { min-height: auto; padding-top: 54px; padding-bottom: 54px; }
  .hero-copy h1 { font-size: clamp(34px, 8vw, 46px); }
  .booking-section,
  .schedule-section,
  .courts-section,
  .faq-section { padding-top: 58px; padding-bottom: 58px; }
  .booking-card { padding: 22px; }
  .public-schedule-card { grid-template-columns: 1fr; }
  .schedule-date { min-height: 150px; justify-content: flex-start; padding: 28px; }
  .success-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .schedule-toolbar { align-items: stretch; }
  .schedule-toolbar input,
  .schedule-toolbar select,
  .schedule-toolbar .btn { width: 100%; min-width: 0; }
}

@media (max-width: 620px) {
  .section-shell,
  .hero-grid { width: min(100% - 22px, 1180px); }
  .court-cards,
  .admin-court-grid { grid-template-columns: 1fr; gap: 15px; }
  .court-photo,
  .court-visual { height: 185px; }
  .court-card-body { padding: 17px; }
  .court-card-body > div:first-child { flex-direction: column; }
  .court-card-body strong { white-space: normal; }
  .court-card-body ul { grid-template-columns: 1fr 1fr; gap: 7px; }
  .booking-card { padding: 17px; border-radius: 18px; }
  .booking-grid,
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .span-2 { grid-column: auto; }
  .booking-summary {
    flex-direction: column;
    align-items: stretch;
    padding: 17px;
  }
  .booking-summary .btn { width: 100%; }
  .booking-summary strong { font-size: 27px; }
  .schedule-list { padding: 14px; }
  .schedule-list > div:not(.public-empty) { grid-template-columns: 40px minmax(0, 1fr); }
  .schedule-list > div:not(.public-empty) > :last-child { grid-column: 2; justify-self: start; }
  .success-details { grid-template-columns: 1fr; }
  .success-actions { flex-direction: column; }
  .success-actions .btn { width: 100%; }
  .toolbar-card,
  .panel-head { align-items: stretch; flex-direction: column; }
  .toolbar-card > .btn,
  .panel-head > .btn { width: 100%; }
  .inline-filter { width: 100%; flex-direction: column; align-items: stretch; }
  .inline-filter input,
  .inline-filter select,
  .inline-filter .btn { width: 100%; }
  .modal { width: calc(100% - 18px); max-height: calc(100vh - 18px); border-radius: 18px; }
}

@media (max-width: 420px) {
  .court-card-body ul { grid-template-columns: 1fr; }
  .customer-stat-grid { grid-template-columns: 1fr; }
  .btn { padding-left: 14px; padding-right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
