/**
 * 병원정보 검색 - hospital_search.css 확장
 */

/* ===== 필수/선택 마크 ===== */
.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;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-hint i {
    color: #f59e0b;
}

/* 모바일 폼 힌트 */
.mobile-form-hint {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mobile-form-hint i {
    color: #f59e0b;
}

/* 검색 키워드 표시 */
.search-keywords {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #92400e;
}

/* 검색 결과 없음 힌트 */
.no-results-message .hint {
    font-size: 13px;
    color: var(--gray-400);
    margin-top: 8px;
}

/* ===== 출처 배지 ===== */
.source-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 10px;
}

.source-badge.db {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.source-badge.api {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

/* ===== 병원 결과 카드 ===== */
.hospital-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);
}

.hospital-result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: #10b981;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.hospital-info {
    flex: 1;
    min-width: 0;
}

.hospital-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 8px 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;
}

.meta-badge.doctor-badge {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

/* ===== 병원 상세 정보 ===== */
.hospital-details {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-icon {
    width: 24px;
    color: var(--gray-400);
    flex-shrink: 0;
    text-align: center;
}

.detail-content {
    flex: 1;
    min-width: 0;
}

.detail-label {
    font-size: 11px;
    color: var(--gray-500);
    margin-bottom: 2px;
}

.detail-value {
    font-size: 14px;
    color: var(--gray-800);
    word-break: break-all;
}

.detail-value a {
    color: #0ea5e9;
    text-decoration: none;
}

.detail-value a:hover {
    text-decoration: underline;
}

/* ===== 액션 버튼 ===== */
.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.action-btn.map-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.action-btn.map-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.action-btn.call-btn {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
}

.action-btn.call-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.action-btn.web-btn {
    background: var(--gray-100);
    color: var(--gray-700);
}

.action-btn.web-btn:hover {
    background: var(--gray-200);
}

/* ===== 페이지네이션 ===== */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.pagination-container ul {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 6px;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-container a,
.pagination-container span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-fast);
    font-size: 14px;
}

.pagination-container a:hover {
    border-color: #10b981;
    color: #10b981;
    transform: translateY(-2px);
}

.pagination-container li.active span {
    background: linear-gradient(135deg, #10b981, #059669);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

/* ===== 로딩/푸터 ===== */
.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: #10b981;
    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;
}

.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;
    position: relative;
    z-index: 1;
}

/* 검색 결과가 많아도 푸터가 밑으로 밀리도록 */
.pc-search-interface {
    height: auto !important;
    min-height: calc(100vh - 280px);
}

.search-results-area {
    height: auto !important;
    min-height: 400px;
    overflow: visible !important;
}

.results-content {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.hospital-results {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.data-source-footer a {
    color: var(--gray-500);
    text-decoration: none;
    font-size: 13px;
}

/* ===== 빈 결과 ===== */
.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;
}

/* ===== 모바일 ===== */
@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, #10b981 0%, #059669 100%);
        box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
    }

    .hospital-result-card {
        padding: 16px;
    }

    .card-header {
        flex-direction: column;
    }

    .hospital-name {
        font-size: 1rem;
    }

    .card-actions {
        flex-wrap: wrap;
    }

    .action-btn {
        flex: 1 1 45%;
    }

    .data-source-footer {
        margin-bottom: 20px;
        padding-bottom: 100px;
        position: relative;
        z-index: 1;
    }
    
    /* PC 검색 인터페이스(왼쪽 사이드바)만 숨김 */
    .unified-search-page .pc-search-interface .search-sidebar {
        display: none;
    }
    
    /* 검색 결과 영역은 모바일에서도 보이게 오버라이드 */
    .unified-search-page .search-results-area {
        display: block !important;
        margin: 0; /* 부모 컨테이너 마진 제거 */
        padding: 0; /* 부모 컨테이너 패딩 제거 */
        border-radius: 0;
        min-height: 200px;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        flex: none !important;
    }
    
    /* PC 검색 인터페이스 레이아웃 조정 (결과만 표시) */
    .unified-search-page .pc-search-interface {
        display: block !important;
        grid-template-columns: 1fr !important;
        gap: 0;
        min-height: auto !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    /* 메인 콘텐츠가 푸터를 밀도록 */
    .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;
    }
    
    /* 결과 컨테이너도 높이 자동 */
    #resultsContainer {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    .results-content,
    #resultsList,
    .hospital-results {
        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 .hospital-results {
        padding: 0;
    }
    
    /* 병원 결과 카드 좌우 마진 축소 */
    .hospital-result-card {
        margin-left: 0;
        margin-right: 0;
        border-radius: var(--radius-md);
    }
}

@media (min-width: 769px) {
    .mobile-floating-buttons {
        display: none;
    }
    
    .mobile-search-interface {
        display: none;
    }
}

