/**
 * Filter Sidebar Component Styles
 * Reusable styles for tours and hotels list pages
 */

/* Sidebar Container */
.tours-sidebar,
.hotels-sidebar {
    position: sticky;
    top: 90px;
}

/* Hide mobile header on desktop */
.sidebar-header {
    display: none;
}


/* Filter Card */
.filter-card {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.filter-card-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #fff 0%, #f9fafb 100%);
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-card-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.5rem;
    background: var(--color-primary);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    border-radius: 12px;
}

.filter-card-body {
    padding: 1.25rem;
}

/* Filter Sections */
.filter-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.filter-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.filter-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0.5rem;
    cursor: pointer;
    user-select: none;
    border-radius: 6px;
    transition: background 0.2s;
}

.filter-section-header:hover {
    background: #f9fafb;
}

.filter-section-title {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-section-toggle {
    color: #9ca3af;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
}

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

.filter-section-content {
    max-height: 600px;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 0.5rem;
}

.filter-section.collapsed .filter-section-content {
    max-height: 0;
}

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

/* Filter Inputs */
.filter-input,
.filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: var(--font-size-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    color: #1f2937;
}

.filter-input:hover,
.filter-select:hover {
    border-color: #d1d5db;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb, 247, 87, 0), 0.08);
}

.filter-input::placeholder {
    color: #9ca3af;
    font-weight: var(--font-weight-normal);
}

/* Price Range Slider */
.price-range-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: 0.875rem 1.125rem;
    background: linear-gradient(135deg, #fff5f2 0%, #fef3f2 100%);
    border-radius: 10px;
    border: 1px solid #fed7cc;
}

.price-value {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.price-separator {
    color: #fca184;
    font-weight: var(--font-weight-semibold);
    margin: 0 0.5rem;
}

.price-slider-wrapper {
    position: relative;
    height: 44px;
    margin-bottom: 1.25rem;
    padding: 0 2px;
}

.slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    transform: translateY(-50%);
}

.slider-range {
    position: absolute;
    top: 50%;
    height: 6px;
    background: linear-gradient(90deg, var(--color-primary), #ff8c42);
    border-radius: 3px;
    transform: translateY(-50%);
    pointer-events: none;
    transition: all 0.2s ease;
}

.price-slider {
    position: absolute;
    width: 100%;
    height: 6px;
    top: 50%;
    transform: translateY(-50%);
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    cursor: pointer;
    z-index: 2;
}

.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--color-primary);
    cursor: grab;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(var(--primary-rgb, 247, 87, 0), 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.price-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb, 247, 87, 0), 0.35), 0 0 0 2px rgba(var(--primary-rgb, 247, 87, 0), 0.15);
}

.price-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(var(--primary-rgb, 247, 87, 0), 0.3), 0 0 0 4px rgba(var(--primary-rgb, 247, 87, 0), 0.2);
}

.price-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--color-primary);
    cursor: grab;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(var(--primary-rgb, 247, 87, 0), 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.price-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb, 247, 87, 0), 0.35), 0 0 0 2px rgba(var(--primary-rgb, 247, 87, 0), 0.15);
}

.price-slider::-moz-range-thumb:active {
    cursor: grabbing;
    transform: scale(1.15);
}

.price-quick-filters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.price-quick-btn {
    padding: 0.625rem 0.5rem;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.price-quick-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(var(--primary-rgb, 247, 87, 0), 0.05) 0%, rgba(var(--primary-rgb, 247, 87, 0), 0.1) 100%);
    opacity: 0;
    transition: opacity 0.2s;
}

.price-quick-btn:hover {
    background: #fef3f2;
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(var(--primary-rgb, 247, 87, 0), 0.15);
}

.price-quick-btn:hover::before {
    opacity: 1;
}

.price-quick-btn.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, #ff8c42 100%);
    border-color: var(--color-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(var(--primary-rgb, 247, 87, 0), 0.25);
}

.price-quick-btn:active {
    transform: translateY(0);
}

/* Checkbox Filters */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1.5px solid transparent;
}

.checkbox-item:hover {
    background: #f9fafb;
    border-color: #f3f4f6;
}

.checkbox-item:has(input:checked) {
    background: #fef3f2;
    border-color: #fed7cc;
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--color-primary);
    border-radius: 4px;
}

.checkbox-item label {
    flex: 1;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: #374151;
    cursor: pointer;
    line-height: var(--line-height-normal);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-item:has(input:checked) label {
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
}

/* Star Icons */
.star-icons {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    color: #fbbf24;
}

/* Filter Actions */
.filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f3f4f6;
}

.btn-filter {
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.btn-reset {
    background: white;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.btn-reset:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-apply {
    background: var(--color-primary);
    color: white;
}

.btn-apply:hover {
    background: #d64900;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb, 247, 87, 0), 0.25);
}

/* Mobile */
.mobile-filter-btn {
    display: none;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 56px;
    height: 56px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb, 247, 87, 0), 0.3);
    cursor: pointer;
    z-index: 1000;
}

@media (max-width: 1024px) {
    .mobile-filter-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .tours-sidebar,
    .hotels-sidebar {
        display: none !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999;
        padding: 1rem;
        overflow-y: auto;
        visibility: hidden;
        opacity: 0;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .tours-sidebar.active,
    .hotels-sidebar.active {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Force close on mobile if data attribute is set */
    .tours-sidebar[data-force-close="true"],
    .hotels-sidebar[data-force-close="true"] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    .sidebar-content {
        background: white;
        border-radius: 12px;
        padding: 1rem;
        max-width: 500px;
        margin: 0 auto;
    }
    
    /* Show header only on mobile */
    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .sidebar-close {
        background: none;
        border: none;
        font-size: var(--font-size-2xl);
        line-height: var(--line-height-none);
        cursor: pointer;
        color: #6b7280;
        padding: 0.25rem;
        transition: color 0.2s;
    }
    
    .sidebar-close:hover {
        color: #374151;
    }
}

