/**
 * 地域選択機能 完全修正版 CSS
 */

/* === 地域選択ボタン === */
.ts-area-select-container {
    margin: 20px 0;
    text-align: center;
}

.ts-area-select-button {
    background: linear-gradient(135deg, #007cba, #005a87);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ts-area-select-button:hover {
    background: linear-gradient(135deg, #005a87, #007cba);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.4);
}

.ts-area-select-icon {
    font-size: 18px;
}

/* === モーダルオーバーレイ === */
.ts-area-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

/* === モーダル本体 === */
.ts-area-selector-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { 
        opacity: 0; 
        transform: scale(0.9) translateY(-20px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

/* === モーダルヘッダー === */
.ts-area-selector-header {
    padding: 20px 25px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.ts-area-selector-header h2 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.ts-close-button {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.ts-close-button:hover {
    background: #f0f0f0;
    color: #333;
}

/* === モーダルコンテンツ === */
.ts-area-selector-content {
    padding: 0;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

/* === 地域タブ === */
.ts-region-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    overflow-x: auto;
}

.ts-region-tab {
    background: none;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.ts-region-tab:hover {
    background: #e9ecef;
    color: #333;
}

.ts-region-tab.active {
    background: white;
    color: #007cba;
    border-bottom-color: #007cba;
    font-weight: 600;
}

/* === 都道府県リスト === */
.ts-prefecture-list {
    padding: 20px;
}

.ts-prefecture-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    margin-bottom: 10px;
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.ts-prefecture-item:hover {
    border-color: #007cba;
    background: #f8f9ff;
    transform: translateX(5px);
}

.ts-prefecture-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.ts-prefecture-only-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ts-prefecture-only-btn:hover {
    background: #005a87;
    transform: scale(1.05);
}

/* === 市区町村リスト === */
.ts-city-list {
    padding: 20px;
}

.ts-city-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.ts-back-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.ts-back-button:hover {
    background: #5a6268;
    transform: translateX(-3px);
}

.ts-city-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.ts-city-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.ts-city-item {
    background: white;
    border: 2px solid #f0f0f0;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.2s ease;
    text-align: center;
}

.ts-city-item:hover {
    border-color: #007cba;
    background: #f8f9ff;
    color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.2);
}

/* === レスポンシブ対応 === */
@media (max-width: 768px) {
    .ts-area-selector-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .ts-area-selector-header {
        padding: 15px 20px;
    }
    
    .ts-area-selector-header h2 {
        font-size: 18px;
    }
    
    .ts-region-tabs {
        flex-wrap: wrap;
    }
    
    .ts-region-tab {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .ts-prefecture-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .ts-prefecture-only-btn {
        align-self: flex-end;
    }
    
    .ts-city-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }
    
    .ts-city-item {
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .ts-area-select-button {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .ts-area-selector-modal {
        width: 98%;
        max-height: 95vh;
    }
    
    .ts-city-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* === アニメーション === */
.ts-prefecture-item,
.ts-city-item {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === スクロールバーカスタマイズ === */
.ts-area-selector-content::-webkit-scrollbar {
    width: 8px;
}

.ts-area-selector-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.ts-area-selector-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.ts-area-selector-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
