/* ==========================================================================
   reserveTable-theme.css
   Visual layer for Views/Reserve/ReservesTable.cshtml

   Loaded AFTER reserveTable.css. It only restyles - no class is renamed,
   added or removed, so every JS hook in datepicker_reserveTable.js and
   js.js keeps working exactly as before.

   Two things must keep winning over this file:
     1. the per-row price-package colours the Razor page emits
        (`td a.<Package> { background-color: X !important }`)
     2. the room-group separators the Razor page emits
        (`td:nth-child(N) { border-left: var(--roomSeprator) ... }`)
   Both are inline <style> blocks that come after this link, so they still
   win. Nothing below raises specificity on `td a` backgrounds or on
   `td/th` border-left.

   Perf note: the crosshair hover adds/removes a class on a whole row AND a
   whole column at once (hundreds of cells). Nothing in the table grid gets
   a transition, shadow or filter for that reason.
   ========================================================================== */

:root {
  /* --- surface / chrome ------------------------------------------------ */
  --rt-page: #1b1e24;
  --rt-page-2: #23272f;
  --rt-card: #ffffff;
  --rt-card-soft: #f4f6f9;
  --rt-card-border: #dfe4ec;
  --rt-ink: #1c222b;
  --rt-ink-soft: #5b6472;
  --rt-ink-faint: #8b95a5;
  --rt-accent: #3b82f6;
  --rt-accent-deep: #1d4ed8;
  --rt-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.75);
  --rt-shadow-sm: 0 6px 16px -10px rgba(0, 0, 0, 0.55);
  --rt-radius: 14px;
  --rt-radius-sm: 8px;

  /* --- table -----------------------------------------------------------  */
  --rt-head-1: #1f242e; /* bed-type row   */
  --rt-head-2: #2b3240; /* capacity row   */
  --rt-head-3: #3a4354; /* room-number row */
  --rt-head-ink: #e7ecf4;
  --rt-grid: #d7dde6;

  /* --- overrides of reserveTable.css variables ------------------------- */
  --color1: #eef1f6; /* date + weekday columns */
  --color2: #3a4354; /* generic hover fill     */
  --color3: #222222;
  --color4: #ccd5e2; /* weekday cell on hover  */

  --colorFull: #0b5d2b;
  --colorFullHover: #2f8c52;
  --colorReserve: #8c1122;
  --colorReserveHover: #b3444f;
  --colorPast: #14181f;
  --colorPastHover: #3b424d;
  --colorBeforReserve: #4a067a;
  --colorBeforReserveHover: #7c50a0;

  --roomSeprator: 4px;
  --colorRoomSeprator: #0ea5e9;
}

/* ==========================================================================
   1. Page chrome
   ========================================================================== */

body {
  background-color: var(--rt-page);
  background-image: radial-gradient(
    120% 80% at 50% 0%,
    var(--rt-page-2) 0%,
    var(--rt-page) 60%
  );
  background-attachment: fixed;
}

/* Section titles - "وضعیت اتاق‌ها" / "نمای کلی اتاق‌ها".
   Width is set inline by adjustElements(), so only paint + type here. */
h3.text-center.text-white {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2.25rem auto 1.5rem auto;
  font-size: 1.4rem;
  font-weight: 700;
  color: #f2f5fa;
}

h3.text-center.text-white::before,
h3.text-center.text-white::after {
  content: "";
  flex: 1 1 0;
  max-width: 9rem;
  height: 1px;
  background: linear-gradient(
    to var(--rt-line-dir, left),
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.28) 100%
  );
}

h3.text-center.text-white::after {
  --rt-line-dir: right;
}

/* ==========================================================================
   2. Cards  (.alertBox — nightly stats, checkout lists, reminders)
   ========================================================================== */

.alertBox {
  background-color: var(--rt-card);
  color: var(--rt-ink);
  max-width: 66rem;
  padding: 1.5rem 1.75rem 1.75rem 1.75rem;
  border: 1px solid var(--rt-card-border);
  border-radius: var(--rt-radius);
  box-shadow: var(--rt-shadow);
  margin: 0 auto 1.75rem auto;
}

/* The stats form (آمار دیشب / آمار امشب) reads as a toolbar strip. */
.alertBox > .mb-4 {
  background: var(--rt-card-soft);
  border: 1px solid var(--rt-card-border);
  border-radius: var(--rt-radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem !important;
}

.alertBox > .mb-4 form {
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.alertBox > .mb-4 form > span:first-child {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--rt-ink);
  white-space: nowrap;
}

.alertBox .form-control {
  border: 1px solid var(--rt-card-border);
  border-radius: var(--rt-radius-sm);
  background-color: #fff;
  font-size: 0.9rem;
  padding: 0.42rem 0.7rem;
  box-shadow: none;
}

.alertBox .form-control:focus {
  border-color: var(--rt-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.alertBox .btn-success {
  background-color: #15803d;
  border-radius: var(--rt-radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.42rem 1rem;
  white-space: nowrap;
}

.alertBox .btn-success:hover {
  background-color: #166534;
}

/* Submitted / not-submitted headcount badge */
.passengers-count {
  width: 2.1rem;
  height: 2.1rem;
  min-width: 2.1rem;
  font-size: 1.35rem;
  border-radius: var(--rt-radius-sm);
  margin: 0;
  box-shadow: var(--rt-shadow-sm);
}

.count-checked {
  background-color: #15803d;
}

.count-not-checked {
  background-color: #b91c1c;
}

.passengers-count:hover {
  opacity: 0.85;
}

/* Card title — "اتاق هایی که امروز تخلیه می‌شوند" */
.titleAlert {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--rt-ink);
}

.titleAlert .bg-dark {
  background-color: var(--rt-ink) !important;
  border-radius: 999px !important;
  padding: 0.2rem 0.7rem !important;
  font-size: 0.9rem;
}

/* ==========================================================================
   3. Guest cards  (.folioAlert)
   ========================================================================== */

.alertDiv {
  gap: 0.35rem;
  padding-top: 0.5rem;
}

.folioAlert {
  background-color: #fff;
  border: 1px solid var(--rt-card-border);
  border-radius: 10px;
  border-top-right-radius: 0;
  box-shadow: var(--rt-shadow-sm);
  width: 10.5rem;
  height: 8.25rem;
  padding: 2.5rem 0.75rem 0.75rem 0.75rem;
  margin: 2.5rem 0.55rem 0.75rem 0.55rem;
}

.folioAlert:hover {
  border-color: #b9c4d4;
  box-shadow: 0 10px 22px -12px rgba(0, 0, 0, 0.45);
}

/* Room-number tab sitting on top of the card */
.roomAlert {
  background: linear-gradient(180deg, #3a4354 0%, #2b3240 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.28rem 0.8rem;
  top: -28px;
  right: -1px;
  border-top-right-radius: 8px;
  border-top-left-radius: 8px;
  box-shadow: var(--rt-shadow-sm);
}

.folioAlert .Code {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--rt-ink);
  letter-spacing: 0.02em;
}

.folioAlert .Name {
  font-size: 0.85rem;
  color: var(--rt-ink-soft);
  line-height: 1.5;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folioAlert a.Name:hover {
  color: var(--rt-accent-deep);
  opacity: 1;
}

.HourHafDay {
  font-size: 0.8rem;
  font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  display: inline-block;
  margin-top: 0.35rem;
}

/* "تخلیه شد" toggle */
.alertCheck {
  top: 0.45rem;
  left: 0.45rem;
  width: 5.4rem;
  height: 1.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
  gap: 0.15rem;
}

.isChecked {
  background-color: #dcfce7;
  border-color: #86efac;
  color: #14532d;
}

.notchecked {
  background-color: #fee2e2;
  border-color: #fca5a5;
  color: #7f1d1d;
}

.alertCheck:hover {
  filter: brightness(0.96);
}

.alertCheck i {
  font-size: 0.95rem !important;
}

/* ==========================================================================
   4. Problem rooms
   ========================================================================== */

.roomProblem {
  border: 1px solid var(--rt-card-border);
  background: var(--rt-card-soft);
  border-radius: var(--rt-radius-sm);
  padding: 0.5rem 0.65rem;
  margin: 0.4rem 0.35rem 0 0;
  font-size: 0.9rem;
}

.roomProblem > span:first-child {
  border-radius: 6px !important;
  font-size: 0.85rem;
}

.moveRoomProblem span {
  background-color: #3a4354;
  border: 1px solid #2b3240;
  border-radius: var(--rt-radius-sm);
  padding: 0.42rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.75rem 0 0 0.5rem;
}

.moveRoomProblem span:hover {
  background-color: #4b5566;
}

/* ==========================================================================
   5. Filter bar
   ========================================================================== */

/* `backdrop-filter` creates a stacking context, which traps the Vue
   datepicker's popup (.pdp-picker, z-index 1001) inside this element. A
   non-positioned stacking context paints BELOW positioned z-index:auto
   content, and every `td` is `position: relative` (reserveTable.css), so
   the popup ended up under the grid.

   position+z-index is therefore required, not cosmetic: it lifts the whole
   subtree above the sticky header cells (z-index 99-101) so the popup can
   overhang the table. Do not remove it, and do not add overflow/transform/
   filter here for the same reason. */
#filterBox {
  position: relative;
  z-index: 300;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--rt-radius);
  padding: 0.5rem 1rem !important;
  backdrop-filter: blur(6px);
}

/* The picker's click-outside overlay is `position: fixed` and must stay on
   top of the grid as well. */
#filterBox .pdp .pdp-overlay {
  z-index: 300;
}

#filterBox form {
  gap: 0.5rem;
  align-items: center;
}

#filterBox form > button {
  margin: 4px 0;
}

#filterBox .btn {
  border-radius: var(--rt-radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.45rem 1.1rem;
}

#filterBox .btn-secondary {
  background-color: #4b5566;
}

#filterBox .btn-secondary:hover {
  background-color: #5a6577;
}

#filterBox .btn-info {
  background-color: #0e7490;
  color: #fff;
}

#filterBox .btn-info:hover {
  background-color: #155e75;
  color: #fff;
}

#filterBox label {
  font-size: 0.85rem;
  color: #cdd5e1;
}

#filterBox .form-check-input {
  border: 1px solid #6b7686;
  background-color: #2b3240;
}

#filterBox .form-check-input:checked {
  background-color: var(--rt-accent);
  border-color: var(--rt-accent);
}

/* ==========================================================================
   6. The grid
   ========================================================================== */

/* No padding rules on .tableFixHead — adjustElements() writes an inline
   `padding` shorthand on it, which would win anyway. */
#myTable {
  background-color: #fff;
  border-radius: var(--rt-radius-sm);
  box-shadow: var(--rt-shadow);
  font-variant-numeric: tabular-nums;
}

/* --- header ---------------------------------------------------------- */

/* Stack the three header rows instead of piling them all on top: 0, so the
   bed-type, capacity and room-number context all stay visible while
   scrolling. Heights are explicit because `top` offsets depend on them. */
#myTable thead tr:nth-child(1) th {
  top: 0;
  height: 2.15rem;
  z-index: 101;
  background-color: var(--rt-head-1) !important;
  font-size: 0.78rem;
}

#myTable thead tr:nth-child(2) th {
  top: 2.15rem;
  height: 2.15rem;
  z-index: 100;
  background-color: var(--rt-head-2) !important;
  font-size: 0.72rem;
}

#myTable thead tr.fixedTr th {
  top: 4.3rem;
  height: 2.5rem;
  z-index: 99;
  background-color: var(--rt-head-3) !important;
  font-size: 0.8rem;
  font-weight: 700;
  border-bottom: 2px solid var(--rt-accent);
}

#myTable thead th {
  color: var(--rt-head-ink);
  line-height: 1.2;
}

/* Deliberately kept at (0,0,2) — LOWER than the Razor-generated
   `th:nth-child(N) { border-left: ... }` separators at (0,1,1) — so the
   room-group separators keep their own colour and width in the header.
   Raising this to `#myTable thead th` silently repaints them. */
thead th {
  border-color: rgba(255, 255, 255, 0.11);
}

#myTable thead th a {
  color: var(--rt-head-ink);
  font-weight: 600;
}

#myTable thead th a:hover {
  color: #fff;
}

#myTable thead th a:hover:not(.nohover) {
  background-color: rgba(255, 255, 255, 0.14);
  color: #fff;
}

#myTable thead th a.nohover {
  color: #b7c1d1;
  font-weight: 500;
}

/* --- body ------------------------------------------------------------- */

td {
  border-color: var(--rt-grid);
}

tbody tr:nth-child(even) {
  background-color: #f7f9fc;
}

td a {
  font-size: 0.8rem;
  line-height: 1.15;
}

/* Occupancy states: same semantics and near-identical hues as before, just
   higher contrast text so folio codes stay readable at this density. */
td a.fill,
td a.reserve,
td a.past,
td a.beforReserve {
  color: #ffffff;
  font-weight: 700;
}

/* Crosshair highlight. Kept above the zebra stripe with an id-scoped
   selector — striping alone would otherwise out-specify `.hover-row`. */
#myTable td.hover-column,
#myTable td.hover-row {
  background-color: #dce6f5;
}

#myTable td.hover-cell {
  background-color: #b9cbe8;
}

#myTable .hover-row .dayOfWeek,
#myTable .hover-column .dayOfWeek {
  background-color: var(--color4);
}

/* Date + weekday axis columns */
.date,
.dayOfWeek {
  font-weight: 600;
  color: var(--rt-ink);
}

.dayOfWeek {
  font-size: 0.75rem;
  color: var(--rt-ink-soft);
}

/* Today */
.RowIsNow {
  border-top: 3px solid var(--rt-accent);
}

.todayRow {
  background-color: #111827;
  color: #fff;
  font-weight: 800;
}

/* Full-capacity chips (S / D / TW / DS / 4) in the leading column */
.fullCapacity {
  gap: 2px;
  padding: 2px !important;
}

.fullCapacity span {
  padding: 2px 5px;
  margin: 0;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.4;
}

.fullCapacity .isFullCapacity {
  background-color: #b91c1c;
}

.fullCapacity .notFullCapacity {
  background-color: #e8ecf2;
  color: var(--rt-ink-faint);
}

.fullCapacity span:hover {
  filter: brightness(1.12);
}

/* ==========================================================================
   7. Refresh button
   ========================================================================== */

.btnRefresh {
  background-color: #f5c518;
  border: 1px solid #d4a707;
  border-radius: 999px;
  font-weight: 700;
  padding: 0.6rem 1.5rem;
  box-shadow: var(--rt-shadow);
}

.btnRefresh:hover {
  background-color: #ffd633;
  opacity: 1;
}

/* ==========================================================================
   8. Scrollbars
   ========================================================================== */

* {
  scrollbar-color: #4b5566 transparent;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
}

::-webkit-scrollbar-thumb {
  background: #4b5566;
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #667286;
  background-clip: content-box;
}

/* ==========================================================================
   9. Responsive
   Re-declares the narrow-screen separator width, because this file loads
   after reserveTable.css and would otherwise clobber its media query.
   ========================================================================== */

@media only screen and (max-width: 1200px) {
  .alertBox {
    padding: 1.25rem;
  }
}

@media only screen and (max-width: 990px) {
  :root {
    --roomSeprator: 3px;
  }

  h3.text-center.text-white {
    font-size: 1.15rem;
    margin: 1.5rem auto 1rem auto;
  }

  h3.text-center.text-white::before,
  h3.text-center.text-white::after {
    max-width: 3rem;
  }

  .folioAlert {
    scale: 0.85;
    margin: 2.25rem -4px 0 -4px;
  }

  #filterBox {
    padding: 0.5rem !important;
  }
}
