html, body { height: 100%; margin: 0; padding: 0; overflow: hidden; }

.navbar { z-index: 1030 !important; padding-top: 4px !important; padding-bottom: 4px !important; min-height: 42px !important; }
.navbar-brand { font-size: 16px !important; }
.navbar .form-check-input { margin-top: 0; vertical-align: middle; }

.main-container { height: calc(100vh - 42px) !important; margin-top: 42px !important; display: flex !important; flex-direction: column !important; overflow: hidden !important; }
.main-container.container-fluid { height: calc(100vh - 42px) !important; }
.tab-row { flex-shrink: 0 !important; z-index: 1500 !important; position: relative !important; background: white !important; }
.content-row-wrapper { flex: 1 !important; min-height: 0 !important; }
.row.content-row { height: 100% !important; display: flex !important; align-items: stretch !important; flex-wrap: nowrap !important; }
.row.content-row.panel-hidden { display: none !important; }
.sidebar { height: 100%; overflow-y: auto; padding: 20px; background: #f8f9fa; }
.col-md-9 { height: 100% !important; display: flex !important; flex-direction: column !important; padding: 0 !important; }

.main-content {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    flex: 1 !important;
    position: relative !important;
}
.map-wrapper {
    flex: 1 !important;
    min-height: 0 !important;
    height: 100% !important;
    position: relative;
    overflow: hidden;
}
.map-legend {
    position: absolute !important;
    bottom: 20px !important;
    left: 20px !important;
    width: 160px !important;
    background-color: white !important;
    border: 2px solid grey !important;
    z-index: 9999 !important;
    font-size: 11px !important;
    padding: 10px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
}
.map-no-data {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    color: #fff !important;
    font-size: 20px !important;
    font-weight: bold !important;
    padding: 20px 40px !important;
    border-radius: 8px !important;
    z-index: 10000 !important;
    pointer-events: none !important;
    text-align: center !important;
    white-space: nowrap !important;
}
.forecast-header {
    display: none;
    position: absolute !important;
    top: 5px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid #333 !important;
    border-radius: 4px !important;
    padding: 8px 20px !important;
    z-index: 1000 !important;
    font-size: 13px !important;
    font-weight: bold !important;
    text-align: center !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
    white-space: nowrap !important;
    pointer-events: auto !important;
}

.forecast-hour-row {
    display: flex;
    align-items: center;
    gap: 4px;
}
.fhr-step-btn {
    flex-shrink: 0;
    padding: 2px 6px;
    font-size: 12px;
    line-height: 1.4;
}
.fhr-select {
    flex: 1;
    min-width: 0;
}

.chart-modal-overlay {
    display: none;
    position: fixed !important;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 20000 !important;
    justify-content: center;
    align-items: center;
}
.chart-modal-overlay.active { display: flex !important; }
.chart-modal-box {
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    width: 50vw;
    height: 50vh;
    min-width: 500px;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    padding: 16px;
    box-sizing: border-box;
}
.chart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.chart-modal-header h6 { margin: 0; color: #212529; font-size: 14px; }
.chart-modal-close {
    background: none; border: none; font-size: 22px; cursor: pointer; color: #666; padding: 0 4px; line-height: 1;
}
.chart-modal-close:hover { color: #000; }
.chart-modal-body {
    flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center;
}
.chart-modal-body canvas { width: 100% !important; height: 100% !important; }
.chart-modal-placeholder { text-align: center; color: #999; }
.chart-modal-placeholder .icon { font-size: 36px; }
.chart-modal-loading {
    text-align: center; color: #666; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}

.band-groups {
    border: 1px solid #dee2e6;
    border-radius: 5px;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
}
.band-group { border-bottom: 1px solid #dee2e6; }
.band-group:last-child { border-bottom: none; }
.band-group-header {
    display: flex; align-items: center; padding: 8px 10px; cursor: pointer; background: #f8f9fa; user-select: none;
}
.band-group-header:hover { background: #e9ecef; }
.band-group-arrow { margin-right: 6px; font-size: 10px; transition: transform 0.2s; }
.band-group-header.expanded .band-group-arrow { transform: rotate(90deg); }
.band-group-name { font-weight: 600; font-size: 13px; flex: 1; }
.band-group-count { font-size: 11px; color: #6c757d; }
.band-group-content { padding: 5px 0; }
.band-item {
    display: flex; align-items: center; padding: 4px 10px 4px 25px; cursor: pointer; font-size: 12px;
}
.band-item:hover { background: #e3f2fd; }
.band-item input { margin-right: 6px; }

.spinner {
    width: 40px; height: 40px; border: 4px solid #e9ecef; border-top: 4px solid #2563eb; border-radius: 50%;
    animation: spin 1s linear infinite; margin: 0 auto 12px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.grid-value-label {
    font-size: 10px; font-weight: bold; color: black;
    text-shadow: 1px 1px 0 white, -1px 1px 0 white, 1px -1px 0 white, -1px -1px 0 white;
    background: transparent !important; border: none !important;
}

.leaflet-container { background: #e0e0e0; }
