/* 전국 지사 찾기 스타일 - 새로운 레이아웃 */

/* 탭 버튼 스타일 */
.tab-buttons {
    display: flex;
    gap: 0;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    justify-content: center;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-weight: 600;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.tab-btn:hover {
    background: rgba(0,123,255,0.1);
    color: #007bff;
}

.tab-btn.active {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

/* 페이지 타이틀 */
#pageTitle {
    text-align: center;
    color: #343a40;
    font-weight: 700;
    margin-bottom: 25px;
    font-size: 24px;
}

/* 검색 영역 스타일 */
.search-area {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #dee2e6;
}

/* 인라인 검색 컨트롤 */
.search-controls-inline {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.region-select {
    min-width: 140px;
    max-width: 180px;
    flex: 0 0 auto;
    /* padding: 10px 15px; */
    border: 2px solid #007bff;
    border-radius: 6px;
    background-color: #fff;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.region-select:hover {
    border-color: #0056b3;
    box-shadow: 0 2px 8px rgba(0,123,255,0.2);
}

.region-select:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.search-select {
    min-width: 120px;
    max-width: 200px;
    flex: 0 0 auto;
    position: relative;
    background-image: auto;
}

/* Select 박스 스타일링 */
.search-select select {
    width: 100%;
    padding: 8px 30px 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: #fff;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    transition: border-color 0.2s ease;
    /* 기본 화살표 제거 */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* 커스텀 화살표 배경 */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
}

.search-select select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.search-select select:hover {
    border-color: #adb5bd;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

/* Input 박스 스타일링 */
.search-input input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: #fff;
    font-size: 14px;
    color: #495057;
    transition: border-color 0.2s ease;
}

.search-input input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.search-input input:hover {
    border-color: #adb5bd;
}

.search-input input::placeholder {
    color: #6c757d;
}

.search-btn, .reset-btn {
    padding: 8px 20px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    transition: all 0.3s ease;
}

.search-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.4);
}

.reset-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.reset-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108,117,125,0.4);
}

/* 메인 컨텐츠 레이아웃 */
.main-content-row {
    margin: 0 -10px;
}

.branch-list-column, .map-column {
    padding: 0 10px;
}

/* 지사 목록 컨테이너 */
.branch-list-container {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    height: 600px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.branch-list-title {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 16px 20px;
    margin: 0;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    flex-shrink: 0;
}

/* 지사 아코디언 목록 */
.branch-accordion {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* 개별 지사 아이템 */
.branch-accordion-item {
    border-bottom: 1px solid #e9ecef;
}

.branch-accordion-item:last-child {
    border-bottom: none;
}

/* 지사 헤더 (클릭 가능한 부분) */
.branch-header {
    padding: 15px 15px;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.branch-header:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.branch-header.active {
    background: #e3f2fd;
    border-left: 4px solid #007bff;
    box-shadow: 0 2px 4px rgba(0,123,255,0.1);
}

/* 활성화된 상태에서 지사명 bold 처리 */
.branch-header.active .branch-name {
    font-weight: 600;
    color: #007bff;
}

.branch-name {
    font-size: 16px;
    font-weight: normal;
    color: #212529;
    margin: 0;
    transition: font-weight 0.2s ease;
}

.branch-toggle-icon {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #6c757d;
    transition: transform 0.2s ease, border-top-color 0.2s ease;
}

/* 아코디언 헤더 호버 시 화살표 색상 변경 */
.branch-header:hover .branch-toggle-icon {
    border-top-color: #007bff;
}

.branch-header.active .branch-toggle-icon {
    transform: rotate(180deg);
}

/* 활성화된 상태에서도 호버 효과 적용 */
.branch-header.active:hover .branch-toggle-icon {
    border-top-color: #0056b3;
}

/* 지사 상세 정보 (아코디언 내용) */
.branch-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f8f9fa;
}

.branch-content.active {
    max-height: 300px;
}

.branch-details {
    padding: 16px 20px;
}

.branch-details .detail-item {
    margin-bottom: 5px;
    font-size: 14px;
    line-height: 1.4;
    display: flex;
    gap: 6px;
}

.branch-details .detail-item:last-child {
    margin-bottom: 0;
}

.branch-details .detail-label {
    font-weight: 600;
    color: #495057;
    display: block;
    margin-bottom: 4px;
    width: 80px;
    flex:none;
}

.branch-details .detail-value {
    color: #212529;
}

.branch-details a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.branch-details a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 지도 컨테이너 */
.map-container {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

#map {
    border-radius: 12px;
}

/* 반응형 디자인 */
@media (max-width: 991px) {
    .main-content-row {
        flex-direction: column;
    }
    
    .branch-list-column {
        order: 1;
        margin-bottom: 20px;
    }
    
    .map-column {
        order: 2;
    }
    
    .branch-list-container {
        height: 400px;
    }
    
    #map {
        height: 500px !important;
    }
}

@media (max-width: 768px) {
    .search-controls-inline {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .search-select,
    .search-input,
    .search-btn,
    .reset-btn {
        width: 100%;
        margin: 0;
    }
    
    .search-select select,
    .search-input input {
        width: 100%;
    }
    
    .branch-list-container {
        height: 350px;
    }
    
    #map {
        height: 400px !important;
    }
    
    .branch-header {
        padding: 12px 16px;
    }
    
    .branch-details {
        padding: 12px 16px;
    }
    
    .branch-name {
        font-size: 15px;
    }
}

/* 로딩 및 에러 상태 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 16px;
    color: #6c757d;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 16px;
}

.no-results::before {
    content: '🔍';
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
}

/* 기존 스타일 숨김 */
.branch-card,
.branch-item {
    display: none !important;
}