/**
 * Warnings CSS - Styles for DWD/NINA warnings integration
 */

/* Warnings Sidebar Section */
.warnings-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #1e293b;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 12px;
}

.status-online {
    color: #10b981;
}

.status-online i {
    font-size: 8px;
    margin-right: 4px;
}

.status-offline {
    color: #6b7280;
}

.status-offline i {
    font-size: 8px;
    margin-right: 4px;
}

#warnings-last-update {
    color: #94a3b8;
    font-size: 11px;
}

/* Sub-Controls for toggles */
.warnings-controls .sub-controls {
    margin-left: 24px;
    margin-top: 8px;
    padding-left: 12px;
    border-left: 2px solid #334155;
}

.warnings-controls .sub-item {
    font-size: 13px;
    color: #94a3b8;
}

.warnings-controls .sub-item span {
    font-size: 12px;
}

/* Warning Popup Styles */
.warning-popup .leaflet-popup-content-wrapper {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 8px;
}

.warning-popup .leaflet-popup-tip {
    background: #1e293b;
}

.warning-popup-content {
    padding: 4px;
}

.warning-popup-header {
    margin-bottom: 8px;
}

.warning-severity-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.warning-severity-badge.severity-extreme {
    background: #dc2626;
    color: white;
}

.warning-severity-badge.severity-severe {
    background: #f97316;
    color: white;
}

.warning-severity-badge.severity-moderate {
    background: #fbbf24;
    color: #1e293b;
}

.warning-severity-badge.severity-minor {
    background: #3b82f6;
    color: white;
}

.warning-popup-title {
    font-size: 16px;
    font-weight: 600;
    margin: 8px 0;
    color: #f1f5f9;
}

.warning-popup-meta {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 12px;
}

.warning-popup-meta p {
    margin: 4px 0;
}

.warning-popup-meta i {
    width: 16px;
    margin-right: 6px;
    color: #64748b;
}

.warning-popup-description,
.warning-popup-instruction {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #334155;
}

.warning-popup-description strong,
.warning-popup-instruction strong {
    color: #f59e0b;
    font-size: 12px;
}

.warning-popup-description p,
.warning-popup-instruction p {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: #cbd5e1;
}

/* Warning Tooltip */
.warning-tooltip {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #e2e8f0 !important;
    font-size: 12px !important;
    padding: 6px 10px !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
}

.warning-tooltip::before {
    border-top-color: #334155 !important;
}

/* Settings Tab Styles */
#tab-warnings .settings-group {
    background: #1e293b;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

#tab-warnings .settings-group h4 {
    margin: 0 0 12px 0;
    color: #f59e0b;
    font-size: 14px;
}

#tab-warnings .settings-group h4 i {
    margin-right: 8px;
}

#tab-warnings .toggle-switch {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
}

#tab-warnings .toggle-switch input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#tab-warnings .toggle-label {
    font-size: 14px;
    color: #e2e8f0;
}

#tab-warnings .sub-settings {
    margin-left: 28px;
    margin-top: 12px;
    padding-left: 12px;
    border-left: 2px solid #334155;
}

#tab-warnings .sub-settings label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #cbd5e1;
    cursor: pointer;
}

#tab-warnings .sub-settings input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

#tab-warnings .settings-hint {
    margin-top: 8px;
    font-size: 11px;
    color: #64748b;
    font-style: italic;
}

#tab-warnings .settings-select {
    display: block;
    margin-top: 12px;
    color: #e2e8f0;
    font-size: 14px;
}

#tab-warnings .settings-select select {
    margin-left: 10px;
    padding: 6px 10px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 4px;
    color: #e2e8f0;
    font-size: 13px;
}

#tab-warnings .settings-range {
    display: block;
    margin-bottom: 12px;
    color: #e2e8f0;
    font-size: 14px;
}

#tab-warnings .settings-range input[type="range"] {
    display: block;
    width: 100%;
    margin-top: 8px;
}

#tab-warnings #warning-opacity-value {
    color: #f59e0b;
    font-weight: 600;
}

#tab-warnings .settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #334155;
}

#tab-warnings .settings-actions .btn {
    flex: 1;
}

/* Refresh button animation */
#refresh-warnings-btn i.fa-spin {
    animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Warning layer styles on map */
.leaflet-popup.warning-severity-extreme .leaflet-popup-content-wrapper {
    border-left: 4px solid #dc2626;
}

.leaflet-popup.warning-severity-severe .leaflet-popup-content-wrapper {
    border-left: 4px solid #f97316;
}

.leaflet-popup.warning-severity-moderate .leaflet-popup-content-wrapper {
    border-left: 4px solid #fbbf24;
}

.leaflet-popup.warning-severity-minor .leaflet-popup-content-wrapper {
    border-left: 4px solid #3b82f6;
}
