/**
 * 비급여 진료비 조회 - insurance_calc_modern.css 확장
 * 기존 스타일을 상속받고 hospital_search 전용 스타일 추가
 */

/* ===== 비급여 검색 전용 - 푸터가 밀려나도록 설정 ===== */
.unified-search-page .main-content {
    min-height: auto !important;
    height: auto !important;
}

.unified-search-page .main-wrapper {
    height: auto !important;
    min-height: auto !important;
}

.unified-search-page .insurance-content {
    height: auto !important;
    min-height: auto !important;
}

/* ===== 필수/선택 마크 ===== */
.required-mark {
    color: #ef4444;
    font-weight: 600;
}

.optional-mark {
    color: var(--gray-400);
    font-size: 0.85em;
    font-weight: 400;
}

/* ===== 폼 힌트 ===== */
.form-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 6px;
}

/* ===== 검색 결과 카드 (비급여용) ===== */
.nonpayment-result-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    transition: all var(--transition-normal);
}

.nonpayment-result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: #627eea;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.hospital-info {
    flex: 1;
    min-width: 0;
}

.hospital-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.hospital-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 12px;
    color: var(--gray-600);
}

.meta-badge.type-badge {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    color: #3730a3;
}

.meta-badge.location-badge {
    background: linear-gradient(135deg, #dcfce7 0%, #d1fae5 100%);
    color: #166534;
}

/* ===== 비급여 항목 정보 ===== */
.nonpayment-info {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 12px;
}

.nonpayment-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.price-box {
    text-align: center;
    flex: 1;
}

.price-label {
    font-size: 11px;
    color: var(--gray-500);
    margin-bottom: 2px;
}

.price-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #4f46e5;
}

.price-divider {
    color: var(--gray-300);
    font-size: 1.2rem;
}

/* ===== 적용일자 ===== */
.apply-date {
    font-size: 12px;
    color: var(--gray-500);
    text-align: right;
}

/* ===== 더보기 버튼 ===== */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    padding: 20px;
}

.load-more-btn {
    width: 100%;
    max-width: 400px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #627eea 0%, #8b5cf6 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(98, 126, 234, 0.3);
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(98, 126, 234, 0.4);
}

.load-more-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.load-more-btn i {
    font-size: 18px;
}

.load-complete-message {
    text-align: center;
    padding: 16px;
    color: #10b981;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.load-complete-message i {
    font-size: 16px;
}

/* ===== 가격 비교 헤더 ===== */
.comparison-header {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #7dd3fc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.comparison-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #0369a1;
    margin-bottom: 16px;
}

.comparison-title i {
    font-size: 20px;
}

.comparison-stats {
    display: flex;
    justify-content: space-around;
    gap: 16px;
}

.stat-item {
    text-align: center;
    flex: 1;
    padding: 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
}

.stat-min { color: #10b981; }
.stat-avg { color: #627eea; }
.stat-max { color: #f59e0b; }

/* ===== 최저가 카드 강조 ===== */
.comparison-card {
    position: relative;
}

.comparison-card.lowest-price {
    border: 2px solid #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.lowest-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.lowest-badge i {
    font-size: 10px;
    color: #fbbf24;
}

.highlight-price {
    color: #10b981 !important;
    font-weight: 800 !important;
}

/* 모바일 가격 비교 */
@media (max-width: 768px) {
    .comparison-header {
        padding: 16px;
    }
    
    .comparison-title {
        font-size: 16px;
    }
    
    .comparison-stats {
        flex-wrap: wrap;
    }
    
    .stat-item {
        padding: 10px 8px;
        min-width: 80px;
    }
    
    .stat-value {
        font-size: 15px;
    }
    
    .load-more-btn {
        padding: 14px 24px;
        font-size: 15px;
    }
}

/* ===== 데이터 출처 푸터 ===== */
.data-source-footer {
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--gray-200);
    margin-top: 32px;
}

.data-source-footer a {
    color: var(--gray-500);
    text-decoration: none;
    font-size: 13px;
}

.data-source-footer a:hover {
    color: #627eea;
}

/* ===== 로딩 오버레이 ===== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-content {
    text-align: center;
    background: var(--white);
    padding: 40px 56px;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: #627eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 15px;
    color: var(--gray-700);
    font-weight: 500;
}

/* 백그라운드 로딩 메시지 스타일 */
.loading-message {
    padding: 60px 20px;
    text-align: center;
    color: var(--gray-600);
}

.loading-message p {
    margin-top: 20px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-500);
}

.loading-spinner-small {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: #627eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

/* ===== 빈 결과 메시지 ===== */
.no-results-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.no-results-message i {
    font-size: 56px;
    opacity: 0.3;
    margin-bottom: 20px;
    display: block;
}

.no-results-message h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.no-results-message p {
    font-size: 14px;
    color: var(--gray-500);
}

/* ============================================
   📱 모바일 반응형
   ============================================ */

@media (max-width: 768px) {
    /* 플로팅 버튼 - 겹침 방지 및 하단 간격 */
    .mobile-floating-buttons {
        position: fixed;
        bottom: 100px; /* 푸터 위로 올림 */
        right: 16px;
        display: flex;
        flex-direction: column; /* 세로 배치로 겹침 방지 */
        gap: 12px;
        z-index: 9998; /* 오버레이(10000)보다 낮게 */
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    /* 하단바가 열렸을 때 플로팅 버튼 숨김 */
    body.mobile-search-active .mobile-floating-buttons {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .mobile-back-trigger,
    .mobile-search-trigger {
        width: 52px;
        height: 52px;
        border: none;
        border-radius: 50%;
        color: white;
        font-size: 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }

    .mobile-back-trigger {
        background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
        box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
    }

    .mobile-search-trigger {
        background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
        box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4);
    }

    .mobile-back-trigger:active,
    .mobile-search-trigger:active {
        transform: scale(0.95);
    }

    /* 카드 스타일 */
    .nonpayment-result-card {
        padding: 16px;
        margin-bottom: 12px;
    }

    .card-header {
        flex-direction: column;
        gap: 12px;
    }

    .hospital-name {
        font-size: 1rem;
    }

    .price-row {
        flex-direction: row;
    }

    .price-value {
        font-size: 1rem;
    }

    /* 페이지네이션 */
    .pagination-container a,
    .pagination-container span {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

/* PC에서 모바일 요소 숨김 */
@media (min-width: 769px) {
    .mobile-floating-buttons {
        display: none;
    }
    
    .mobile-search-interface {
        display: none;
    }
}

/* 모바일에서 PC 요소 숨김 - 비급여 검색 전용 */
/* PC에서 2열 레이아웃 유지 (비급여 검색 전용) */
@media (min-width: 769px) {
    .unified-search-page .pc-search-interface {
        display: grid !important;
        grid-template-columns: 380px 1fr;
        gap: 20px;
        height: auto !important;  /* 고정 높이 제거 */
        min-height: 500px;
        align-items: start;
    }
    
    .unified-search-page .search-results-area {
        display: flex !important;
        flex-direction: column;
        height: auto !important;      /* 고정 높이 제거 */
        min-height: 400px !important; /* 최소 높이만 설정 */
        max-height: none !important;  /* 최대 높이 제한 없음 */
        overflow: visible !important; /* 오버플로우 표시 */
    }
    
    .unified-search-page .results-content {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    .unified-search-page .insurance-results,
    .unified-search-page #resultsList {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

@media (max-width: 768px) {
    /* PC 검색 인터페이스(왼쪽 사이드바)만 숨김 */
    .unified-search-page .pc-search-interface .search-sidebar {
        display: none;
    }
    
    /* 검색 결과 영역은 모바일에서도 보이게 오버라이드 */
    .unified-search-page .search-results-area {
        display: flex !important;
        flex-direction: column;
        margin: 0; /* 부모 컨테이너 마진 제거 */
        padding: 0; /* 부모 컨테이너 패딩 제거 */
        border-radius: 0;
        min-height: 200px;
    }
    
    /* PC 검색 인터페이스 레이아웃 조정 (결과만 표시) */
    .unified-search-page .pc-search-interface {
        display: block !important;
        grid-template-columns: 1fr !important;
        gap: 0;
    }
    
    /* 데이터 출처 푸터 - 플로팅 버튼 공간 확보 */
    .data-source-footer {
        margin-bottom: 20px;
        padding-bottom: 100px; /* 플로팅 버튼이 가리지 않도록 */
        position: relative;
        z-index: 1;
    }
    
    /* 메인 콘텐츠가 푸터를 밀도록 */
    .main-content {
        min-height: auto !important;
        height: auto !important;
        padding-bottom: 20px;
        display: block !important;
        overflow: visible !important;
    }
    
    /* 메인 래퍼 높이 자동 */
    .main-wrapper {
        min-height: auto !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    /* 결과 영역이 화면 전체를 사용하도록 */
    .insurance-content {
        min-height: auto !important;
        height: auto !important;
        padding: 0 !important;
        overflow: visible !important;
    }
    
    /* PC 검색 인터페이스 높이 자동 */
    .pc-search-interface {
        min-height: auto !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    /* 모바일 결과 영역 overflow 허용 */
    .unified-search-page .search-results-area {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        flex: none !important;
    }
    
    .unified-search-page .results-content,
    .unified-search-page #resultsList {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    /* 결과 컨테이너도 높이 자동 */
    #resultsContainer {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    /* 결과 헤더 모바일 조정 */
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 10px; /* 좌우 패딩 10px로 축소 */
    }
    
    /* 결과 내용 패딩 - 좌우만 10px */
    .results-content {
        padding: 0 10px 16px;
    }
    
    /* 결과 리스트 패딩 제거 */
    .unified-search-page #resultsList,
    .unified-search-page .insurance-results {
        padding: 0;
    }
    
    /* 비급여 결과 카드 좌우 마진 축소 */
    .nonpayment-result-card {
        margin-left: 0;
        margin-right: 0;
        border-radius: var(--radius-md);
    }
}

/* ===== 모바일 검색 결과 (히어로 아래) ===== */
.mobile-results-section {
    display: none;
    padding: 16px;
}

@media (max-width: 768px) {
    .mobile-results-section.active {
        display: block;
    }
}

/* ================================================
   순차적 필터링 UI 스타일
   ================================================ */

/* 안내 메시지 */
.filter-guide-message {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    border: 1px solid #7dd3fc;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.filter-guide-message i {
    color: #0284c7;
    font-size: 18px;
}

.filter-guide-message span {
    flex: 1;
    min-width: 200px;
    color: #0369a1;
    font-size: 14px;
    line-height: 1.5;
}

.filter-guide-message .guide-tip {
    width: 100%;
    font-size: 13px;
    color: #0891b2;
    margin-top: 4px;
}

/* 병원 선택 카드 */
.hospital-select-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
}

.hospital-select-card:hover {
    border-color: #627eea;
    background: linear-gradient(135deg, #f8faff 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(98, 126, 234, 0.15);
    transform: translateX(4px);
}

.hospital-select-info {
    flex: 1;
}

.hospital-select-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hospital-select-name i {
    color: #627eea;
}

.hospital-select-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hospital-select-count {
    text-align: center;
    padding: 8px 16px;
    background: linear-gradient(135deg, #627eea 0%, #8b5cf6 100%);
    border-radius: var(--radius-md);
    min-width: 60px;
}

.hospital-select-count .count-number {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.hospital-select-count .count-label {
    display: block;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 2px;
}

.hospital-addr {
    font-size: 12px;
    color: var(--gray-500);
    margin: 8px 0 0 0;
    line-height: 1.4;
}

.hospital-select-arrow {
    color: var(--gray-400);
    font-size: 16px;
    flex-shrink: 0;
}

.hospital-select-card:hover .hospital-select-arrow {
    color: #627eea;
}

/* 카테고리 선택 카드 */
.category-select-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
}

.category-select-card:hover {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
    transform: translateX(4px);
}

.category-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.category-icon i {
    font-size: 20px;
    color: white;
}

.category-info {
    flex: 1;
}

.category-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 4px 0;
}

.category-price-range {
    font-size: 13px;
    color: var(--gray-600);
}

.category-count {
    text-align: center;
    padding: 8px 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: var(--radius-md);
    min-width: 50px;
}

.category-count .count-number {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.category-count .count-label {
    display: block;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 2px;
}

.category-arrow {
    color: var(--gray-400);
    font-size: 16px;
}

.category-select-card:hover .category-arrow {
    color: #10b981;
}

/* 브레드크럼 네비게이션 */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumb-nav a {
    color: #627eea;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.breadcrumb-nav a:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.breadcrumb-nav a::after {
    content: '/';
    margin-left: 8px;
    color: var(--gray-400);
}

.breadcrumb-nav .breadcrumb-current {
    color: var(--gray-600);
    font-weight: 500;
}

.breadcrumb-nav .breadcrumb-current::after {
    display: none;
}

/* 전체 항목 보기 버튼 */
.view-all-btn-wrapper {
    margin-bottom: 20px;
}

.view-all-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    color: var(--gray-700);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.view-all-btn:hover {
    background: linear-gradient(135deg, #627eea 0%, #8b5cf6 100%);
    border-color: transparent;
    color: white;
}

.view-all-btn i {
    font-size: 16px;
}

/* 애니메이션 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .filter-guide-message {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .hospital-select-card,
    .category-select-card {
        padding: 14px 16px;
        gap: 12px;
    }
    
    .hospital-select-name,
    .category-name {
        font-size: 15px;
    }
    
    .hospital-select-count,
    .category-count {
        padding: 6px 12px;
        min-width: 50px;
    }
    
    .hospital-select-count .count-number,
    .category-count .count-number {
        font-size: 16px;
    }
    
    .category-icon {
        width: 42px;
        height: 42px;
    }
    
    .breadcrumb-nav {
        font-size: 13px;
        padding: 10px 12px;
        gap: 6px;
    }
}

/* ================================================
   듀얼 검색 모드 UI
   ================================================ */

/* 검색 모드 탭 */
.search-mode-tabs {
    display: flex;
    gap: 8px;
    padding: 0 20px;
    margin-bottom: 20px;
}

.search-mode-tab {
    flex: 1;
    padding: 14px 16px;
    background: var(--gray-100);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.search-mode-tab i {
    font-size: 18px;
}

.search-mode-tab:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-700);
}

.search-mode-tab.active {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border-color: #627eea;
    color: #627eea;
}

/* 모드 설명 */
.mode-description {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--gray-600);
}

.mode-description i {
    color: #627eea;
    font-size: 16px;
}

/* 검색 모드 컨텐츠 */
.search-mode-content {
    display: none;
}

.search-mode-content.active {
    display: block;
}

/* ===== 자동완성 ===== */
/* 비급여 검색 - 사이드바 overflow 조정 (자동완성이 잘리지 않도록) */
#hospital-search-mode,
#direct-search-mode {
    overflow: visible !important;
}

.search-form-container {
    overflow: visible !important;
}

/* 사이드바 자체도 overflow visible */
.unified-search-page .search-sidebar {
    overflow: visible !important;
}

/* 자동완성을 포함한 폼 그룹 - 스태킹 컨텍스트 생성 */
.search-form .form-group {
    position: relative;
    z-index: 10;
}

.search-form .form-group:first-child {
    z-index: 100;
}

.autocomplete-wrapper {
    position: relative;
    z-index: 1000;
}

.autocomplete-spinner {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #627eea;
    z-index: 1001;
}

.autocomplete-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    max-height: 300px;
    z-index: 9999 !important;
    overflow-y: auto;
    z-index: 100;
    margin-top: 4px;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: all 0.15s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: linear-gradient(135deg, #f8faff 0%, #ffffff 100%);
}

.autocomplete-item-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.autocomplete-item-name i {
    color: #627eea;
    font-size: 14px;
}

.autocomplete-item-meta {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 8px;
}

.autocomplete-item-meta .type-badge {
    background: #dbeafe;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.autocomplete-empty {
    padding: 20px;
    text-align: center;
    color: var(--gray-500);
    font-size: 14px;
}

/* ===== 선택된 병원 카드 ===== */
.selected-hospital-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 2px solid #10b981;
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.selected-hospital-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #059669;
    font-weight: 600;
    margin-bottom: 10px;
}

.selected-hospital-header i {
    font-size: 16px;
}

.clear-selection-btn {
    margin-left: auto;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(16, 185, 129, 0.2);
    border-radius: 50%;
    color: #059669;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.clear-selection-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

.selected-hospital-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 6px 0;
}

.selected-hospital-info p {
    font-size: 13px;
    color: var(--gray-600);
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.selected-hospital-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selected-hospital-meta .meta-badge {
    font-size: 11px;
    padding: 4px 10px;
}

/* ===== 빠른 검색 제안 ===== */
.quick-search-suggestions {
    margin-top: 30px;
    text-align: center;
}

.quick-search-suggestions h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 16px;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.suggestion-tag {
    padding: 10px 18px;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-tag:hover {
    border-color: #627eea;
    color: #627eea;
    background: #f8faff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(98, 126, 234, 0.2);
}

/* ===== 검색 정보 ===== */
.search-info {
    font-size: 13px;
    color: var(--gray-500);
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--gray-300);
}

/* ===== 정보 섹션 팁 목록 ===== */
.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

.tips-list li {
    padding: 6px 0;
    color: var(--gray-600);
    line-height: 1.5;
}

.tips-list li strong {
    color: #627eea;
}

/* ================================================
   모바일 검색 탭 스타일
   ================================================ */

.mobile-search-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.mobile-tab {
    flex: 1;
    padding: 12px 10px;
    background: var(--gray-100);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mobile-tab.active {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border-color: #627eea;
    color: #627eea;
}

.mobile-tab-content {
    display: none;
}

.mobile-tab-content.active {
    display: block;
}

/* 모바일 선택된 병원 */
@media (max-width: 768px) {
    .selected-hospital-card {
        padding: 14px;
    }
    
    .selected-hospital-info h4 {
        font-size: 15px;
    }
    
    .selected-hospital-info p {
        font-size: 12px;
    }
    
    .autocomplete-results {
        max-height: 250px;
    }
    
    .autocomplete-item {
        padding: 10px 14px;
    }
    
    .suggestion-tags {
        gap: 8px;
    }
    
    .suggestion-tag {
        padding: 8px 14px;
        font-size: 13px;
    }
}
