/* --- PAGE SPECIFIC OVERRIDES --- */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--deep-midnight);
}

/* Confine table container height to enable internal vertical scrolling */
.table-container {
  background: var(--bright-sky);
  border: 1px solid var(--golden-hour);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgb(0 0 0 / 20%);
  width: 100%;
  box-sizing: border-box;
  color: var(--deep-midnight);
  padding: 0 0 15px;
  overflow: auto;
  max-height: 70vh;
  -webkit-overflow-scrolling: touch;
}

#record-count {
  margin-left: auto;
  font-style: italic;
  color: #888;
  font-size: 0.85rem;
  padding-bottom: 10px;
  white-space: nowrap;
}

.control-group input {
  padding: 0 12px;
  border-radius: 8px;
  color: var(--deep-midnight);
  font-family: Montserrat, sans-serif;
  font-size: 15px;
  width: 100%;
  box-sizing: border-box;
  line-height: normal;
  border: 1px solid #ccc;
  box-shadow: 0 2px 4px rgb(0 0 0 / 10%);
  height: 44px;
}

.control-group input[type="date"] {
  appearance: none;
  display: block;
  padding-top: 10px;
  padding-bottom: 10px;
  background-color: var(--golden-hour);
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.crowd-bar-input-wrapper {
  position: relative;
  height: 44px;
  width: 100%;
  background: #eee;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 4px rgb(0 0 0 / 10%);
}

#max-crowd {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 10;
  cursor: pointer;
  margin: 0;
}

#crowd-bar-fill {
  height: 100%;
  width: 100%;
  background: var(--golden-hour);
  transition: width 0.1s ease;
}

#crowd-bar-label {
  position: absolute;
  width: 100%;
  text-align: center;
  font-weight: 700;
  color: var(--deep-midnight);
  z-index: 5;
  font-size: 0.9rem;
  pointer-events: none;
}

.dropdown-check-list .anchor::after {
  content: "\f0d7";
  font-family: "Font Awesome 5 Free", sans-serif;
  font-weight: 900;
  position: absolute;
  right: 12px;
  font-size: 1rem;
  color: var(--deep-midnight);
}

.dropdown-check-list .items {
  right: 0;
}

.btn-all {
  background: var(--golden-hour);
  color: var(--deep-midnight);
}

.btn-none {
  background: #eee;
  color: #777;
}

/* --- STICKY TABLE STYLING --- */
.price-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
  text-align: center;
}

.price-table thead th {
  background-color: var(--deep-midnight);
  color: var(--bright-sky);
  padding: 12px 4px;
  border-bottom: 2px solid var(--golden-hour);
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

.price-table tbody td {
  padding: 10px 4px;
  border-bottom: 1px solid #eee;
  color: var(--deep-midnight);
}

.price-table th:first-child,
.price-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 25;
  background-color: white !important;
  border-right: 2px solid #eee;
  padding-left: 15px !important;
  text-align: left;
  white-space: nowrap !important;
  cursor: pointer;
}

.price-table thead th:first-child {
  z-index: 30;
  background-color: var(--deep-midnight) !important;
  color: var(--bright-sky) !important;
  top: 0;
  left: 0;
}

.bg-low {
  background-color: #d4edda;
  color: #155724;
}

.bg-med {
  background-color: #fff3cd;
  color: #856404;
}

.bg-high {
  background-color: #ffe5d0;
  color: #855d04;
}

.bg-peak {
  background-color: #f8d7da;
  color: #721c24;
}

.bg-unavailable {
  background-color: #f8f9fa;
  color: #adb5bd !important;
  font-style: italic;
}

.upgrade-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: var(--golden-hour);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgb(0 0 0 / 15%);
  margin: 10px auto;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.upgrade-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgb(0 0 0 / 22%);
}

.upgrade-link {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  color: var(--deep-midnight) !important;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: underline;
  width: auto !important;
}

.upgrade-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* Toast Notification Styling Overrides */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  border-radius: 8px;
  z-index: 10000;
  box-shadow: 0 8px 20px rgb(0 0 0 / 30%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media (width <= 600px) {
  .controls-bar {
    grid-template-columns: 1fr 1fr;
    display: grid;
    padding: 15px !important;
  }

  .controls-header,
  #record-count {
    grid-column: 1 / -1;
  }

  .control-group {
    min-width: 0;
  }

  .nav-back-btn {
    width: calc(50% - 10px) !important;
  }

  .radio-group {
    padding: 10px 6px;
    font-size: 0.75rem;
    flex-direction: column;
    height: auto;
    align-items: flex-start;
    gap: 8px;
  }

  #days-dropdown .items {
    right: auto;
    left: 0;
  }
}

/* =========================================
   DARK MODE OVERRIDES
   ========================================= */
body.dark-mode .table-container {
  background-color: var(--deep-midnight);
  border: 1px solid var(--golden-hour);
}

body.dark-mode .price-table tbody td {
  border-bottom: 1px solid #444;
}

body.dark-mode .price-table th:first-child,
body.dark-mode .price-table td:first-child {
  background-color: var(--deep-midnight) !important;
  border-right: 2px solid #444;
  color: var(--bright-sky);
}

body.dark-mode .price-table td:nth-child(2) {
  color: var(--bright-sky);
}

body.dark-mode .btn-none {
  background: #444;
  color: #ccc;
}

body.dark-mode .crowd-bar-input-wrapper {
  background: #444;
}

/* DataTables specifically injects some white backgrounds we need to clear in dark mode */
/* stylelint-disable selector-class-pattern, no-descending-specificity */
body.dark-mode .dataTables_wrapper .dataTables_info,
body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--bright-sky) !important;
}

body.dark-mode table.dataTable.display > tbody > tr.odd > .sorting_1,
body.dark-mode
  table.dataTable.order-column.stripe
  > tbody
  > tr.odd
  > .sorting_1 {
  box-shadow: none !important;
}

body.dark-mode table.dataTable.display > tbody > tr.even > .sorting_1,
body.dark-mode
  table.dataTable.order-column.stripe
  > tbody
  > tr.even
  > .sorting_1 {
  box-shadow: none !important;
}
/* stylelint-enable selector-class-pattern, no-descending-specificity */

/* =========================================
   EXTRACTED INLINE STYLES
   ========================================= */

.date-display-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.date-display-icon {
  width: 16px;
  height: 16px;
}

#empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 40px;
}

.empty-state-icon {
  font-size: 2.5rem;
  color: #ccc;
  margin-bottom: 10px;
}

#empty-title {
  margin: 0;
  color: inherit;
}

#empty-text {
  color: #666;
  max-width: 300px;
  text-align: center;
}

#main-table {
  display: none;
  width: 100%;
}

.express-pass-icon {
  width: 12px;
}

#plus-upgrade-note {
  display: none;
}

.upgrade-card-icon {
  width: 30px;
}

/* =========================================
   60+ DAY TEASER ROWS & OVERLAY
   ========================================= */
.plus-teaser-wrap {
  display: none;
  position: relative;
  width: 100%;
  border-top: 2px dashed var(--golden-hour);
  overflow: hidden;
  padding-bottom: 10px;
}

.teaser-rows-backdrop {
  width: 100%;
  pointer-events: none;
  user-select: none;
  opacity: 0.72;
}

.teaser-price-table {
  table-layout: fixed;
}

.teaser-blur-cell {
  filter: blur(5px);
}

.teaser-overlay-banner {
  position: sticky;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 16px 15px 6px;
  margin-top: -115px;
  box-sizing: border-box;
  z-index: 28;
  background: linear-gradient(
    to bottom,
    rgb(255 255 255 / 15%) 0%,
    rgb(255 255 255 / 92%) 45%,
    var(--bright-sky) 100%
  );
}

body.dark-mode .teaser-overlay-banner {
  background: linear-gradient(
    to bottom,
    rgb(27 32 50 / 15%) 0%,
    rgb(27 32 50 / 92%) 45%,
    var(--deep-midnight) 100%
  );
}

.teaser-pitch-card {
  max-width: 480px;
  padding: 20px 24px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 22%);
}

.plus-top-upsell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  padding: 12px 18px;
  background: var(--bright-sky);
  border: 1px solid var(--golden-hour);
  border-radius: 12px;
  color: var(--deep-midnight);
  box-shadow: 0 4px 12px rgb(0 0 0 / 12%);
}

.plus-top-upsell.hidden {
  display: none;
}

.plus-top-upsell-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

.plus-top-upsell-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.plus-top-upsell-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin: 0;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--golden-hour);
  color: var(--deep-midnight);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgb(225 166 60 / 35%);
  transition:
    transform 0.2s,
    filter 0.2s;
}

.plus-top-upsell-cta:hover {
  background: #f1b74d;
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.plus-top-upsell-cta:focus-visible {
  outline: 2px solid var(--golden-hour);
  outline-offset: 2px;
}

body.dark-mode .plus-top-upsell {
  background: var(--deep-midnight);
  color: var(--bright-sky);
}

.price-table th.col-hidden,
.price-table td.col-hidden {
  display: none;
}

#main-table thead th[aria-sort] {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 22px;
}

#main-table thead th[aria-sort]::after {
  content: "\21C5";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  opacity: 0.45;
}

#main-table thead th[aria-sort="ascending"]::after {
  content: "\25B2";
  opacity: 0.95;
}

#main-table thead th[aria-sort="descending"]::after {
  content: "\25BC";
  opacity: 0.95;
}

.prices-loader-status {
  text-align: center;
  padding: 10px;
}
