/* EquiOrdo — Apple HIG inspired theme */

:root {
  --bs-border-radius: 12px;
  --bs-border-radius-sm: 8px;
  --bs-border-radius-lg: 16px;
  --bs-border-radius-xl: 20px;
  --bs-font-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --eq-sidebar-width: 260px;
  --eq-bottom-nav-height: 60px;
  --eq-touch-target: 44px;
}

/* ── Body & Layout ───────────────────────────────────────────── */

body {
  font-family: var(--bs-font-sans-serif);
  background-color: #f2f2f7;
  color: #1c1c1e;
  -webkit-font-smoothing: antialiased;
}

/* ── Cards ───────────────────────────────────────────────────── */

.card {
  border: none;
  border-radius: var(--bs-border-radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  background: #fff;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-weight: 600;
  padding: 1rem 1.25rem 0.75rem;
}

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
  border-radius: var(--bs-border-radius-sm);
  min-height: var(--eq-touch-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  padding-inline: 1rem;
}

.btn-sm {
  min-height: 36px;
  border-radius: 8px;
}

/* ── Forms ───────────────────────────────────────────────────── */

.form-control,
.form-select {
  border-radius: var(--bs-border-radius-sm);
  border: 1.5px solid #d1d1d6;
  min-height: var(--eq-touch-target);
  transition: border-color 0.15s;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.15);
}

label.form-label {
  font-weight: 500;
  font-size: 0.9rem;
  color: #3a3a3c;
  margin-bottom: 4px;
}

/* ── Top Navbar ──────────────────────────────────────────────── */

.eq-topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.eq-topbar .navbar-brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.3px;
}

/* ── Bottom Navigation (mobile) ──────────────────────────────── */

.eq-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--eq-bottom-nav-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 1029;
  padding-bottom: env(safe-area-inset-bottom);
}

.eq-bottom-nav__items {
  display: flex;
  height: 100%;
  align-items: stretch;
}

.eq-bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: #8e8e93;
  font-size: 10px;
  font-weight: 500;
  transition: color 0.1s;
  min-height: var(--eq-touch-target);
}

.eq-bottom-nav__item.active,
.eq-bottom-nav__item:hover {
  color: var(--bs-primary);
}

.eq-bottom-nav__item svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 767.98px) {
  .eq-bottom-nav {
    display: flex;
  }

  body {
    padding-bottom: calc(var(--eq-bottom-nav-height) + env(safe-area-inset-bottom));
  }

  /* Hide desktop nav links on mobile */
  .eq-topbar .eq-desktop-nav {
    display: none !important;
  }
}

/* ── Main content area ───────────────────────────────────────── */

.eq-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

@media (min-width: 768px) {
  .eq-main {
    padding: 2rem 1.5rem;
  }
}

/* ── Footer ──────────────────────────────────────────────────── */

.eq-footer {
  max-width: 1200px;
  margin: 0 auto 1.5rem;
  padding: 1.25rem 1rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.eq-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
}

.eq-footer__links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.8125rem;
}

.eq-footer__links a {
  color: #8e8e93;
  text-decoration: none;
}

.eq-footer__links a:hover {
  color: var(--stable-accent, var(--bs-primary));
  text-decoration: underline;
}

.eq-footer__sep {
  color: #c7c7cc;
  font-size: 0.75rem;
}

.eq-footer__copy {
  color: #aeaeb2;
  font-size: 0.75rem;
}

@media (min-width: 768px) {
  .eq-footer {
    padding: 1.25rem 1.5rem 0;
    margin-bottom: 2rem;
  }

  .eq-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* ── Legal pages ─────────────────────────────────────────────── */

.eq-legal-page {
  max-width: 780px;
}

.eq-legal-body {
  padding: 1.5rem 1.75rem;
  line-height: 1.7;
}

.eq-legal-body h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.eq-legal-body h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.35rem;
}

.eq-legal-body p,
.eq-legal-body li {
  font-size: 0.9rem;
  color: #3a3a3c;
}

/* ── Page header ─────────────────────────────────────────────── */

.eq-page-header {
  margin-bottom: 1.5rem;
}

.eq-page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0;
}

/* ── List items (iOS-style rows) ─────────────────────────────── */

.eq-list-group .list-group-item {
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 0.85rem 1.25rem;
  background: #fff;
  min-height: var(--eq-touch-target);
  display: flex;
  align-items: center;
}

.eq-list-group .list-group-item:first-child {
  border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0;
}

.eq-list-group .list-group-item:last-child {
  border-bottom: none;
  border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius);
}

/* ── Tables → Cards on mobile ────────────────────────────────── */

@media (max-width: 575.98px) {
  .eq-table-responsive thead {
    display: none;
  }
  .eq-table-responsive tr {
    display: block;
    background: #fff;
    border-radius: var(--bs-border-radius);
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 0.75rem 1rem;
  }
  .eq-table-responsive td {
    display: block;
    text-align: left;
    border: none;
    padding: 0.25rem 0;
  }
  .eq-table-responsive td::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    font-size: 0.8rem;
    color: #8e8e93;
  }
}

/* ── Alerts & Messages ───────────────────────────────────────── */

.eq-messages {
  position: fixed;
  top: 64px;
  right: 1rem;
  z-index: 2000;
  width: min(360px, calc(100vw - 2rem));
}

/* ── Booking Calendar ────────────────────────────────────────── */

.eq-cal-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  border-radius: var(--bs-border-radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.eq-cal-table {
  width: 100%;
  /* separate (not collapse) so that position:absolute slot-content
     renders above borders, not underneath them */
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  table-layout: fixed;   /* equal column widths */
  font-size: 0.78rem;
}

/* Mobile: make table wide enough for 2-day scroll view */
@media (max-width: 767.98px) {
  .eq-cal-table {
    width: calc(46px + 7 * 44vw);
  }
}

.eq-cal-table thead th {
  background: #f2f2f7;
  text-align: center;
  padding: 7px 4px;
  border-right: 1px solid #d1d1d6;
  border-bottom: 2px solid #c7c7cc;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eq-cal-time-col { width: 46px; }

.eq-cal-head.eq-cal-today {
  background: #fff0f0;
  color: #ff3b30;
  box-shadow: inset 2px 0 0 #ff3b30;
}

.eq-cal-time {
  text-align: right;
  padding: 0 6px;
  color: #8e8e93;
  white-space: nowrap;
  vertical-align: top;
  border-right: 2px solid #d1d1d6;
  border-bottom: 1px solid #e5e5ea;
  font-size: 0.72rem;
  line-height: 28px;
  background: #f9f9fb;
}

/* Verstärkte Linie jede volle Stunde (jede zweite Zeile = :00) */
.eq-cal-table tbody tr:nth-child(odd) .eq-cal-time {
  border-bottom: 1px solid #c7c7cc;
}
.eq-cal-table tbody tr:nth-child(odd) .eq-cal-cell {
  border-bottom: 1px solid #c7c7cc;
}

.eq-cal-cell {
  height: 28px;
  border-right: 1px solid #d1d1d6;
  border-bottom: 1px solid #e5e5ea;
  border-left: none;
  border-top: none;
  vertical-align: top;
  padding: 2px 3px;
  cursor: default;
  transition: background 0.1s;
}

.eq-cal-free        { background: #f8fff8; }
.eq-cal-partial     { background: #fffde7; }
.eq-cal-full        { background: #fff3f3; }
.eq-cal-today-col                    { box-shadow: inset 2px 0 0 #ff3b30; }
.eq-cal-today-col .eq-cal-slot-content { box-shadow: inset 2px 0 0 #ff3b30; }

.eq-cal-free[hx-get]    { cursor: pointer; }
.eq-cal-partial[hx-get] { cursor: pointer; }
.eq-cal-free[hx-get]:hover    { background: #e8f5e9; }
.eq-cal-partial[hx-get]:hover { background: #fff9c4; }

/* Parallel side-by-side booking layout */

/* Cells with booking content need position:relative so the absolutely
   positioned slot-content can fill and overlap cell boundaries. */
.eq-cal-cell {
  position: relative;
}

.eq-cal-slot-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 1px;
  pointer-events: none; /* clicks pass through to the <td> */
  z-index: 1;
}

/* The slot-content is positioned inside the padding-box; the cell's
   border-bottom is OUTSIDE and would show through. Remove it for cells
   that contain a booking block. */
.eq-cal-cell:has(.eq-cal-slot-content) {
  border-bottom: none !important;
}

/* Continuation rows: start 1 px early as sub-pixel safety margin. */
.eq-cal-bk-continuation .eq-cal-slot-content {
  top: -1px;
}

.eq-cal-booking-block {
  flex: 1;
  min-width: 0;
  border-left: 3px solid var(--stable-accent, var(--bs-primary));
  background: rgba(var(--bs-primary-rgb), 0.10);
  border-radius: 3px 5px 5px 3px;
  overflow: hidden;
  pointer-events: auto;
  cursor: pointer;
}

.eq-cal-booking-block:hover {
  filter: brightness(0.93);
}

/* Corner radius variants for multi-slot bookings */
.eq-cal-booking-block.bk-top    { border-radius: 3px 5px 0 0; }
.eq-cal-booking-block.bk-middle { border-radius: 0; }
.eq-cal-booking-block.bk-bottom { border-radius: 0 0 5px 3px; }

.eq-cal-col-ghost {
  flex: 1;
  min-width: 0;
}

.eq-cal-booking-start {
  padding: 1px 3px;
}

.eq-cal-booking-text {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1c1c1e;
}

.eq-cal-activity {
  display: block;
  font-size: 0.65rem;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eq-cal-facility-tag {
  display: block;
  font-size: 0.6rem;
  color: #8e8e93;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* All-day row */

.eq-cal-allday-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: #8e8e93;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-right: 2px solid #d1d1d6;
  border-bottom: 2px solid #c7c7cc !important;
  background: #f9f9fb;
}

.eq-cal-allday-cell {
  background: #fafafa;
  border-bottom: 2px solid #c7c7cc !important;
  vertical-align: top;
  padding: 3px 4px;
  cursor: pointer;
}

.eq-cal-booking-allday {
  border-left: 3px solid var(--stable-accent, var(--bs-primary));
  background: rgba(var(--bs-primary-rgb), 0.12);
  border-radius: 3px 5px 5px 3px;
  padding: 2px 5px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1c1c1e;
  margin-bottom: 2px;
  cursor: pointer;
}

.eq-cal-booking-allday:hover {
  filter: brightness(0.93);
}

.eq-cal-legend {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #dee2e6;
}

/* ── Now-line (current time indicator) ──────────────────────────── */

.eq-cal-table-wrap {
  position: relative;
}

.eq-cal-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #ff3b30;
  pointer-events: none;
  z-index: 10;
  display: none;
}

.eq-cal-now-dot {
  position: absolute;
  left: 42px; /* time col (46px) − half dot (4px) */
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3b30;
}

/* ── Stable accent color ─────────────────────────────────────── */

.eq-accent {
  color: var(--stable-accent, var(--bs-primary));
}

.eq-accent-bg {
  background-color: var(--stable-accent, var(--bs-primary));
}
