/*
 * ジムフィルター CSS（モダンデザイン）
 */

/* ========================================
   エリアページ全体
======================================== */
.gym-area-page {
    background: #f9fafb;
    min-height: 100vh;
}

/* ========================================
   ヘッダー
======================================== */
.area-header {
    background: #fff;
    padding: 40px 20px 32px;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.area-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #111827;
    letter-spacing: -0.02em;
}

.area-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gym-count {
    font-size: 16px;
    color: #6b7280;
}

.gym-count::before {
    content: '検索結果：';
}

.filter-toggle-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.filter-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

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

/* ========================================
   レイアウト
======================================== */
.area-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
    padding: 32px 0px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ========================================
   フィルターサイドバー
======================================== */
.filter-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

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

.filter-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.filter-close {
    display: none;
    background: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.filter-content {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(100vh - 240px);
}

.filter-content::-webkit-scrollbar {
    width: 6px;
}

.filter-content::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.filter-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.filter-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ========================================
   フィルターセクション
======================================== */
.filter-section {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid #f3f4f6;
}

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

.filter-section-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-section-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 2px;
}

/* ========================================
   価格スライダー
======================================== */
.price-slider-wrapper {
    padding: 16px 8px;
    background: #f9fafb;
    border-radius: 12px;
}

#price-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #dbeafe 0%, #3b82f6 100%);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

#price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #3b82f6;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    transition: all 0.2s;
}

#price-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
}

#price-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #3b82f6;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.price-display {
    margin-top: 16px;
    text-align: center;
}

#price-value {
    font-size: 24px;
    font-weight: 700;
    color: #3b82f6;
}

.price-display::after {
    content: '円まで';
    font-size: 14px;
    color: #6b7280;
    margin-left: 4px;
}

/* ========================================
   チェックボックス
======================================== */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-checkbox:hover {
    background: #f9fafb;
}

.filter-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #3b82f6;
    border-radius: 4px;
}

.checkbox-label {
    font-size: 14px;
    color: #374151;
    user-select: none;
    font-weight: 500;
}

.filter-checkbox input:checked + .checkbox-label {
    color: #1e40af;
    font-weight: 600;
}

/* ========================================
   アクションボタン
======================================== */
.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #f3f4f6;
}

.btn-filter-apply,
.btn-filter-reset {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-filter-apply {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-filter-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

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

.btn-filter-reset {
    background: #fff;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

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

/* ========================================
   メインコンテンツ
======================================== */
.area-main {
    min-width: 0;
}

/* 選択中の条件タグ */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.active-filters:empty {
    display: none;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

/* ローディング */
.filter-loading {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 16px;
}

.loading-spinner {
    width: 56px;
    height: 56px;
    border: 5px solid #f3f4f6;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.filter-loading p {
    color: #6b7280;
    font-size: 15px;
    font-weight: 500;
}

/* 検索結果なし */
.no-results {
    text-align: center;
    padding: 100px 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    grid-column: 1 / -1;
}

.no-results svg {
    color: #d1d5db;
    margin-bottom: 24px;
}

.no-results p {
    font-size: 18px;
    color: #6b7280;
    margin: 0 0 24px;
    font-weight: 500;
}

.btn-reset-filter {
    padding: 14px 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s;
}

.btn-reset-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* ========================================
   レスポンシブ（タブレット）
======================================== */
@media (max-width: 1200px) {
    .area-layout {
        grid-template-columns: 280px 1fr;
        gap: 24px;
    }
}

@media (max-width: 1024px) {
    .area-layout {
        grid-template-columns: 260px 1fr;
    }
    
    .gym-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* ========================================
   レスポンシブ（スマホ）
======================================== */
@media (max-width: 768px) {
    .area-header {
        padding: 10px 5px 10px;
    }
    
    .area-title {
        font-size: 24px;
    }
    
    .filter-toggle-btn {
        display: flex;
    }
    
    .area-layout {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 16px 1px;
    }
    
    /* ボトムシート */
    .filter-sidebar {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        height: 85vh;
        max-height: none;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
    }
    
    .filter-sidebar.active {
        transform: translateY(0);
    }
    
    .filter-header {
        padding: 20px 24px;
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        border-bottom: none;
    }
    
    .filter-title {
        color: #fff;
        font-size: 20px;
    }
    
    .filter-close {
        display: block;
    }
    
    .filter-content {
        max-height: calc(85vh - 140px);
        padding: 20px;
    }
    
    /* オーバーレイ */
    body.filter-open::after {
        content: '';
/*         position: fixed; */
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1000;
        animation: fadeIn 0.3s;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    .gym-grid {
        grid-template-columns: 1fr;
    }
    
    .active-filters {
        padding: 12px;
    }
    
    .filter-tag {
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .area-title {
        font-size: 20px;
    }
    
    .filter-toggle-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* フィルター開閉アニメーション（スマホ） */
.gym-filter__form.is-collapsed {
    display: none;
}

@media (max-width: 768px) {
    .gym-filter__form.is-collapsed {
        display: none;
    }
    
    .gym-filter__toggle {
        display: block;
        width: 100%;
        padding: 16px 20px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        text-align: left;
        margin-bottom: 16px;
    }
    
    .gym-filter__toggle .toggle-icon {
        float: right;
        transition: transform 0.3s ease;
    }
    
    /* チェックボックスを縦並び */
    .gym-filter__checkboxes {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    /* ボタンを横並びに */
    .gym-filter__actions {
        display: flex;
        gap: 10px;
    }
    
    .gym-filter__button {
        flex: 1;
    }
}

/* チェックボックスコントロール */
.gym-filter__checkbox-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.gym-filter__checkbox-controls .control-btn {
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gym-filter__checkbox-controls .control-btn:hover {
    background: #e5e5e5;
}

/* アクティブフィルター表示 */
.gym-filter__active {
    margin-top: 16px;
    padding: 12px 16px;
    background: #f0f7ff;
    border-left: 4px solid #667eea;
    border-radius: 4px;
    font-size: 14px;
}

.active-filters__label {
    font-weight: 600;
    color: #667eea;
}