/**
 * DX-Seite Styles v1.13.7
 * Nur auf /amateurfunk/dx/ und Startseite geladen
 */

/* H2 direkt über Live-Daten - kein margin-bottom */
#aktuelle-bandoeffnungen {
    margin-bottom: 0;
}

#was-bedeutet-dx {
    margin-top: 0;
}

/* ==================== Solar-Box ==================== */
.dx-solar-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Solar-Box auf Startseite: bündig mit Content */
.landing-section .dx-solar-box {
    max-width: calc(var(--container-width) - 2 * var(--container-padding));
    margin-left: var(--container-padding);
    margin-right: var(--container-padding);
}

@media (min-width: 1264px) {
    /* Ab Container-Breite + 2x Padding: zentrieren */
    .landing-section .dx-solar-box {
        margin-left: auto;
        margin-right: auto;
    }
}

.dx-solar-box h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    color: var(--text);
}

/* Gesamtbewertung oben */
.solar-overall {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.solar-overall .overall-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.solar-overall .overall-explain {
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.9;
}

.solar-overall.solar-good {
    background: #d4edda;
    color: #155724;
}

.solar-overall.solar-ok {
    background: #fff3cd;
    color: #856404;
}

.solar-overall.solar-bad {
    background: #f8d7da;
    color: #721c24;
}

/* Solar-Grid mit 4 Karten */
.solar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.solar-card {
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 4px solid #dee2e6;
}

.solar-card.solar-good { border-left-color: #198754; }
.solar-card.solar-ok { border-left-color: #0d6efd; }
.solar-card.solar-warning { border-left-color: #fd7e14; }
.solar-card.solar-bad { border-left-color: #dc3545; }

.solar-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.solar-card.solar-good .solar-value { color: #198754; }
.solar-card.solar-ok .solar-value { color: #0d6efd; }
.solar-card.solar-warning .solar-value { color: #fd7e14; }
.solar-card.solar-bad .solar-value { color: #dc3545; }

.solar-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.solar-rating {
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.solar-card.solar-good .solar-rating { color: #198754; }
.solar-card.solar-ok .solar-rating { color: #0d6efd; }
.solar-card.solar-warning .solar-rating { color: #fd7e14; }
.solar-card.solar-bad .solar-rating { color: #dc3545; }

.solar-explain {
    font-size: 0.7rem;
    color: #6c757d;
    margin-top: 0.5rem;
    line-height: 1.3;
    text-align: left;
}

/* Prognose-Box */
.dx-prognose {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.dx-prognose h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    color: #856404;
}

.prognose-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.prognose-item {
    background: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* ==================== Bandstatus-Tabellen ==================== */
.dx-status-live {
    margin: 1.5rem 0 0.5rem 0;
}

.update-info {
    font-size: 0.95rem;
    color: #6c757d;
    margin: 0 0 1rem 0;
    text-align: left;
}

/* Tabellen-Sektionen */
.dx-table-section {
    margin-bottom: 0;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.5rem 0 0.75rem;
}

.dx-table-section:last-child {
    margin-bottom: 0;
}

.dx-table-section h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    color: #212529;
}

.dx-table-info {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0 0 0.75rem 0;
}

.dx-status-live table {
    width: 100%;
    border-collapse: collapse;
}

.dx-status-live th {
    background: #f8f9fa;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.dx-status-live td {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

/* Band-Aktivitäts-Farbcodierung */
.dx-status-live tr.band-high {
    background: #d4edda;
}

.dx-status-live tr.band-high:hover {
    background: #c3e6cb;
}

.dx-status-live tr.band-medium {
    background: #fff3cd;
}

.dx-status-live tr.band-medium:hover {
    background: #ffeeba;
}

.dx-status-live tr.band-low {
    background: #f8d7da;
}

.dx-status-live tr.band-low:hover {
    background: #f5c6cb;
}

.dx-status-live tr.band-closed {
    background: #e9ecef;
    color: #6c757d;
}

/* Status-Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

.status-badge.high { color: #155724; }
.status-badge.medium { color: #856404; }
.status-badge.low { color: #721c24; }
.status-badge.closed { color: #6c757d; }

/* Regionen-Tags */
.region-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.region-tag {
    background: rgba(0,0,0,0.08);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Spot-Zahlen */
.spot-count {
    font-family: monospace;
    font-size: 0.95rem;
}

/* ==================== Keine Daten ==================== */
.dx-no-data {
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: #6c757d;
}

.dx-no-data p {
    margin: 0;
}

/* ==================== Responsive ==================== */
@media (max-width: 900px) {
    .solar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dx-status-live th,
    .dx-status-live td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    /* Tabelle horizontal scrollbar auf Mobile */
    .dx-status-live {
        overflow-x: auto;
    }

    .dx-status-live table {
        min-width: 500px;
    }

    .solar-value {
        font-size: 1.5rem;
    }

    .solar-explain {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .solar-grid {
        grid-template-columns: 1fr;
    }

    .solar-card {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 0.25rem 0.75rem;
        text-align: left;
        padding: 0.75rem 1rem;
    }

    .solar-value {
        grid-row: 1 / 3;
        font-size: 2rem;
        align-self: center;
    }

    .solar-label {
        margin: 0;
        font-size: 0.85rem;
    }

    .solar-rating {
        margin: 0;
    }

    .solar-explain {
        grid-column: 1 / 3;
        margin-top: 0.5rem;
    }
}

/* ==================== HF-Vorhersage ==================== */
.hf-vorhersage {
    margin: 0 0 2rem 0;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #dee2e6);
    border-radius: var(--radius, 8px);
    padding: 1.5rem;
}

.greyline-info {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #5d4e00;
}

.hf-vorhersage h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.vorhersage-info {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.vorhersage-info small {
    display: block;
    margin-top: 0.25rem;
}

/* Band-Auswahl */
.band-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Stunden-Timeline */
.hour-timeline {
    margin-bottom: 1rem;
}

.hour-timeline-label {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hour-timeline-label .current-hour-display {
    font-weight: 700;
    color: var(--primary, #2563eb);
}

.hour-slider-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hour-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    outline: none;
}

.hour-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary, #2563eb);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hour-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary, #2563eb);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hour-display {
    min-width: 60px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    font-family: monospace;
}

.hour-marks {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.7rem;
    color: #6c757d;
}

.now-btn {
    padding: 0.3rem 0.6rem;
    background: var(--primary, #2563eb);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

.now-btn:hover {
    background: var(--primary-dark, #1d4ed8);
}

.band-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.band-btn:hover {
    border-color: var(--primary, #2563eb);
    background: #eff6ff;
}

.band-btn.active {
    border-color: var(--primary, #2563eb);
    background: var(--primary, #2563eb);
    color: #fff;
}

/* Locator-Input */
.locator-input-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.locator-input-container label {
    font-weight: 500;
    font-size: 0.9rem;
}

.locator-input {
    width: 80px;
    padding: 0.4rem 0.6rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-family: monospace;
    font-size: 1rem;
    text-transform: uppercase;
}

.locator-input:focus {
    outline: none;
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.locator-hint {
    font-size: 0.8rem;
    color: #6c757d;
}

/* SVG-Weltkarte Container */
.hf-map-container {
    position: relative;
    background: #e8f4fc;
    border-radius: 8px;
    overflow: visible; /* Wichtig: Tooltip darf rausragen */
    margin-bottom: 1rem;
}

.hf-map {
    width: 100%;
    height: auto;
    display: block;
}

/* Region Styles */
.hf-map .region {
    stroke: rgba(0, 0, 0, 0.2);
    stroke-width: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hf-map .region:hover {
    stroke: rgba(0, 0, 0, 0.5);
    stroke-width: 2;
    filter: brightness(1.1);
}

/* Status-Farben für Regionen (Ampel: grün → orange → blau → grau) */
.hf-map .region.status-excellent {
    fill: var(--success, #16a34a);  /* Grün - sehr gut (40-50 dB) */
    opacity: 0.8;
}

.hf-map .region.status-good {
    fill: var(--success, #16a34a);  /* Grün - gut (30-40 dB) */
    opacity: 0.6;
}

.hf-map .region.status-marginal {
    fill: #f59e0b;  /* Orange - grenzwertig (20-30 dB) */
    opacity: 0.7;
}

.hf-map .region.status-poor {
    fill: var(--primary, #2563eb);  /* Blau - schwach (10-20 dB) */
    opacity: 0.5;
}

.hf-map .region.status-closed {
    fill: #94a3b8;  /* Grau - geschlossen (<10 dB) */
    opacity: 0.4;
}

/* Signalpfade */
.hf-map .signal-path {
    stroke-linecap: round;
    transition: all 0.3s ease;
}

.hf-map .signal-path.path-excellent {
    stroke: var(--success, #16a34a);  /* Success grün */
    stroke-width: 3;
}

.hf-map .signal-path.path-good {
    stroke: var(--success, #16a34a);  /* Success grün */
    stroke-width: 3;
    opacity: 0.7;
}

.hf-map .signal-path.path-marginal {
    stroke: #f59e0b;  /* Orange */
    stroke-width: 2;
}

.hf-map .signal-path.path-poor {
    stroke: var(--primary, #2563eb);  /* Primary blau */
    stroke-width: 2;
    opacity: 0.5;
}

.hf-map .signal-path.path-closed {
    stroke: #94a3b8;  /* Grau */
    stroke-width: 1;
    opacity: 0.4;
}

/* Pulsierende Animation für offene Pfade */
@keyframes pulse-path {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.hf-map .signal-path.path-excellent,
.hf-map .signal-path.path-good {
    animation: pulse-path 2s ease-in-out infinite;
}

/* Tooltip */
.hf-tooltip {
    position: fixed;
    background: rgba(33, 37, 41, 0.95);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 99999;
    max-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    white-space: nowrap;
}

.hf-tooltip.visible {
    opacity: 1;
}

/* Mobile: Tooltip als fixe Box unter der Karte */
@media (max-width: 768px) {
    .hf-tooltip {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        top: auto !important;
        right: auto;
        max-width: 90vw;
        text-align: center;
        z-index: 9999;
    }
}

.hf-tooltip .tooltip-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.hf-tooltip .tooltip-snr {
    font-size: 1.1rem;
    font-weight: 700;
}

.hf-tooltip .tooltip-snr.snr-excellent { color: #22c55e; }  /* Grün hell */
.hf-tooltip .tooltip-snr.snr-good { color: #22c55e; }       /* Grün hell */
.hf-tooltip .tooltip-snr.snr-marginal { color: #fbbf24; }   /* Orange hell */
.hf-tooltip .tooltip-snr.snr-poor { color: #60a5fa; }       /* Blau hell */
.hf-tooltip .tooltip-snr.snr-closed { color: #94a3b8; }     /* Grau */

.hf-tooltip .tooltip-muf {
    font-size: 0.8rem;
    color: #adb5bd;
    margin-top: 0.25rem;
}

/* Legende */
.hf-legende {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.85rem;
}

.hf-legende-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.hf-legende-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.hf-legende-color.excellent { background: var(--success, #16a34a); }  /* Grün - 40-50 dB */
.hf-legende-color.good { background: var(--success, #16a34a); opacity: 0.7; }  /* Grün - 30-40 dB */
.hf-legende-color.marginal { background: #f59e0b; }   /* Orange - 20-30 dB */
.hf-legende-color.poor { background: var(--primary, #2563eb); opacity: 0.6; }  /* Blau - 10-20 dB */
.hf-legende-color.closed { background: #94a3b8; }     /* Grau - <10 dB */

/* Responsive */
@media (max-width: 768px) {
    .hf-vorhersage {
        padding: 1rem;
    }

    .band-selector {
        gap: 0.35rem;
    }

    .band-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }

    .hf-legende {
        gap: 0.5rem;
        font-size: 0.8rem;
    }

    .locator-input-container {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .band-selector {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .band-btn {
        text-align: center;
    }

    .hf-legende {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

/* ==================== Mobile Karten-Scroll ==================== */
/* Scroll-Wrapper für HF-Vorhersage-Karte (wie bei Statistik-Chart) */
.hf-map-scroll-outer {
    position: relative;
}

/* Schatten-Effekt rechts wenn scrollbar */
.hf-map-scroll-outer::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.15));
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.2s;
}

.hf-map-scroll-wrapper {
    /* Scroll nur auf Mobile aktiv */
}

/* Mobile: Karte größer und scrollbar */
@media (max-width: 768px) {
    .hf-map-scroll-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .hf-map-scroll-outer::after {
        opacity: 1;
    }

    .hf-map-container {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .hf-map-container {
        min-width: 550px;
    }
}

/* Schatten ausblenden wenn am Ende gescrollt */
.hf-map-scroll-outer.scrolled-end::after {
    opacity: 0;
}
