/* 호스피톡 - 전국 장기요양기관 찾기 */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #16a34a;
    --bg-light: #f8fafc;
    --card-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* 네비게이션 */
.navbar-brand {
    font-size: 1.3rem;
    letter-spacing: -0.02em;
}

.navbar .form-control:focus {
    box-shadow: none;
    border-color: rgba(255,255,255,.5);
}

/* 히어로 섹션 */
.hero-section {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 50%, #1e3a8a 100%);
    color: white;
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: rgba(255,255,255,.04);
    transform: rotate(12deg);
    pointer-events: none;
}

.hero-search {
    max-width: 600px;
    margin: 0 auto;
}

.hero-search .form-control {
    border: none;
    padding: .8rem 1.2rem;
    font-size: 1.05rem;
    border-radius: 50px 0 0 50px;
}

.hero-search .btn {
    border-radius: 0 50px 50px 0;
    padding: .8rem 1.5rem;
}

/* 카드 스타일 */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: transform .2s, box-shadow .2s;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

/* 기관 목록 카드 */
.institution-card {
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    background: white;
    padding: 1rem 1.2rem;
    margin-bottom: .75rem;
    box-shadow: var(--card-shadow);
    transition: all .2s;
}

.institution-card:hover {
    border-left-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.institution-card .inst-name {
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    font-size: 1.05rem;
}

.institution-card .inst-name:hover {
    color: var(--primary);
}

.institution-card .inst-meta {
    font-size: .85rem;
    color: var(--secondary);
}

/* 뱃지 스타일 */
.badge-type {
    font-size: .75rem;
    font-weight: 500;
    padding: .3em .6em;
    border-radius: 6px;
}

.badge-type-a { background: #dbeafe; color: #1e40af; }
.badge-type-b { background: #dcfce7; color: #166534; }
.badge-type-c { background: #fef3c7; color: #92400e; }
.badge-type-g, .badge-type-m { background: #fce7f3; color: #9d174d; }
.badge-type-h, .badge-type-i { background: #e0e7ff; color: #3730a3; }

/* 통계 카드 */
.stat-card {
    text-align: center;
    padding: 1.5rem 1rem;
}

.stat-card .stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: .85rem;
    color: var(--secondary);
    margin-top: .3rem;
}

/* 지역 그리드 */
.region-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .75rem;
}

.region-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    text-decoration: none;
    color: #1e293b;
    transition: all .2s;
}

.region-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    color: var(--primary);
}

.region-card .region-name {
    font-weight: 600;
    font-size: .95rem;
}

.region-card .region-count {
    font-size: .8rem;
    color: var(--secondary);
}

/* 상세 페이지 */
.detail-header {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.detail-table th {
    background: #f1f5f9;
    width: 160px;
    font-weight: 600;
    font-size: .9rem;
}

.detail-table td {
    font-size: .9rem;
}

/* 지도 */
#map {
    height: 500px;
    border-radius: 12px;
    z-index: 1;
}

/* 빵가루 */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
    font-size: .85rem;
}

/* 반응형 */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }

    .hero-section h1 {
        font-size: 1.5rem;
    }

    .stat-card .stat-number {
        font-size: 1.4rem;
    }

    .region-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: .5rem;
    }

    .region-card {
        padding: .7rem;
    }

    #map {
        height: 350px;
    }

    .detail-table th {
        width: 100px;
    }

    .institution-card {
        padding: .8rem 1rem;
    }
}

@media (max-width: 480px) {
    .region-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 스크롤 부드럽게 */
html {
    scroll-behavior: smooth;
}

/* 검색 하이라이트 */
mark {
    background: #fef08a;
    padding: 0 2px;
    border-radius: 2px;
}

/* 로딩 스피너 */
.spinner-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* 인쇄 */
@media print {
    .navbar, footer, .no-print { display: none !important; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
