/**
 * TourSure Vertical Filters System - Styles
 * File: /css/toursure-filters-tslist.css
 * Version: 1.1.0 - Compact Sidebar with Mobile Toggle
 */

/* ========================================
   Filters Sidebar - Vertical Layout (No Scrollbar)
   ======================================== */

.ts-filters-sidebar-tsl {
  background: #ffffff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
  position: sticky;
  top: 20px;
  overflow: visible;
}

/* Remove all scrollbars */
.ts-filters-sidebar-tsl::-webkit-scrollbar {
  display: none;
}

.ts-filters-sidebar-tsl {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ========================================
   Header
   ======================================== */

.ts-filters-header-tsl {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f1f3f5;
}

.ts-filters-title-tsl {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: #2d3436;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ts-filters-title-tsl svg {
  flex-shrink: 0;
  color: #0984e3;
}

.ts-filter-reset-tsl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  color: #6c757d;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  justify-content: center;
}

.ts-filter-reset-tsl:hover {
  background: #e9ecef;
  color: #495057;
  border-color: #adb5bd;
}

.ts-filter-reset-tsl svg {
  width: 14px;
  height: 14px;
}

/* ========================================
   Filter Content - Stacked Vertically
   ======================================== */

.ts-filters-content-tsl {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ts-filter-group-tsl {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ts-filter-label-tsl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ts-filter-label-tsl svg {
  width: 18px;
  height: 18px;
  color: #0984e3;
  flex-shrink: 0;
}

/* ========================================
   Price Range Slider - Modern Dual Range
   ======================================== */

.ts-price-range-wrapper-tsl {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Price Display Boxes */
.ts-price-display-tsl {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.ts-price-value-box-tsl {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #dee2e6;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.ts-price-value-box-tsl:hover {
  border-color: #0984e3;
  box-shadow: 0 2px 8px rgba(9, 132, 227, 0.15);
}

.ts-price-label-mini-tsl {
  font-size: 10px;
  font-weight: 700;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.ts-price-value-tsl {
  font-size: 18px;
  font-weight: 800;
  color: #0984e3;
  line-height: 1;
}

.ts-price-currency-tsl {
  font-size: 12px;
  font-weight: 600;
  color: #6c757d;
  margin-left: 2px;
}

.ts-price-separator-tsl {
  font-weight: 700;
  color: #adb5bd;
  font-size: 18px;
  flex-shrink: 0;
}

/* Range Slider Container */
.ts-range-slider-container-tsl {
  position: relative;
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 2px;
}

/* Track Background */
.ts-range-slider-track-tsl {
  position: absolute;
  width: 100%;
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  z-index: 1;
}

/* Active Range */
.ts-range-slider-range-tsl {
  position: absolute;
  height: 6px;
  background: linear-gradient(90deg, #0984e3 0%, #00b894 100%);
  border-radius: 3px;
  z-index: 2;
  transition: all 0.1s ease;
}

/* Range Input Styles */
.ts-range-slider-tsl {
  position: absolute;
  width: 100%;
  height: 6px;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  z-index: 3;
}

.ts-range-slider-tsl::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border: 3px solid #0984e3;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(9, 132, 227, 0.3);
  transition: all 0.2s ease;
}

.ts-range-slider-tsl::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #ffffff;
  border: 3px solid #0984e3;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(9, 132, 227, 0.3);
  transition: all 0.2s ease;
}

/* Hover & Active States */
.ts-range-slider-tsl::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  border-color: #0770c4;
  box-shadow: 0 3px 12px rgba(9, 132, 227, 0.5);
}

.ts-range-slider-tsl::-moz-range-thumb:hover {
  transform: scale(1.2);
  border-color: #0770c4;
  box-shadow: 0 3px 12px rgba(9, 132, 227, 0.5);
}

.ts-range-slider-tsl:active::-webkit-slider-thumb {
  transform: scale(1.1);
  border-width: 4px;
}

.ts-range-slider-tsl:active::-moz-range-thumb {
  transform: scale(1.1);
  border-width: 4px;
}

/* Focus States */
.ts-range-slider-tsl:focus {
  outline: none;
}

.ts-range-slider-tsl:focus::-webkit-slider-thumb {
  border-color: #0984e3;
  box-shadow: 0 0 0 4px rgba(9, 132, 227, 0.2);
}

.ts-range-slider-tsl:focus::-moz-range-thumb {
  border-color: #0984e3;
  box-shadow: 0 0 0 4px rgba(9, 132, 227, 0.2);
}

/* Min/Max Slider Positioning */
.ts-range-min-tsl {
  z-index: 3;
}

.ts-range-max-tsl {
  z-index: 4;
}

/* Price Hint */
.ts-price-hint-tsl {
  font-size: 11px;
  color: #6c757d;
  text-align: center;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

/* ========================================
   Select Dropdowns
   ======================================== */

.ts-filter-select-tsl {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #495057;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%23495057'/%3E%3C/svg%3E") no-repeat right 12px center;
  background-size: 16px;
  appearance: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ts-filter-select-tsl:focus {
  outline: none;
  border-color: #0984e3;
  box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.1);
}

.ts-filter-select-tsl:hover {
  border-color: #0984e3;
}

/* ========================================
   Apply Button
   ======================================== */

.ts-filter-apply-btn-tsl {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #0984e3 0%, #0770c4 100%);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(9, 132, 227, 0.3);
  margin-top: 8px;
}

.ts-filter-apply-btn-tsl:hover {
  background: linear-gradient(135deg, #0770c4 0%, #0660ab 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(9, 132, 227, 0.4);
}

.ts-filter-apply-btn-tsl:active {
  transform: translateY(0);
}

.ts-filter-apply-btn-tsl svg {
  width: 18px;
  height: 18px;
}

/* ========================================
   Active Filters Display
   ======================================== */

.ts-active-filters-tsl {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #f1f3f5;
}

.ts-active-filters-header-tsl {
  font-size: 12px;
  font-weight: 700;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.ts-active-tags-tsl {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ts-filter-tag-tsl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: linear-gradient(135deg, #0984e3 0%, #0770c4 100%);
  color: #ffffff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(9, 132, 227, 0.25);
  animation: tsTagSlideDown 0.3s ease;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ts-filter-tag-tsl span {
  flex: 1;
}


.ts-tag-remove-tsl {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 8px;
}

.ts-tag-remove-tsl:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.ts-tag-remove-tsl svg {
  width: 12px;
  height: 12px;
}

/* ========================================
   Results Count
   ======================================== */

.ts-results-count-tsl {
  margin-top: 20px;
  padding: 12px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #495057;
}

.ts-results-count-tsl svg {
  width: 16px;
  height: 16px;
  color: #0984e3;
}

.ts-count-number-tsl {
  color: #0984e3;
  font-size: 18px;
}

/* ========================================
   Mobile Filter Toggle Button
   ======================================== */

.ts-mobile-filter-toggle-tsl {
  display: none;
  /* Hidden on desktop */
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #0984e3 0%, #0770c4 100%);
  border: none;
  border-radius: 50%;
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(9, 132, 227, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  align-items: center;
  justify-content: center;
}

.ts-mobile-filter-toggle-tsl:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(9, 132, 227, 0.5);
}

.ts-mobile-filter-toggle-tsl:active {
  transform: scale(0.95);
}

.ts-mobile-filter-toggle-tsl svg {
  width: 28px;
  height: 28px;
}

/* Filter Count Badge */
.ts-filter-count-badge-tsl {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  background: #e74c3c;
  color: #ffffff;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

/* Mobile Filter Modal Overlay */
.ts-mobile-filter-overlay-tsl {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ts-mobile-filter-overlay-tsl.active {
  opacity: 1;
}

/* Mobile Filter Panel */
.ts-mobile-filter-panel-tsl {
  position: fixed;
  top: 0;
  right: -100%;
  width: 90%;
  max-width: 400px;
  height: 100%;
  background: #ffffff;
  z-index: 999;
  overflow-y: auto;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.ts-mobile-filter-panel-tsl.active {
  right: 0;
}

/* Mobile Filter Header */
.ts-mobile-filter-header-tsl {
  position: sticky;
  top: 0;
  background: #ffffff;
  padding: 20px;
  border-bottom: 2px solid #f1f3f5;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ts-mobile-filter-title-tsl {
  font-size: 18px;
  font-weight: 700;
  color: #2d3436;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ts-mobile-filter-close-tsl {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border: none;
  border-radius: 50%;
  color: #6c757d;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ts-mobile-filter-close-tsl:hover {
  background: #e9ecef;
  color: #2d3436;
}

.ts-mobile-filter-close-tsl svg {
  width: 20px;
  height: 20px;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet */
@media (max-width: 1023px) {
  .ts-filters-sidebar-tsl {
    position: relative;
    top: 0;
    max-height: none;
    margin-bottom: 24px;
  }
}

/* Mobile */
@media (max-width: 767px) {

  /* Show mobile toggle button */
  .ts-mobile-filter-toggle-tsl {
    display: flex;
  }

  /* Show overlay when active */
  .ts-mobile-filter-overlay-tsl.active {
    display: block;
  }

  /* Sidebar styling when inside mobile panel */
  .ts-mobile-filter-panel-tsl .ts-filters-sidebar-tsl {
    display: block !important;
    position: relative;
    top: 0;
    padding: 20px;
    border-radius: 0;
    box-shadow: none;
    border: none;
    height: auto;
    margin-bottom: 0;
  }

  /* Hide sidebar when NOT in panel - more specific selector */
  .ts-filters-sidebar-tsl:not(.ts-mobile-filter-panel-tsl .ts-filters-sidebar-tsl) {
    display: none !important;
  }

  .ts-filters-title-tsl {
    font-size: 16px;
  }

  .ts-filter-label-tsl {
    font-size: 11px;
  }

  /* Mobile-Friendly Price Slider */
  .ts-price-value-box-tsl {
    padding: 10px 6px;
  }

  .ts-price-label-mini-tsl {
    font-size: 9px;
  }

  .ts-price-value-tsl {
    font-size: 16px;
  }

  .ts-price-currency-tsl {
    font-size: 11px;
  }

  .ts-price-separator-tsl {
    font-size: 16px;
  }

  /* Larger Touch Targets for Mobile */
  .ts-range-slider-container-tsl {
    height: 50px;
    padding: 0 4px;
  }

  .ts-range-slider-track-tsl {
    height: 8px;
  }

  .ts-range-slider-range-tsl {
    height: 8px;
  }

  .ts-range-slider-tsl {
    height: 8px;
  }

  .ts-range-slider-tsl::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
    border-width: 4px;
  }

  .ts-range-slider-tsl::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-width: 4px;
  }

  .ts-range-slider-tsl:active::-webkit-slider-thumb {
    transform: scale(1.15);
    border-width: 5px;
  }

  .ts-range-slider-tsl:active::-moz-range-thumb {
    transform: scale(1.15);
    border-width: 5px;
  }

  .ts-price-hint-tsl {
    font-size: 10px;
    padding: 6px 10px;
  }

  .ts-filter-select-tsl {
    font-size: 13px;
    padding: 10px 11px;
    padding-right: 32px;
  }

  .ts-filter-apply-btn-tsl {
    padding: 14px 20px;
    font-size: 13px;
  }
}

/* Small Mobile (< 375px) */
@media (max-width: 374px) {
  .ts-price-display-tsl {
    gap: 6px;
  }

  .ts-price-value-tsl {
    font-size: 14px;
  }

  .ts-price-separator-tsl {
    font-size: 14px;
  }

  .ts-range-slider-tsl::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
  }

  .ts-range-slider-tsl::-moz-range-thumb {
    width: 24px;
    height: 24px;
  }
}

/* ========================================
   Loading State
   ======================================== */

.ts-filters-sidebar-tsl.ts-loading-tsl {
  pointer-events: none;
  opacity: 0.6;
}

.ts-filter-apply-btn-tsl:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ========================================
   Accessibility
   ======================================== */

.ts-filter-apply-btn-tsl:focus,
.ts-filter-reset-tsl:focus,
.ts-price-input-tsl:focus,
.ts-filter-select-tsl:focus,
.ts-tag-remove-tsl:focus {
  outline: 2px solid #0984e3;
  outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .ts-filters-sidebar-tsl {
    border: 2px solid #000;
  }

  .ts-price-input-tsl,
  .ts-filter-select-tsl {
    border-width: 3px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
  .ts-filters-sidebar-tsl {
    display: none !important;
  }
}

/* ========================================
   Compact Variant (Optional)
   ======================================== */

.ts-filters-sidebar-tsl.ts-compact-tsl {
  padding: 16px;
}

.ts-filters-sidebar-tsl.ts-compact-tsl .ts-filter-group-tsl {
  gap: 8px;
}

.ts-filters-sidebar-tsl.ts-compact-tsl .ts-price-input-tsl,
.ts-filters-sidebar-tsl.ts-compact-tsl .ts-filter-select-tsl {
  padding: 8px 10px;
  font-size: 13px;
}

.ts-filters-sidebar-tsl.ts-compact-tsl .ts-filter-apply-btn-tsl {
  padding: 10px 18px;
  font-size: 13px;
}
