/* =============================================================================
   HosFind Map Styles
   ============================================================================= */

/* === Nearby Map (Front Page) =============================================== */
.nearby-map-section {
    margin-bottom: 32px;
}

.nearby-map {
    width: 100%;
    height: 600px;
    overflow: hidden;
}

.nearby-map-status {
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: 8px;
}

/* === Legend ================================================================= */
.map-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.map-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 1rem;
    color: var(--color-text-light);
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid transparent;
    transition: all var(--transition);
    user-select: none;
    border: 1px solid rgba(0, 0, 0, .08);
}

.map-legend__item:hover {
    background: var(--color-bg);
    border-color: var(--color-border);
}

.map-legend__item--active {
    background: var(--color-bg);
    border-color: var(--color-primary);
    color: var(--color-text);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.map-legend__dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.map-legend__toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--color-text-light);
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, .08);
    margin-left: auto;
    user-select: none;
    transition: all var(--transition);
}

.map-legend__toggle:hover {
    border-color: var(--color-border);
}

.map-legend__toggle:has(input:checked) {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #fff;
    font-weight: 600;
}

.map-legend__toggle input {
    display: none;
}

/* === Markers =============================================================== */
.map-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1;
    padding: 6px;
}

/* === Nearby Hospital List =================================================== */
.nearby-hospital-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--color-border);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.nearby-hospital-list:empty {
    display: none;
}

.nearby-hospital-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-bg);
    text-decoration: none;
    color: var(--color-text);
    transition: background var(--transition);
}

.nearby-hospital-item:hover {
    background: var(--color-bg-light);
}

.nearby-hospital-item__badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 20px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.nearby-hospital-item__name {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.nearby-hospital-item__dept {
    flex: 1 1 auto;
    font-size: 0.8rem;
    color: var(--color-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.nearby-hospital-item__dist {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
}

/* === Archive Map ============================================================ */
.nearby-map-section--archive {
    margin-bottom: 20px;
}

.nearby-map-section--archive .nearby-map {
    height: 350px;
}

/* === Detail Map (Single Hospital) ========================================== */
.hospital-detail__map,
.detail-map {
    width: 100%;
    height: 280px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background-color: var(--color-bg-light);
    margin-bottom: 24px;
}

/* === Responsive ============================================================ */
@media (max-width: 768px) {
    .nearby-map {
        height: 300px;
    }

    .nearby-map-section--archive .nearby-map {
        height: 250px;
    }
}