/**
 * Resort Filter Panel Styles
 * Slide-in filter panel with modern design
 */

/* ============================================
   Filter Toggle Bar (Results count display)
   ============================================ */
.filter-toggle-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}

/* ============================================
   Floating Filter Button (FAB style)
   Fixed position in bottom-right corner
   ============================================ */
.filter-toggle-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1rem 1.5rem;
    /* Gradient background for premium look */
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 3rem;
    color: #ffffff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 100;
    /* Subtle shadow for depth */
    box-shadow:
        0 4px 15px rgba(99, 102, 241, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.15);
}

.filter-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(99, 102, 241, 0.5),
        0 4px 10px rgba(0, 0, 0, 0.2);
}

.filter-toggle-btn:active {
    transform: translateY(0);
}

.filter-toggle-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke-width: 2.5;
}

/* Filter count badge */
.filter-badge {
    position: absolute;
    top: -0.375rem;
    right: -0.375rem;
    min-width: 1.375rem;
    height: 1.375rem;
    padding: 0 0.375rem;
    background: #ef4444;
    border: 2px solid #ffffff;
    border-radius: 999px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Results count text (legacy, kept for backwards compat) */
.filter-results-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: inherit;
    opacity: 0.7;
}

/* ============================================
   Results Summary Bar
   Shows count of resorts above listings
   ============================================ */
.resorts-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.resorts-results-count {
    font-size: 0.9375rem;
    font-weight: 500;
    opacity: 0.8;
}

/* ============================================
   Filter Panel (Slide-in)
   Uses explicit dark theme for guaranteed high contrast
   ============================================ */
.filter-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 380px;
    height: 100vh;
    /* Explicit dark background for high contrast */
    background: #1a1a2e;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Force text color */
    color: #ffffff;
}

.filter-panel--open {
    transform: translateX(0);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}

/* Backdrop when panel is open */
body.filter-panel-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ============================================
   Panel Header
   ============================================ */
.filter-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
    background: #16162a;
}

.filter-panel__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.filter-panel__close {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.filter-panel__close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* ============================================
   Panel Content
   ============================================ */
.filter-panel__content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Filter Groups */
.filter-group {
    margin-bottom: 1.75rem;
}

.filter-group__title {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 0.875rem 0;
}

.filter-group__options {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Filter Subgroups */
.filter-subgroup {
    margin-bottom: 1rem;
}

.filter-subgroup__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-primary, #6366f1);
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

/* ============================================
   Checkbox Styles
   ============================================ */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.filter-checkbox:hover {
    background: rgba(255, 255, 255, 0.08);
}

.filter-checkbox input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: #6366f1;
    cursor: pointer;
    flex-shrink: 0;
}

.filter-checkbox__label {
    flex: 1;
    font-size: 0.9375rem;
    color: #ffffff;
}

.filter-checkbox__count {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   Rating Slider
   ============================================ */
.filter-rating {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-rating input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--color-surface, rgba(255, 255, 255, 0.1));
    border-radius: 2px;
    outline: none;
}

.filter-rating input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    background: var(--color-primary, #6366f1);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.filter-rating input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.filter-rating__display {
    min-width: 2.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #ffffff;
}

/* ============================================
   Select Dropdown
   ============================================ */
.filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    color: #ffffff;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.filter-select:hover,
.filter-select:focus {
    border-color: #6366f1;
    outline: none;
}

.filter-select option {
    background: #1a1a2e;
    color: #ffffff;
}

/* ============================================
   Panel Footer
   ============================================ */
.filter-panel__footer {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
    background: #16162a;
}

.filter-panel__clear {
    flex: 1;
    padding: 0.875rem 1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.5rem;
    color: #ffffff;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-panel__clear:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.filter-panel__apply {
    flex: 1;
    padding: 0.875rem 1rem;
    background: #6366f1;
    border: none;
    border-radius: 0.5rem;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-panel__apply:hover {
    background: #4f46e5;
}

/* ============================================
   Resort Card Hidden State
   ============================================ */
.resort-card--hidden {
    display: none !important;
}

.country-section--hidden {
    display: none !important;
}

/* ============================================
   Pagination
   ============================================ */
.resort-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 0;
    margin-top: 2rem;
}

.pagination__btn {
    padding: 0.625rem 1rem;
    background: var(--color-surface, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    border-radius: 0.5rem;
    color: var(--color-text, #fff);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination__btn:hover:not(:disabled) {
    background: var(--color-surface-hover, rgba(255, 255, 255, 0.1));
    border-color: var(--color-primary, #6366f1);
}

.pagination__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination__pages {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination__page {
    min-width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    color: var(--color-text-muted, rgba(255, 255, 255, 0.6));
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination__page:hover {
    background: var(--color-surface, rgba(255, 255, 255, 0.05));
    color: var(--color-text, #fff);
}

.pagination__page--active {
    background: var(--color-primary, #6366f1);
    color: #fff;
    font-weight: 600;
}

.pagination__ellipsis {
    padding: 0 0.5rem;
    color: var(--color-text-muted, rgba(255, 255, 255, 0.4));
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 640px) {
    .filter-panel {
        max-width: 100%;
        border-left: none;
    }

    .filter-toggle-bar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .filter-toggle-btn {
        justify-content: center;
    }

    .pagination__btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .pagination__page {
        min-width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }
}