/* ================================================
   전국 의료장비 보유 현황 - 커스텀 스타일
   ================================================ */

:root {
    --primary: #0d6efd;
    --primary-dark: #0a4bc4;
    --primary-light: #e8f0fe;
    --secondary: #17a2b8;
    --accent: #28a745;
    --bg-light: #f8f9fa;
    --bg-section: #f0f4f8;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #dee2e6;
    --card-shadow: 0 2px 8px rgba(0,0,0,.08);
    --card-hover-shadow: 0 4px 16px rgba(0,0,0,.12);
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.2s ease;
}

/* ---- Base ---- */
body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background: var(--bg-light);
    line-height: 1.7;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}
a:hover {
    color: var(--primary-dark);
}

/* ---- Navbar ---- */
.bg-primary-custom {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%) !important;
}
.navbar-brand {
    font-size: 1.15rem;
}
.navbar .nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0.8rem !important;
    white-space: nowrap;
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
    background: rgba(255,255,255,.12);
    border-radius: var(--radius);
}
.header-search .form-control {
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 0.85rem;
}
.header-search .btn {
    border-radius: 0 var(--radius) var(--radius) 0;
}

.dropdown-menu-region {
    max-height: 400px;
    overflow-y: auto;
}
.dropdown-menu {
    border: none;
    box-shadow: var(--card-hover-shadow);
    border-radius: var(--radius);
}
.dropdown-item {
    font-size: 0.88rem;
    padding: 0.4rem 1rem;
}
.dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ---- Hero Section ---- */
.hero-section {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 60%, #6610f2 100%);
    color: #fff;
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}
.hero-section::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,.05);
    border-radius: 50%;
}
.hero-section h1 {
    font-size: 2rem;
    font-weight: 700;
}
.hero-section p.lead {
    font-size: 1.1rem;
    opacity: .9;
}
.hero-search {
    max-width: 680px;
    margin: 1.5rem auto 0;
}
.hero-search-form {
    display: flex;
    width: 100%;
}
.hero-search-input {
    flex: 1;
    min-width: 0;
    padding: 0.9rem 1.4rem;
    font-size: 1.05rem;
    border: none;
    border-radius: 0.75rem 0 0 0.75rem;
    outline: none;
    color: #212529;
}
.hero-search-input::placeholder {
    color: #adb5bd;
}
.hero-search-btn {
    flex-shrink: 0;
    padding: 0.9rem 1.6rem;
    background: #ffc107;
    border: none;
    border-radius: 0 0.75rem 0.75rem 0;
    color: #212529;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
}
.hero-search-btn:hover {
    background: #e0a800;
}

/* Quick filter buttons */
.quick-filters .btn {
    font-size: 0.82rem;
    padding: 0.3rem 0.8rem;
    border-radius: 2rem;
    margin: 0.2rem;
}

/* ---- Stats Cards ---- */
.stats-section {
    margin-top: -2rem;
    position: relative;
    z-index: 10;
}
.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-hover-shadow);
}
.stat-card .stat-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.stat-card .stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}
.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ---- Cards (General) ---- */
.card-custom {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
}
/* 그리드 컬럼 안에서만 equal-height 적용 */
[class*="col"] > .card-custom,
.card-custom.h-100 {
    height: 100%;
}
.card-custom:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-hover-shadow);
    border-color: var(--primary);
}
.card-custom .card-body {
    padding: 1.25rem;
}
.card-custom .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.card-custom .card-meta {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Region cards */
.region-card {
    text-align: center;
    padding: 1.5rem 1rem;
    cursor: pointer;
}
.region-card .region-icon {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.region-card .region-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.3rem;
}
.region-card .region-count {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Equipment cards */
.equip-card {
    border-left: 4px solid var(--primary);
}
.equip-card .equip-code {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

/* ---- Content Section ---- */
.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary);
    display: inline-block;
}
.section-bg {
    background: var(--bg-section);
    padding: 3rem 0;
}

/* ---- Tables ---- */
.table-custom {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}
.table-custom thead {
    background: var(--primary);
    color: #fff;
}
.table-custom thead th {
    font-weight: 500;
    font-size: 0.88rem;
    padding: 0.75rem;
    border: none;
    white-space: nowrap;
}
.table-custom tbody td {
    font-size: 0.88rem;
    padding: 0.65rem 0.75rem;
    vertical-align: middle;
}
.table-custom tbody tr:hover {
    background: var(--primary-light);
}

/* Responsive Table */
.table-responsive {
    border-radius: var(--radius);
}

/* ---- Filters ---- */
.filter-section {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}
.filter-section .form-label {
    font-size: 0.85rem;
    font-weight: 500;
}
.filter-section .form-select,
.filter-section .form-control {
    font-size: 0.88rem;
}

/* ---- Badge ---- */
.badge-type {
    font-size: 0.78rem;
    padding: 0.35em 0.65em;
    font-weight: 500;
}

/* ---- Bar Chart (CSS) ---- */
.bar-chart {
    list-style: none;
    padding: 0;
}
.bar-chart li {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}
.bar-chart .bar-label {
    width: 120px;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bar-chart .bar-wrap {
    flex: 1;
    height: 24px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 0.5rem;
}
.bar-chart .bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.5s ease;
}
.bar-chart .bar-value {
    width: 50px;
    text-align: right;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ---- Breadcrumb ---- */
.breadcrumb {
    background: none;
    padding: 0.75rem 0;
    font-size: 0.85rem;
}

/* ---- Search page ---- */
.search-result-item {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: var(--transition);
}
.search-result-item:hover {
    border-color: var(--primary);
    box-shadow: var(--card-shadow);
}
.search-result-item h3 {
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
}
.search-result-item .result-meta {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

mark {
    background: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
}

/* ---- Footer ---- */
.site-footer {
    font-size: 0.9rem;
    background: #212836 !important;
    border-top: none;
}
.site-footer .text-muted {
    color: #7b869a !important;
}
.site-footer hr {
    border-color: rgba(255,255,255,.06) !important;
}
.footer-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #dce1e9;
    position: relative;
    padding-bottom: 0.5rem;
}
.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 28px;
    height: 2px;
    background: #4a90d9;
}
.footer-links li {
    margin-bottom: 0.45rem;
}
.footer-links a {
    color: #8b95a8;
    font-size: 0.86rem;
    transition: var(--transition);
}
.footer-links a:hover {
    color: #e0e4eb;
    padding-left: 3px;
}
.site-footer .badge {
    background: rgba(74,144,217,.15) !important;
    color: #8bb8e8;
    font-weight: 400;
}
.site-footer a.text-muted {
    color: #8b95a8 !important;
}
.site-footer a.text-muted:hover {
    color: #e0e4eb !important;
}

/* ---- Back to Top ---- */
.btn-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    box-shadow: var(--card-shadow);
    font-size: 1rem;
}
.btn-back-to-top.show {
    display: flex;
}

/* ---- FAQ Accordion ---- */
.faq-accordion .accordion-button {
    font-weight: 500;
    font-size: 0.95rem;
}
.faq-accordion .accordion-body {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* ---- Admin ---- */
.admin-login-card {
    max-width: 400px;
    margin: 3rem auto;
}
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-light);
}
.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.progress-upload {
    height: 30px;
    border-radius: var(--radius);
}
.progress-upload .progress-bar {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 30px;
}

/* ---- Pagination ---- */
.pagination .page-link {
    font-size: 0.88rem;
    padding: 0.4rem 0.75rem;
    color: var(--primary);
    border-radius: var(--radius) !important;
    margin: 0 2px;
}
.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ---- Utilities ---- */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hover-lift {
    transition: var(--transition);
}
.hover-lift:hover {
    transform: translateY(-3px);
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .hero-section h1 { font-size: 1.5rem; }
    .hero-section p.lead { font-size: 1rem; }
    .stat-card .stat-number { font-size: 1.4rem; }
    .navbar .nav-link { padding: 0.5rem 1rem !important; }
    .header-search { margin-top: 0.5rem; }
}

@media (max-width: 767.98px) {
    .hero-section { padding: 2rem 0; }
    .hero-section h1 { font-size: 1.3rem; }
    .stat-card { padding: 1rem; }
    .stat-card .stat-number { font-size: 1.2rem; }
    .section-title { font-size: 1.2rem; }
    .footer-title { margin-top: 0.5rem; }
    .bar-chart .bar-label { width: 80px; font-size: 0.75rem; }

    /* Mobile table → card layout */
    .table-card-mobile thead { display: none; }
    .table-card-mobile tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
        padding: 0.75rem;
        background: #fff;
    }
    .table-card-mobile tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.3rem 0;
        border: none;
    }
    .table-card-mobile tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 1rem;
        flex-shrink: 0;
    }
}

@media (max-width: 575.98px) {
    .container { padding-left: 1rem; padding-right: 1rem; }
    .table-custom thead th,
    .table-custom tbody td { font-size: 0.8rem; padding: 0.5rem; }
}

/* ---- Guide Page ---- */
.guide-hero {
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
}
.guide-hero-icon {
    width: 64px;
    height: 64px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}
.guide-stat-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}
.guide-stat-card i {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 0.3rem;
    display: block;
}
.guide-stat-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}
.guide-stat-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}
.guide-section {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}
.guide-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--border-color);
}
.guide-section-title i {
    margin-right: 0.4rem;
}
.guide-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.guide-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.4rem 0;
    font-size: 0.92rem;
    line-height: 1.6;
}
.guide-list li i {
    margin-top: 0.3rem;
    flex-shrink: 0;
    font-size: 0.75rem;
}
.guide-bar-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
.guide-bar-label {
    width: 90px;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    color: var(--text-primary);
    text-decoration: none;
}
a.guide-bar-label:hover { color: var(--primary); }
.guide-bar-track {
    flex: 1;
    height: 20px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}
.guide-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #5a9cfc);
    border-radius: 4px;
    transition: width 0.4s ease;
}
.guide-bar-fill-info {
    background: linear-gradient(90deg, var(--secondary), #5ac8fa);
}
.guide-bar-value {
    width: 55px;
    text-align: right;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.guide-faq-btn {
    font-size: 0.95rem;
    font-weight: 500;
    background: var(--bg-light);
    border-radius: var(--radius) !important;
}
.guide-faq-btn:not(.collapsed) {
    background: var(--primary-light);
    color: var(--primary);
}
.guide-cta {
    background: linear-gradient(135deg, var(--primary) 0%, #0a58ca 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
}
.guide-cta p { color: rgba(255,255,255,.8); }
.guide-cta .btn-primary {
    background: #fff;
    color: var(--primary);
    border-color: #fff;
}
.guide-cta .btn-primary:hover {
    background: var(--primary-light);
}
.guide-cta .btn-outline-primary {
    color: #fff;
    border-color: rgba(255,255,255,.5);
}
.guide-cta .btn-outline-primary:hover {
    background: rgba(255,255,255,.15);
    border-color: #fff;
    color: #fff;
}
.guide-other-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.88rem;
    transition: var(--transition);
}
.guide-other-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}
.guide-other-card i {
    color: var(--primary);
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* Guide index cards */
.guide-index-card {
    display: block;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.25rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    height: 100%;
}
.guide-index-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-hover-shadow);
    border-color: var(--primary);
    color: var(--text-primary);
}
.guide-index-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.75rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: var(--transition);
}
.guide-index-card:hover .guide-index-icon {
    background: var(--primary);
    color: #fff;
}
.guide-index-name {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.guide-index-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    line-height: 1.5;
}
.guide-index-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

@media (max-width: 767.98px) {
    .guide-hero { padding: 1rem 1.25rem; }
    .guide-hero-icon { width: 48px; height: 48px; font-size: 1.2rem; }
    .guide-stat-number { font-size: 1.1rem; }
    .guide-section { padding: 1.1rem; }
    .guide-cta { padding: 1.25rem; }
    .guide-bar-label { width: 72px; font-size: 0.78rem; }
    .guide-index-card { padding: 1.1rem 1rem; }
    .guide-index-name { font-size: 0.88rem; }
}

/* ---- Related Links ---- */
.related-links {
    background: var(--bg-section);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
.related-link-item {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    font-size: 0.83rem;
    color: var(--primary);
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    text-decoration: none;
    transition: var(--transition);
}
.related-link-item:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ---- Sort Bar ---- */
.sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.sort-bar .sort-options {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.sort-bar .sort-btn {
    padding: 0.3rem 0.75rem;
    font-size: 0.82rem;
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    background: #fff;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}
.sort-bar .sort-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.sort-bar .sort-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ---- Context Links (내부 링크 강화) ---- */
.context-links {
    background: linear-gradient(135deg, #e8f0fe 0%, #f0f4f8 100%);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.context-links .context-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}
.context-link-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    background: #fff;
    border: 1px solid rgba(13,110,253,0.2);
    border-radius: 2rem;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
    margin: 0.15rem;
}
.context-link-chip:hover {
    background: var(--primary);
    color: #fff;
}

/* ---- Print ---- */
@media print {
    .site-header, .site-footer, .btn-back-to-top, .filter-section, .related-links, .sort-bar { display: none !important; }
    .card-custom { box-shadow: none; border: 1px solid #ddd; }
}
