/**
 * Ride Schedule Styles
 *
 * Standalone CSS for the [ride_schedule] shortcode.
 * Based on the programming-calendar component styles.
 */

.ride-schedule {
  /* Variables */
  --surface-color: #fff;
  --text-color: #1f2937;
  --spacing-medium: 1rem;
  --font-size-small: 0.875rem;
  --status-open-color: #54A048;
  --status-closed-color: #DA7321;
  --status-caution-color: #FFBB57;
  --status-ride-tour-color: #2B6F97;
}

/* ===========================================
   UTILITIES
   =========================================== */
.ride-schedule .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ride-schedule .mobile-only {
  display: none;
}

@media (max-width: 900px) {
  .ride-schedule .mobile-only {
    display: block;
  }
}

/* ===========================================
   HEADINGS
   =========================================== */
.ride-schedule h3 {
  margin: 0 0 var(--spacing-medium) 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-color);
}

/* ===========================================
   FILTER GROUP
   =========================================== */
.ride-schedule form {
  margin-bottom: var(--spacing-medium);
}

@media (min-width: 901px) {
  .ride-schedule form {
    background-color: var(--surface-color);
    border-radius: 999rem;
    overflow-x: auto;
    max-width: fit-content;
  }
}

.ride-schedule .filter-group {
  padding: 20px;
  border: none;
  margin: 0;
}

.ride-schedule .filter-group__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-medium);
  margin: 0;
  width: 100%;
  overflow: hidden;
}

@media (min-width: 901px) {
  .ride-schedule .filter-group__inner {
    border-radius: 999rem;
    background-color: var(--surface-color);
  }
}

.ride-schedule .filter-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: var(--font-size-small);
  padding: 6px 8px;
  border-radius: 999px;
  border: 2px solid currentColor;
  background-color: var(--surface-color);
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.ride-schedule .filter-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ride-schedule .filter-item input[type="checkbox"]:focus-visible + svg {
  outline: 2px solid blue;
  outline-offset: 2px;
  border-radius: 50%;
}

.ride-schedule .filter-item svg,
.ride-schedule .filter-item span {
  color: black;
}

.ride-schedule .filter-item svg {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.ride-schedule .filter-item span {
  font-weight: 600;
  white-space: nowrap;
}

.ride-schedule .filter-item:hover {
  opacity: 0.8;
}

.ride-schedule .filter-item:has(input:checked) {
  background-color: currentColor;
}

.ride-schedule .filter-item:has(input:checked) svg,
.ride-schedule .filter-item:has(input:checked) span {
  color: var(--surface-color);
}

/* Filter color variants */
.ride-schedule .filter-item.filter-open {
  color: var(--status-open-color);
}

.ride-schedule .filter-item.filter-closed {
  color: var(--status-closed-color);
}

.ride-schedule .filter-item.filter-caution {
  color: var(--status-caution-color);
}

.ride-schedule .filter-item.filter-ride-tour {
  color: var(--status-ride-tour-color);
}

/* ===========================================
   SCHEDULE TABLE
   =========================================== */
.ride-schedule .table-wrapper {
  overflow: auto;
  width: 100%;
}

.ride-schedule .schedule-table {
  width: 100%;
  margin-top: var(--spacing-medium);
  background-color: #f5f5f5;
  border-radius: 0.5rem;
  border-collapse: separate;
  border-spacing: 5px;
}

@media (max-width: 900px) {
  .ride-schedule .schedule-table {
    border-collapse: collapse;
  }
}

.ride-schedule .schedule-table th,
.ride-schedule .schedule-table td {
  margin: unset;
}

.ride-schedule .schedule-table td {
  text-align: center;
  width: min(200px, 10vw);
}

.ride-schedule .schedule-table th {
  font-weight: 600;
  font-size: var(--font-size-small);
  color: #4b5563;
  white-space: nowrap;
}

.ride-schedule .table-cell-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  border-radius: 10px;
  padding: 0.75rem var(--spacing-medium);
  min-height: 74px;
}

@media (max-width: 900px) {
  .ride-schedule .table-cell-inner {
    border-radius: unset;
  }
}

/* Corner radius for first/last cells */
.ride-schedule .schedule-table tr:first-of-type > td:first-child .table-cell-inner {
  border-radius: 10px 0 0 0;
}

.ride-schedule .schedule-table tr:first-of-type > td:last-child .table-cell-inner {
  border-radius: 0 10px 0 0;
}

.ride-schedule .schedule-table tr:last-of-type > td:first-child .table-cell-inner {
  border-radius: 0 0 0 10px;
}

.ride-schedule .schedule-table tr:last-of-type > td:last-child .table-cell-inner {
  border-radius: 0 0 10px 0;
}

.ride-schedule .attraction-name,
.ride-schedule .attraction-header {
  position: sticky;
  left: 0;
  text-align: left;
  background-color: var(--surface-color);
}

.ride-schedule .attraction-name .table-cell-inner,
.ride-schedule .attraction-header .table-cell-inner {
  justify-content: space-between;
  text-align: left;
}

.ride-schedule .attraction-name {
  font-weight: 600;
  font-size: var(--font-size-small);
  color: var(--text-color);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

/* ===========================================
   TIME HEADER
   =========================================== */
.ride-schedule .time-header__inner {
  display: flex;
  gap: 10px;
}

.ride-schedule .time-header .clock-icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  color: #f59e0b;
}

/* ===========================================
   TOOLTIP
   =========================================== */
.ride-schedule .tooltip-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  margin-left: 0.5rem;
  cursor: help;
}

.ride-schedule .tooltip-trigger svg {
  width: 1rem;
  height: 1rem;
  color: #9ca3af;
  transition: color 0.15s ease;
}

.ride-schedule .tooltip-trigger .tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 0.5rem 0.75rem;
  background: var(--text-color);
  color: white;
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: none;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 100;
}

.ride-schedule .tooltip-trigger .tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text-color);
}

.ride-schedule .tooltip-trigger:hover .tooltip,
.ride-schedule .tooltip-trigger:focus .tooltip {
  opacity: 1;
  visibility: visible;
}

.ride-schedule .tooltip-trigger:hover svg,
.ride-schedule .tooltip-trigger:focus svg {
  color: #6366f1;
}

.ride-schedule .tooltip-trigger:focus {
  outline: none;
}

.ride-schedule .tooltip-trigger:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===========================================
   STATUS ICONS
   =========================================== */
.ride-schedule .status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 700;
  transition: visibility 0.15s ease, opacity 0.15s ease;
}

.ride-schedule .status-icon.open {
  color: var(--status-open-color);
}

.ride-schedule .status-icon.closed {
  color: var(--status-closed-color);
}

.ride-schedule .status-icon.caution {
  color: var(--status-caution-color);
}

.ride-schedule .status-icon.ride-tour {
  color: var(--status-ride-tour-color);
}

/* ===========================================
   HIDDEN ROWS (when filtered)
   =========================================== */
.ride-schedule .schedule-table tr[hidden] {
  display: none;
}
