/* 모달 오버레이 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 60px;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    overflow-y: auto;
    padding: 20px 0;
    box-sizing: border-box;
}

.map-modal {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    padding: 20px;
}

.map-modal .modal-content {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 800px;
    width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: auto;
    box-sizing: border-box;
}

.map-modal .modal-content * {
    max-width: 100% !important;
    max-height: 100% !important;
    box-sizing: border-box !important;
}

.map-modal canvas,
.map-modal svg,
.map-modal img,
.map-modal iframe,
.map-modal .leaflet-container,
.map-modal .mapboxgl-map {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* 모달 정보 섹션 */
.modal-info-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.modal-section-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 10px;
}

.modal-info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.modal-info-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.9rem;
}

.modal-info-value {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.modal-address-text {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #495057;
}

.modal-building-id-value {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #495057;
}

/* 대기질 모달 */
.modal-air-quality-detail .grade-indicator {
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    margin-bottom: 16px;
}

.modal-air-quality-detail .air-values {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.modal-air-quality-detail .air-values .d-flex {
    border-bottom: 1px solid #e9ecef;
    padding: 8px 0;
}

.modal-air-quality-detail .air-values .d-flex:last-child {
    border-bottom: none;
}

/* 충전소 모달 */
.modal-station-detail .badge {
    font-size: 0.75rem;
}

.modal-station-detail .font-monospace {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.modal-station-detail .alert {
    margin-bottom: 0;
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* 건물 정보 모달 */
.modal-building-info {
    font-size: 0.9rem;
}

.modal-building-info .building-id-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.modal-building-info .chart-container {
    min-height: 300px;
    position: relative;
    height: 320px;
    background: white;
    border-radius: 6px;
    padding: 10px;
    border: 1px solid #dee2e6;
}

.modal-building-info .chart-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.modal-building-info #chartControls {
    align-items: center;
}

.modal-building-info #chartControls .form-select {
    border: 1px solid #ced4da;
    font-size: 0.875rem;
}

.modal-building-info .address-info {
    background: white;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

/* 모달 반응형 */
@media (max-width: 768px) {
    .modal-building-info .row {
        flex-direction: column;
    }

    .modal-building-info .col-7,
    .modal-building-info .col-5 {
        flex: 1;
        max-width: 100%;
    }

    .modal-building-info .chart-section {
        margin-bottom: 20px;
    }

    .modal-building-info #chartControls {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .modal-building-info #chartControls .form-select {
        width: 100% !important;
    }
}
