/* ============================================
   ADVANCED FILTER SIDEBAR - CruisePlum-Inspired
   ============================================ */

:root {
  --sidebar-width: 320px;
  --sidebar-min-width: 200px;
  --sidebar-max-width: 500px;
  --sidebar-collapsed-width: 0px;
  --sidebar-bg: #f8f9fa;
  --sidebar-border: #e9ecef;
  --filter-section-bg: #ffffff;
  --filter-header-bg: #1a3a5c;
  --filter-header-color: #ffffff;
  --accent-color: #0d6efd;
  --accent-hover: #0b5ed7;
  --text-muted: #6c757d;
  --transition-speed: 0.3s;
}

/* === Main Layout Container === */
.filter-page-layout {
  display: flex;
  min-height: calc(100vh - 80px);
  position: relative;
}

/* === Filter Sidebar === */
.filter-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-min-width);
  max-width: var(--sidebar-max-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  transition: all var(--transition-speed) ease;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 56px; /* Below navbar */
  left: 0;
  bottom: 0;
  z-index: 1040;
  overflow-y: auto;
  contain: layout style paint;
}

/* Fill corner above sidebar when scrolled - matches sticky table header */
.filter-sidebar::before {
  content: '';
  position: sticky;
  display: block;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  background: linear-gradient(135deg, var(--filter-header-bg) 0%, #0f2840 100%);
  z-index: 15;
  pointer-events: none;
}

.filter-sidebar.collapsed::before {
  display: none;
}

.filter-sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
  transform: translateX(-100%);
}

.filter-sidebar.collapsed .filter-sidebar-content,
.filter-sidebar.collapsed .filter-sidebar-header,
.filter-sidebar.collapsed .filter-actions,
.filter-sidebar.collapsed .sidebar-resize-handle {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Sidebar Header */
.filter-sidebar-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--filter-header-bg);
  color: var(--filter-header-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.filter-sidebar-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Sidebar Resize Handle */
.sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
  background: transparent;
  z-index: 1050;
  transition: background 0.15s ease;
}

.sidebar-resize-handle:hover,
.sidebar-resize-handle.dragging {
  background: var(--accent-color);
}

.sidebar-resize-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 40px;
  background: #adb5bd;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.sidebar-resize-handle:hover::after {
  opacity: 1;
}

/* Prevent text selection while dragging */
body.sidebar-resizing {
  user-select: none;
  cursor: ew-resize !important;
}

body.sidebar-resizing * {
  cursor: ew-resize !important;
}

/* Sidebar Toggle Button - Fixed vertical strip on left edge */
.sidebar-toggle {
  position: fixed;
  left: calc(var(--sidebar-width) - 1px); /* Overlap 1px to eliminate gap */
  top: 56px; /* Below navbar */
  bottom: 0;
  width: 12px;
  background: var(--filter-header-bg);
  border: none;
  border-radius: 0 4px 4px 0;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left var(--transition-speed) ease, width 0.15s ease;
  z-index: 1050;
  box-shadow: 2px 0 8px rgba(0,0,0,0.15);
}

.sidebar-toggle:hover {
  background: var(--accent-hover);
  width: 20px;
}

.sidebar-toggle svg {
  transition: transform var(--transition-speed) ease;
  opacity: 0.7;
}

.sidebar-toggle:hover svg {
  opacity: 1;
}

/* Toggle is a sibling element before the sidebar, so we use JS to add class */
.sidebar-toggle.sidebar-collapsed {
  left: 0;
}

.sidebar-toggle.sidebar-collapsed svg {
  transform: rotate(180deg);
}

/* Sidebar Content */
.filter-sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 16px 16px;
  transition: opacity var(--transition-speed) ease;
}

/* Expand/Collapse All Controls - in header */
.filter-expand-controls {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.filter-expand-text-btn {
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.filter-expand-text-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-color: rgba(255, 255, 255, 0.5);
}

/* Filter Actions (Clear All, Apply) */
.filter-actions {
  padding: 12px 16px;
  background: white;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  gap: 8px;
}

.filter-actions .btn {
  flex: 1;
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: 6px;
}

/* === Filter Sections === */
.filter-section {
  background: var(--filter-section-bg);
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid var(--sidebar-border);
  overflow: visible; /* Allow dropdowns to overflow */
  contain: style;
}

.filter-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.filter-section-header:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.filter-section-header h3 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #343a40;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex: 1;
  min-width: 0;
}

.filter-section-header .section-toggle {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform var(--transition-speed) ease;
}

.filter-section.collapsed .filter-section-header .section-toggle {
  transform: rotate(-90deg);
}

.filter-section-body {
  padding: 12px 16px;
  transition: padding var(--transition-speed) ease;
}

.filter-section.collapsed .filter-section-body {
  display: none;
}

/* Active filter indicator - shows when section has active filters */
.filter-section-header .active-indicator {
  width: 18px;
  height: 18px;
  min-width: 18px;
  background: var(--accent-color);
  border-radius: 50%;
  margin-left: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
}

.filter-section.has-active-filters .active-indicator {
  display: flex;
}

/* When collapsed with active filters, make it more prominent */
.filter-section.collapsed.has-active-filters .filter-section-header {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.filter-section.collapsed.has-active-filters .filter-section-header h3 {
  color: var(--accent-color);
}

/* Section clear button - hidden by default, shows when section has active filters */
.filter-section-header .section-clear-btn {
  display: none;
  padding: 2px 6px;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.filter-section-header .section-clear-btn:hover {
  color: var(--accent-color);
  background: rgba(13, 110, 253, 0.1);
}

.filter-section.has-active-filters .section-clear-btn {
  display: inline-block;
}

/* Choices.js dropdown - when appended to body, ensure proper styling */
body > .choices__list--dropdown {
  position: fixed !important;
  z-index: 999999 !important;
  background: white;
  border: 1px solid #ced4da;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  min-width: 320px;
  width: auto !important;
}

body > .choices__list--dropdown .choices__list {
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
}

body > .choices__list--dropdown .choices__item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.1s ease;
  white-space: nowrap;
}

body > .choices__list--dropdown .choices__item:last-child {
  border-bottom: none;
}

body > .choices__list--dropdown .choices__item--selectable:hover,
body > .choices__list--dropdown .choices__item--selectable.is-highlighted {
  background: #f0f7ff;
}

/* Expiration badges */
.exp-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  min-width: 45px;
  text-align: center;
}

.exp-badge.exp-critical {
  background: #dc3545;
  color: white;
}

.exp-badge.exp-warning {
  background: #ffc107;
  color: #212529;
}

.exp-badge.exp-normal {
  background: #e9ecef;
  color: #495057;
}

/* Selected items in dropdown */
body > .choices__list--dropdown .choices__item--selectable.is-selected {
  background: #e3f2fd;
  position: relative;
}

body > .choices__list--dropdown .choices__item--selectable.is-selected::before {
  content: '✓';
  position: absolute;
  right: 12px;
  color: #0d6efd;
  font-weight: bold;
}

/* Search input in dropdown */
body > .choices__list--dropdown .choices__input {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid #dee2e6;
  font-size: 14px;
  outline: none;
}

body > .choices__list--dropdown .choices__input:focus {
  border-bottom-color: #0d6efd;
}

/* === Individual Filter Controls === */

/* Filter Group (container for related filters) */
.filter-group {
  margin-bottom: 16px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

/* Checkbox/Radio Filter Items */
.filter-item {
  display: flex;
  align-items: center;
  padding: 6px 0;
  cursor: pointer;
  transition: background 0.1s ease;
  border-radius: 4px;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
}

.filter-item:hover {
  background: #f0f4f8;
}

.filter-item input[type="checkbox"],
.filter-item input[type="radio"] {
  width: 16px;
  height: 16px;
  margin-right: 10px;
  accent-color: var(--accent-color);
  cursor: pointer;
}

.filter-item-label {
  flex: 1;
  font-size: 0.85rem;
  color: #343a40;
}

.filter-item-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #e9ecef;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 32px;
  text-align: center;
}

/* Range Slider Filter */
.filter-range {
  padding: 8px 0;
}

.filter-range-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.filter-range-label {
  font-size: 0.8rem;
  color: #343a40;
}

.filter-range-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-color);
}

.filter-range input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  background: #dee2e6;
  border-radius: 3px;
  outline: none;
}

.filter-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.filter-range input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Dual Range (Min/Max) - Legacy number inputs */
.filter-dual-range {
  display: flex;
  gap: 12px;
  align-items: center;
}

.filter-dual-range input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 0.85rem;
  text-align: center;
}

.filter-dual-range input:focus {
  border-color: var(--accent-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.filter-dual-range span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Range Slider Wrapper */
.range-slider-wrapper {
  padding: 8px 0;
}

.range-slider-wrapper tc-range-slider {
  margin: 8px 0;
}

.range-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-color);
  margin-top: 4px;
}

.range-slider-labels span {
  background: #e7f1ff;
  padding: 2px 8px;
  border-radius: 4px;
  min-width: 40px;
  text-align: center;
}

/* Date Range Picker */
.filter-date-range {
  width: 100%;
}

.filter-date-range input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 0.85rem;
}

.filter-date-range input:focus {
  border-color: var(--accent-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* Select Dropdown */
.filter-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 0.85rem;
  background: white;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--accent-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* Multi-Select Tags */
.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: #e9ecef;
  border-radius: 16px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.filter-tag:hover {
  background: #dee2e6;
}

.filter-tag.active {
  background: var(--accent-color);
  color: white;
}

.filter-tag.active:hover {
  background: var(--accent-hover);
}

/* Guest Selector - CruisePlum style horizontal button group */
.guest-selector {
  display: flex;
  align-items: center;
  gap: 12px;
}

.guest-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
}

.guest-buttons {
  display: flex;
  border-radius: 4px;
  overflow: hidden;
}

.guest-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 32px;
  background: #6c757d;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.15s ease;
}

.guest-btn:last-child {
  border-right: none;
}

.guest-btn:hover {
  background: #5a6268;
  color: white;
  text-decoration: none;
}

.guest-btn.active {
  background: #495057;
  color: white;
}

.guest-btn.active:hover {
  background: #3d4349;
  color: white;
}

/* Show Filters Button */
.show-filters-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* Column Toggle Dropdown */
.column-toggles .dropdown-menu {
  z-index: 9999;
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* === Cruise Counts === */
.cruise-counts {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: #495057;
  margin-left: auto;
  padding: 6px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.count-total {
  color: #6c757d;
}

.count-separator {
  color: #adb5bd;
  font-size: 0.7rem;
}

.count-filtered {
  font-weight: 600;
  color: #0d6efd;
}

.count-filtered.has-filter {
  color: #198754;
}

.dropdown-menu-columns {
  min-width: 160px;
  padding: 8px 0;
}

.dropdown-menu-columns .dropdown-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.875rem;
}

.dropdown-menu-columns .dropdown-item:hover {
  background: #f0f4f8;
}

.dropdown-menu-columns .form-check-input {
  margin-top: 0;
}

.dropdown-menu-columns .form-check-input:checked {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

/* === Main Content Area === */
.filter-page-content {
  flex: 1;
  padding: 20px;
  padding-left: 32px; /* Extra padding for toggle strip */
  background: white;
  min-width: 0; /* Prevents flex item from overflowing */
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-speed) ease;
}

/* Top Controls Bar */
.filter-top-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* When sidebar is collapsed, content takes full width */
.filter-sidebar.collapsed ~ .filter-page-content {
  margin-left: 12px; /* Just enough for the toggle strip */
}

/* Content Header */
.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.content-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a3a5c;
  margin: 0;
}

.content-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Results Count */
.results-count {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.results-count strong {
  color: #343a40;
}

/* Active Filters Bar */
.active-filters-bar {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 16px;
  align-items: center;
  height: 40px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

/* No active filters state */
.no-active-filters {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  flex-shrink: 0;
}

.active-filters-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
  flex-shrink: 0;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--accent-color);
  color: white;
  border-radius: 16px;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.active-filter-chip button {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

.active-filter-chip button:hover {
  color: white;
}

.clear-all-filters {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--accent-color);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  flex-shrink: 0;
}

.clear-all-filters:hover {
  color: var(--accent-hover);
}

/* === Mobile Responsive === */
@media (max-width: 991px) {
  .filter-sidebar {
    position: fixed;
    left: 0;
    top: 56px; /* Below navbar */
    bottom: 0;
    z-index: 1040;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }

  .filter-sidebar.collapsed {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }

  .filter-sidebar .sidebar-toggle {
    right: -48px;
  }

  .filter-sidebar.collapsed .sidebar-toggle {
    right: -48px;
  }

  .filter-page-content {
    width: 100%;
  }

  /* Mobile overlay when sidebar is open */
  .filter-sidebar-overlay {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1039;
  }

  .filter-sidebar:not(.collapsed) ~ .filter-sidebar-overlay {
    display: block;
  }
}

@media (max-width: 576px) {
  :root {
    --sidebar-width: 100%;
  }

  .filter-sidebar {
    width: 85%;
    min-width: 85%;
  }

  .content-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .content-header-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* === Scrollbar Styling === */
.filter-sidebar-content::-webkit-scrollbar,
.filter-section-body::-webkit-scrollbar {
  width: 6px;
}

.filter-sidebar-content::-webkit-scrollbar-track,
.filter-section-body::-webkit-scrollbar-track {
  background: transparent;
}

.filter-sidebar-content::-webkit-scrollbar-thumb,
.filter-section-body::-webkit-scrollbar-thumb {
  background: #ced4da;
  border-radius: 3px;
}

.filter-sidebar-content::-webkit-scrollbar-thumb:hover,
.filter-section-body::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}

/* === Animation Classes === */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.filter-section {
  animation: slideIn 0.2s ease forwards;
}

.filter-section:nth-child(2) { animation-delay: 0.05s; }
.filter-section:nth-child(3) { animation-delay: 0.1s; }
.filter-section:nth-child(4) { animation-delay: 0.15s; }
.filter-section:nth-child(5) { animation-delay: 0.2s; }

/* === Day of Week Selector === */
.day-of-week-selector {
  display: flex;
  gap: 4px;
}

.dow-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.dow-btn input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dow-btn span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: white;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #495057;
  transition: all 0.15s ease;
}

.dow-btn:hover span {
  background: #f0f4f8;
  border-color: #adb5bd;
}

.dow-btn input:checked + span {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

.dow-btn input:checked:hover + span {
  background: var(--accent-hover);
}

/* === Multiselect Checkbox Group === */
.filter-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-checkbox-item {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s ease;
}

.filter-checkbox-item:hover {
  background: #f0f4f8;
}

.filter-checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: 10px;
  accent-color: var(--accent-color);
  cursor: pointer;
}

.filter-checkbox-item span {
  font-size: 0.85rem;
  color: #343a40;
}

/* === Choices.js Overrides (for searchable multi-select) === */
.choices {
  margin-bottom: 0;
}

.choices__inner {
  min-height: 38px;
  max-height: 80px;
  overflow-y: auto;
  padding: 4px 8px;
  background: white;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 0.85rem;
}

.choices__inner:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.choices__list--dropdown {
  border-color: #ced4da;
  border-radius: 6px;
  z-index: 99999 !important;
}

.choices__item--selectable.is-highlighted {
  background-color: var(--accent-color);
}

.choices__item--choice--selectable.is-selected {
  background-color: #e9ecef;
}

.choices__button {
  border-left-color: rgba(0, 0, 0, 0.2);
}

.choices__list--multiple .choices__item {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

/* === Multi-select native (fallback without Choices.js) === */
.filter-multiselect {
  width: 100%;
  min-height: 80px;
  padding: 8px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 0.85rem;
  background: white;
}

.filter-multiselect:focus {
  border-color: var(--accent-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.filter-multiselect option {
  padding: 4px 8px;
}

.filter-multiselect option:checked {
  background: var(--accent-color);
  color: white;
}

/* ============================================
   COLUMN REORDERING
   ============================================ */

/* Drag handle indicator */
.col-drag-handle {
  opacity: 0;
  margin-right: 4px;
  cursor: grab;
  font-size: 10px;
  vertical-align: middle;
  transition: opacity 0.15s;
  color: rgba(255, 255, 255, 0.6);
}

#sailings-table thead th:hover .col-drag-handle {
  opacity: 0.6;
}

#sailings-table thead th:active .col-drag-handle {
  cursor: grabbing;
}

/* Column being dragged */
#sailings-table thead th.column-dragging {
  opacity: 0.5;
  background: #234b6e;
}

/* Drop indicator line */
.column-drop-indicator {
  position: fixed;
  width: 3px;
  background: #0d6efd;
  pointer-events: none;
  z-index: 10000;
  display: none;
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(13, 110, 253, 0.5);
}

/* Draggable header styling */
#sailings-table thead th[draggable="true"] {
  user-select: none;
}

#sailings-table thead th[draggable="true"]:hover {
  background: #234b6e;
}

/* ============================================
   VIEW STATE RESTORE BANNER
   ============================================ */

.view-restore-banner {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border: 1px solid #90caf9;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-restore-banner .banner-text {
  font-size: 0.9rem;
  color: #1565c0;
}

.view-restore-banner .banner-actions {
  display: flex;
  gap: 8px;
}

.view-restore-banner button {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.view-restore-banner .btn-restore {
  background: #1976d2;
  color: white;
  border: none;
}

.view-restore-banner .btn-restore:hover {
  background: #1565c0;
}

.view-restore-banner .btn-dismiss {
  background: transparent;
  color: #666;
  border: 1px solid #ccc;
}

.view-restore-banner .btn-dismiss:hover {
  background: #f5f5f5;
}

/* Reset View button - uses Bootstrap btn-outline-secondary, just add icon animation */
.reset-view-btn svg {
  transition: transform 0.3s;
}

.reset-view-btn:hover svg {
  transform: rotate(-180deg);
}

/* Share URL button */
.share-url-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  border: 1px solid #ced4da;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.share-url-btn:hover {
  background: #f8f9fa;
  border-color: #0d6efd;
  color: #0d6efd;
}

.share-url-btn.copied {
  background: #198754;
  border-color: #198754;
  color: white;
}

/* === Ports Tooltip Trigger === */
.ports-tooltip-trigger {
  color: #495057;
  text-decoration: none;
  cursor: help;
  border-bottom: 1px dotted #6c757d;
}

.ports-tooltip-trigger:hover {
  color: #0d6efd;
  border-bottom-color: #0d6efd;
}
