/* ===== CSS Variables ===== */
:root {
    /* Backgrounds & Surfaces - Deep dark blues */
    --bg-deep: #0F172A;    /* Main page background (Oceans) */
    --bg-surface: #1E293B; /* Cards, headers, UI elements */
    --bg-primary: #0F172A;  /* Alias for compatibility */
    --bg-secondary: #1E293B; /* Alias for compatibility */
    --bg-tertiary: #1E293B; /* Alias for compatibility */
    --bg-panel: #1E293B;    /* Alias for compatibility */
    
    --border-color: #334155; /* Subtle borders */
    
    /* Accent Colors - Neon Glow */
    --neon-cyan: #00F5D4;  /* Primary action, Positive mood, "ATLAS" text */
    --neon-pink: #FF006E;  /* Secondary action, Negative mood */
    --neon-indigo: #6366F1; /* Tertiary, neutral accents */
    
    /* Legacy accent colors (for compatibility) */
    --accent-primary: #00F5D4;
    --accent-secondary: #FF006E;
    --accent-glow: rgba(0, 245, 212, 0.3);
    
    /* Typography */
    --text-primary: #F1F5F9; /* Headings (almost white) */
    --text-secondary: #94A3B8; /* Body text (light gray) */
    --text-muted: #64748B;
    
    --success: #00F5D4;
    --warning: #FF006E;
    --danger: #FF006E;
    --info: #6366F1;
    
    --font-display: 'Crimson Pro', Georgia, serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    
    --shadow-glow: 0 0 40px var(--accent-glow);
    --shadow-panel: 0 8px 32px rgba(0, 0, 0, 0.4);
    --border-glow: rgba(0, 245, 212, 0.2);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

body {
    font-family: var(--font-mono);
    font-size: 14px;
    background-color: var(--bg-deep);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ===== Background Pattern ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(255, 107, 53, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(247, 147, 26, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    pointer-events: none;
    z-index: -1;
}

/* Grid Pattern Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.03;
    pointer-events: none;
    z-index: -1;
}

/* ===== App Container ===== */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 80px; /* Platz für fixierten Footer */
}

/* ===== Header ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    position: relative;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.header-logo {
    height: 60px;
    width: auto;
    max-width: 100%;
}

.title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

.title-icon {
    color: var(--accent-primary);
    font-size: 24px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ===== Desktop Settings in Top Controls ===== */
.top-controls-settings {
    display: none; /* Hidden by default, shown on desktop */
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

@media (min-width: 769px) {
    .top-controls-settings.desktop-only {
        display: flex;
    }
    
    /* Footer sichtbar machen und Platz für Anchor-Ad schaffen */
    .legend {
        margin-bottom: 0; /* Kein Platz für Anchor-Ad nötig (deaktiviert) */
    }
}

/* ===== Mobile Elements in Settings Menu ===== */
.country-search-mobile {
    position: relative;
    width: 100%;
}

.country-search-mobile input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-mono);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.country-search-mobile input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.2);
}

.score-changes-controls-mobile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.btn-score-change-mobile {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-family: var(--font-mono);
}

.btn-score-change-mobile:hover {
    background: var(--bg-secondary);
    border-color: var(--neon-cyan);
}

.btn-score-change-mobile.active {
    background: var(--neon-cyan-bg);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.btn-ai-status-mobile {
    display: none !important;
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-family: var(--font-mono);
}

.btn-ai-status-mobile:hover {
    background: var(--bg-secondary);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 245, 212, 0.3);
}

.top-control-setting-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-control-setting-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.top-control-setting-select {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 32px;
    min-width: 130px;
    font-family: var(--font-mono);
}

.top-control-setting-select:hover {
    border-color: var(--neon-cyan);
    background-color: var(--bg-secondary);
}

.top-control-setting-select:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 2px rgba(0, 245, 212, 0.2);
}

.top-control-setting-select option {
    background: var(--bg-panel);
    color: var(--text-primary);
    padding: 8px;
}

/* ===== Settings Button (Mobile Only) ===== */
.settings-btn {
    width: 44px;
    height: 44px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 101;
    flex-shrink: 0;
}

.settings-btn.mobile-only {
    display: flex;
}

/* Desktop: Hamburger-Menü ausblenden */
@media (min-width: 769px) {
    .settings-btn.mobile-only {
        display: none !important;
    }
}

.settings-btn:hover,
.settings-btn.active {
    background: rgba(0, 245, 212, 0.2);
    border-color: var(--neon-cyan);
}

/* ===== Settings Menu Backdrop ===== */
.settings-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998 !important; /* Direkt unter dem Settings-Menü (99999) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.settings-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* ===== Settings Menu (Desktop & Mobile) ===== */
.settings-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-panel);
    border-left: 1px solid var(--border-color);
    z-index: 99999 !important; /* Höchste Ebene - über allem */
    transition: right 0.3s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    overflow: visible;
    pointer-events: all;
}

.settings-menu.active {
    right: 0;
}

.settings-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    z-index: 100000 !important; /* Höchste Ebene innerhalb des Menüs */
    pointer-events: all;
    overflow: visible;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.settings-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.settings-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.settings-close:hover {
    background: var(--bg-tertiary);
    border-color: var(--neon-cyan);
}

.settings-body {
    flex: 1;
    padding: 12px 16px;
    padding-bottom: 60px; /* Extra padding am Ende für besseres Scrollen zu Impressum (erhöht) */
    overflow-y: auto;
    overflow-x: visible;
    position: relative;
    z-index: 1;
    pointer-events: all;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling auf iOS */
    scroll-behavior: smooth; /* Smooth scrolling */
}

/* Mobile: Kleinere Schriftgröße im Menü */
@media (max-width: 768px) {
    .settings-body {
        font-size: 13px; /* Verkleinert von Standard */
    }
    
    .setting-item {
        font-size: 13px;
    }
    
    .setting-label {
        font-size: 12px; /* Etwas kleiner */
    }
    
    .language-option {
        font-size: 13px;
    }
    
    .footer-links-mobile a {
        font-size: 13px;
    }
    
    .settings-body select,
    .settings-body input,
    .settings-body button {
        font-size: 13px;
    }
}

.setting-item {
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    pointer-events: all;
    display: block;
    clear: both;
}

.setting-label-wrapper {
    display: block;
    margin: 0;
    margin-bottom: 8px;
    padding: 0;
    position: relative;
    z-index: 1;
    height: 18px;
    max-height: 18px;
    overflow: hidden;
    background: transparent;
    border: none;
    box-sizing: border-box;
}

.setting-item > label,
.setting-label {
    display: inline-block;
    margin: 0;
    padding: 0;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
    pointer-events: none;
    background: transparent;
    border: none;
    height: 16px;
    line-height: 16px;
    overflow: hidden;
    transform: none;
    vertical-align: top;
}

.setting-item select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    min-height: 38px;
    position: relative;
    z-index: 10001;
    pointer-events: all;
}

.setting-item select:hover {
    border-color: var(--neon-cyan);
    background-color: var(--bg-secondary);
}

.setting-item select:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.2);
    background-color: var(--bg-secondary);
}

.setting-item select option {
    background: var(--bg-panel);
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 14px;
}

/* Language Options (Radio Buttons) */
.language-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    margin-top: 0;
    padding: 0;
    position: relative;
    z-index: 10;
    pointer-events: all;
    clear: both;
    background: transparent;
    border: none;
    width: 100%;
    box-sizing: border-box;
    min-height: 0;
}

.language-option {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 10;
    user-select: none;
    -webkit-user-select: none;
    min-height: 40px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    transform: translateZ(0);
    margin-top: 0 !important;
}

.language-option:hover {
    background: var(--bg-secondary);
    border-color: var(--neon-cyan);
    transform: translateX(2px);
}

.language-option input[type="radio"] {
    margin: 0;
    margin-right: 14px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--neon-cyan);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.language-option input[type="radio"]:checked + span {
    color: var(--neon-cyan);
    font-weight: 600;
}

.language-option:has(input[type="radio"]:checked) {
    background: var(--bg-secondary);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.2);
}

.language-option span {
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
    display: flex;
    align-items: center;
    pointer-events: none;
}

/* Desktop-spezifische Fixes für Language-Options */
@media (min-width: 769px) {
    .setting-label-wrapper {
        margin-bottom: 32px !important;
        height: 24px !important;
        max-height: 24px !important;
        overflow: hidden !important;
        padding: 0 !important;
    }
    
    .setting-label {
        height: 20px !important;
        line-height: 20px !important;
        overflow: hidden !important;
    }
    
    .language-options {
        margin-top: 0 !important;
        padding-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .language-option:first-child {
        margin-top: 0 !important;
    }
}

/* Sicherstellen, dass Select-Dropdowns sichtbar sind */
.setting-item select:active,
.setting-item select:focus {
    z-index: 10002;
}

/* Für Webkit-Browser (Chrome, Safari) */
.setting-item select::-webkit-select-button {
    display: none;
}

/* Sicherstellen, dass das Dropdown-Menü über allem liegt */
.settings-menu.active .setting-item select {
    z-index: 10002;
}

/* ===== Top Controls (außerhalb der Karte) ===== */
.top-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 32px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    z-index: 100;
    min-height: 60px;
}

/* Mobile: Top Controls verstecken */
@media (max-width: 768px) {
    .top-controls.desktop-only {
        display: none !important;
    }
}

/* Layout für Karte */
.map-content-wrapper {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.map-content-wrapper .map-container {
    flex: 1;
    min-width: 0;
    width: 100%;
}

/* ===== Ad Banner Placeholders ===== */
.ad-banner {
    width: 160px;
    height: 600px;
    flex-shrink: 0;
    display: none; /* Vorläufig deaktiviert */
    align-items: center;
    justify-content: center;
}

.ad-placeholder {
    width: 100%;
    height: 100%;
    background: #808080;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

/* ===== Anchor Ad (Footer Ad) ===== */
.anchor-ad-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999; /* Unter dem Popup (z-index: 1000) */
    display: none; /* Vorläufig deaktiviert */
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid var(--border-color);
}

.anchor-ad-placeholder {
    width: 728px;
    height: 90px;
    background: #2d2d2d;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

/* ===== Config Panel ===== */
.config-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 12, 16, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.config-panel.active {
    opacity: 1;
    visibility: visible;
}

.config-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-panel);
}

.config-content h3 {
    font-family: var(--font-display);
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.config-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    transition: all 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.api-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.api-link:hover {
    color: var(--accent-secondary);
}

/* Provider Selection */
.provider-select {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.provider-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.provider-option:hover {
    border-color: var(--text-muted);
}

.provider-option:has(input:checked) {
    border-color: var(--accent-primary);
    background: rgba(255, 107, 53, 0.1);
}

.provider-option input[type="radio"] {
    accent-color: var(--accent-primary);
    width: 18px;
    height: 18px;
}

.provider-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.provider-label strong {
    color: var(--text-primary);
    font-size: 13px;
}

.provider-label small {
    color: var(--text-muted);
    font-size: 11px;
}

.provider-option.recommended {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.provider-option.recommended .provider-label small {
    color: #22c55e;
}

/* Source Selection */
.source-select {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.source-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.source-option:hover {
    border-color: var(--text-muted);
}

.source-option:has(input:checked) {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.source-option input[type="radio"] {
    accent-color: #22c55e;
    width: 16px;
    height: 16px;
}

.source-label {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.source-label strong {
    color: var(--text-primary);
    font-size: 12px;
}

.source-label small {
    color: var(--text-muted);
    font-size: 10px;
}

.config-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-secondary);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

.config-status {
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    text-align: center;
    display: none;
}

.config-status.success {
    display: block;
    background: rgba(67, 160, 71, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.config-status.error {
    display: block;
    background: rgba(229, 57, 53, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

/* ===== Main Content ===== */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    position: relative;
}

/* ===== Map Container ===== */
.map-container {
    position: relative;
    width: 100%;
    /* 16:9 Aspect Ratio */
    aspect-ratio: 16 / 9;
    max-width: 100%;
    overflow: hidden;
}

/* Country Tooltip */
.country-tooltip {
    position: absolute;
    background: var(--bg-panel);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-family: var(--font-mono);
    pointer-events: none;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    /* 16:9 Aspect Ratio sicherstellen */
    aspect-ratio: 16 / 9;
    /* Helles Ozean-Blau als Hintergrund */
    background: linear-gradient(
        180deg,
        #a8d4e6 0%,      /* Hellblau oben (Himmel-Übergang) */
        #7ec8e3 20%,     /* Ozeanblau */
        #5eb3d4 50%,     /* Tieferes Blau */
        #4a9fc4 80%,     /* Mittleres Ozeanblau */
        #3d8eb3 100%     /* Dunkleres Blau unten */
    );
}

#worldMap {
    width: 100%;
    height: 100%;
    background: transparent;
    position: relative;
    z-index: 1;
}

/* Ozean-Textur für mehr Tiefe */
.map-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(255,255,255,0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* Country Styles */
.country {
    stroke: rgba(255, 255, 255, 0.4);  /* Helle Grenzen für Kontrast */
    stroke-width: 0.5;
    cursor: pointer;
    transition: all 0.3s ease;
}

.country:hover {
    stroke: #ffffff;
    stroke-width: 1.5;
    filter: brightness(1.15) drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Unsichtbare Hit-Bereiche für kleine Länder */
.country-hit-area {
    pointer-events: all;
    cursor: pointer;
    /* Hit-Bereiche sollten nur aktiv sein, wenn kein größeres Land darunter liegt */
    /* Wir verwenden eine niedrigere Priorität durch die Reihenfolge im DOM */
}

.country.selected {
    stroke: #ffffff;
    stroke-width: 2;
    filter: drop-shadow(0 0 12px rgba(255,255,255,0.5));
}

/* Cyberpunk Glow Effect - wird dynamisch per JavaScript angewendet */
.country.selected.cyberpunk-glow {
    stroke: #00F5D4;
    stroke-width: 2.5;
    filter: drop-shadow(0 0 8px rgba(255, 0, 110, 0.8)) 
            drop-shadow(0 0 12px rgba(0, 245, 212, 0.6))
            drop-shadow(0 0 16px rgba(0, 245, 212, 0.4));
    animation: cyberpunkPulse 2s ease-in-out infinite;
}

@keyframes cyberpunkPulse {
    0%, 100% { 
        filter: drop-shadow(0 0 8px rgba(255, 0, 110, 0.8)) 
                drop-shadow(0 0 12px rgba(0, 245, 212, 0.6))
                drop-shadow(0 0 16px rgba(0, 245, 212, 0.4));
    }
    50% { 
        filter: drop-shadow(0 0 12px rgba(255, 0, 110, 1)) 
                drop-shadow(0 0 18px rgba(0, 245, 212, 0.8))
                drop-shadow(0 0 24px rgba(0, 245, 212, 0.6));
    }
}

.country.loading {
    animation: countryPulse 1s ease-in-out infinite;
}

@keyframes countryPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader.small {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* ===== View Controls ===== */
.view-controls {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 40px;
    padding: 8px 14px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-label {
    font-size: 13px;
}

.view-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.view-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}
    height: 40px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}


.view-btn .view-icon {
    font-size: 18px;
}

/* ===== Map Controls ===== */
/* ===== Palette Selector ===== */
.palette-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 14px;
}

.palette-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

#paletteSelect {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    padding: 6px 10px;
    cursor: pointer;
    font-family: var(--font-mono);
}

#paletteSelect:hover {
    border-color: var(--accent-primary);
}

#paletteSelect:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

/* ===== Score Changes Controls ===== */
.score-changes-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.btn-score-change {
    padding: 10px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-mono);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: fit-content;
}

.btn-score-change:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.btn-score-change.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

.btn-score-change#showPositiveChanges.active {
    background: #00ff00;
    border-color: #00ff00;
    color: #000;
    font-weight: 600;
}

.btn-score-change#showNegativeChanges.active {
    background: #ff0000;
    border-color: #ff0000;
    color: #fff;
    font-weight: 600;
}

/* AI Status Button - Deaktiviert */
.btn-ai-status {
    display: none !important;
    padding: 10px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-mono);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: fit-content;
}

.btn-ai-status:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.3);
}

/* Score Change Highlight auf Karte */
.country.score-change-highlight {
    stroke-width: 3px;
    stroke-opacity: 0.8;
}

.country.score-change-positive {
    stroke: #00ff00;
}

.country.score-change-negative {
    stroke: #ff0000;
}

/* ===== Language Selector ===== */
.language-selector {
    display: flex;
    align-items: center;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 14px;
}

#languageSelect {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    padding: 6px 10px;
    cursor: pointer;
    font-family: var(--font-mono);
    min-width: 80px;
}

#languageSelect:hover {
    border-color: var(--accent-primary);
    background: var(--bg-panel);
}

#languageSelect:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

/* ===== Country Search ===== */
.country-search {
    position: relative;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

#countrySearch {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    padding: 6px 10px;
    width: 200px;
    font-family: var(--font-mono);
}

#countrySearch:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-tertiary);
}

.search-result-item .search-code {
    color: var(--text-muted);
    font-size: 11px;
    margin-left: 8px;
    font-family: var(--font-mono);
}

/* ===== Legend Scale (Journalistic) ===== */
.legend-journalist {
    display: flex;
    align-items: center;
    gap: 16px;
}

.legend-journalist.hidden {
    display: none;
}

.legend-ai.hidden {
    display: none;
}

.legend-cyberpunk {
    display: flex;
    align-items: center;
    gap: 16px;
}

.legend-cyberpunk.hidden {
    display: none;
}

.legend-scale {
    display: flex;
    align-items: center;
    gap: 10px;
}

.scale-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scale-gradient {
    width: 180px;
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(to right, 
        #D90429 0%, 
        #E45A6B 25%, 
        #F8F9FA 50%, 
        #5AA3C7 75%, 
        #0077B6 100%
    );
    border: 1px solid var(--border-color);
}

/* Cyberpunk Gradient */
.cyberpunk-gradient {
    background: linear-gradient(to right, 
        #FF006E 0%, 
        #C91E6F 25%, 
        #334155 50%, 
        #00C4A8 75%, 
        #00F5D4 100%
    );
    border: 1px solid rgba(0, 245, 212, 0.3);
    box-shadow: 0 0 8px rgba(255, 0, 110, 0.3), 
                0 0 8px rgba(0, 245, 212, 0.3);
}

.scale-markers {
    display: flex;
    gap: 8px;
    font-size: 10px;
}

/* ===== Country Popup ===== */
.country-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.country-popup.visible {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 25px 50px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 1000px; /* Etwas breiter */
    max-height: 95vh; /* Höher (von 90vh auf 95vh) */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.panel-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    min-height: 600px; /* Erhöht von 500px */
    display: flex;
    flex-direction: column;
}

.country-popup.visible .popup-content {
    transform: translateY(0) scale(1);
}

.popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.popup-close:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.popup-header {
    padding: 24px 60px 24px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--bg-secondary);
}

.popup-header h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    margin: 0;
}

.popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    padding-bottom: 20px; /* Kein Platz für Footer-Ad nötig (deaktiviert) */
    display: flex;
    flex-direction: column;
    gap: 16px;
    gap: 16px;
}

/* ===== Ad Banner in Popup ===== */
/* Medium Rectangle Ad in rechter Spalte */
.popup-ad-medium-rect {
    flex-shrink: 0;
    width: 100%;
    min-width: 320px; /* Feste Mindestbreite für Desktop */
    display: none !important; /* Deaktiviert */
    align-items: center;
    justify-content: center;
    padding: 0;
    position: sticky; /* Bleibt beim Scrollen sichtbar */
    top: 0;
    align-self: start; /* Oben bündig mit Text */
}

.ad-placeholder-medium-rect {
    width: 100%;
    max-width: 320px;
    height: 250px; /* Standard Medium Rectangle Größe */
    background: #808080;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    text-align: center;
    padding: 8px;
}

/* Mobile: Werbung unter Text */
@media (max-width: 768px) {
    .analysis-layout {
        grid-template-columns: 1fr; /* Eine Spalte */
        gap: 16px; /* Weniger Abstand auf Mobile */
    }
    
    .popup-ad-medium-rect {
        min-width: auto;
        width: 100%;
        position: static; /* Kein Sticky auf Mobile */
    }
    
    .ad-placeholder-medium-rect {
        max-width: 100%;
        width: 100%;
    }
}

.sentiment-badge {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.sentiment-badge.positive {
    background: rgba(67, 160, 71, 0.15);
    color: var(--success);
}

.sentiment-badge.negative {
    background: rgba(229, 57, 53, 0.15);
    color: var(--danger);
}

.sentiment-badge.neutral {
    background: rgba(30, 136, 229, 0.15);
    color: var(--info);
}

.sentiment-badge.mixed {
    background: rgba(255, 152, 0, 0.15);
    color: var(--warning);
}

.placeholder-text {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    text-align: center;
    padding: 40px 20px;
}

/* News Loading */
.news-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 16px;
}

.news-loading p {
    color: var(--text-secondary);
    font-size: 13px;
}

/* News List */
.news-list {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    min-height: 0; /* Ermöglicht Flexbox-Scrolling */
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-list h3 {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.news-list ul {
    list-style: none;
}

.news-list li {
    padding: 16px;
    margin-bottom: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-primary);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.news-list li:hover {
    background: var(--bg-secondary);
    border-left-color: var(--accent-secondary);
}

/* 2-Spalten-Layout Container für Analyse und Werbung */
.analysis-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px; /* gap-8 (32px) */
    align-items: start; /* items-start - oben bündig */
    margin-top: 16px;
}

/* Desktop: 2-Spalten-Layout */
@media (min-width: 769px) {
    .analysis-layout {
        grid-template-columns: 1fr; /* Nur Text, keine Werbung */
    }
}

.summary {
    padding: 32px; /* Erhöht von 24px für mehr Innenraum */
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    min-height: 700px; /* Erhöht von 600px */
    max-height: 900px; /* Erhöht von 800px */
    overflow-y: auto;
    flex: 1; /* Nimmt verfügbaren Platz ein */
}

.summary h4 {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.summary p {
    font-size: 15px;
    line-height: 1.8; /* Größerer Zeilenabstand (leading-relaxed) */
    color: var(--text-primary);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; /* Sans-Serif für Fließtext */
    /* max-width entfernt, damit Text den verfügbaren Platz nutzt */
    margin: 0; /* Keine Zentrierung mehr */
    margin-bottom: 16px; /* Abstand zum Metadaten-Bereich */
}

/* Metadaten unter dem Text */
.summary-metadata {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.metadata-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.metadata-value {
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.metadata-separator {
    color: var(--border-color);
    margin: 0 4px;
}

/* ===== Legend ===== */
.legend {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    position: fixed; /* Fixiert am unteren Bildrand */
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1001; /* Über dem Anchor-Ad */
}

.legend-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.legend-icon {
    font-size: 18px;
    color: var(--accent-primary);
    animation: colorCycle 8s ease-in-out infinite;
}

@keyframes colorCycle {
    0% { color: #ff6b35; }
    25% { color: #4ecdc4; }
    50% { color: #a855f7; }
    75% { color: #22c55e; }
    100% { color: #ff6b35; }
}

.legend-stats {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.legend-stats span {
    color: var(--accent-primary);
    font-weight: 500;
}

/* ===== Footer Links ===== */
.footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

/* IT-Recht-Kanzlei Logo im Footer */
.itrk-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none !important;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.itrk-logo-link:hover {
    opacity: 1;
    text-decoration: none !important;
}

.itrk-logo {
    height: 20px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    vertical-align: middle;
}

/* ===== Mobile Footer Links in Settings Menu ===== */
.footer-links-mobile a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.footer-links-mobile a:hover {
    color: var(--accent-primary);
    background: var(--bg-tertiary);
}

/* ===== Modal Styles ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 12, 16, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.visible {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-panel);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.visible .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-content h2 {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-right: 40px;
}

.modal-body {
    background: #FFFFFF;
    color: #000000;
}
.modal-body iframe {
    filter: invert(1) hue-rotate(180deg);
    background: #FFFFFF;
    overflow: hidden;
    clip-path: inset(0 0 100px 0);
    margin-bottom: -100px;
}
.modal-body {
    overflow: hidden;
}
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 14px;
}

.modal-body p {
    margin-bottom: 16px;
}

.modal-body h3 {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 12px;
}

.modal-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* AI Provider Status Modal */
.modal-ai-status {
    max-width: 500px;
}

.ai-provider-status {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.status-loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}

/* Countries Status Summary */
.countries-status-summary {
    padding: 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.countries-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.countries-status-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 8px;
}

.countries-status-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.countries-status-value {
    font-size: 15px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
}

.countries-status-value.status-success {
    color: var(--success);
    background: rgba(67, 160, 71, 0.1);
    border: 1px solid var(--success);
}

.countries-status-value.status-warning {
    color: var(--warning);
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid var(--warning);
}

.provider-status-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.provider-status-item:hover {
    background: var(--bg-panel);
    border-color: var(--border-glow);
}

.provider-status-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    position: relative;
}

/* Ampel-System */
.provider-status-icon.status-online {
    background: rgba(67, 160, 71, 0.2);
    border: 2px solid var(--success);
    color: var(--success);
}

.provider-status-icon.status-online::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: 50%;
    bottom: 2px;
    right: 2px;
    box-shadow: 0 0 8px var(--success);
    animation: pulse-green 2s ease-in-out infinite;
}

.provider-status-icon.status-rate_limit {
    background: rgba(255, 152, 0, 0.2);
    border: 2px solid var(--warning);
    color: var(--warning);
}

.provider-status-icon.status-rate_limit::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--warning);
    border-radius: 50%;
    bottom: 2px;
    right: 2px;
    box-shadow: 0 0 8px var(--warning);
    animation: pulse-yellow 2s ease-in-out infinite;
}

.provider-status-icon.status-error,
.provider-status-icon.status-deprecated,
.provider-status-icon.status-not_configured {
    background: rgba(229, 57, 53, 0.2);
    border: 2px solid var(--danger);
    color: var(--danger);
}

.provider-status-icon.status-error::after,
.provider-status-icon.status-deprecated::after,
.provider-status-icon.status-not_configured::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--danger);
    border-radius: 50%;
    bottom: 2px;
    right: 2px;
    box-shadow: 0 0 8px var(--danger);
    animation: pulse-red 2s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

@keyframes pulse-yellow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.provider-status-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.provider-status-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.provider-status-detail {
    font-size: 12px;
    color: var(--text-secondary);
}

.provider-backoff-info {
    font-size: 11px;
    color: var(--warning);
    margin-top: 4px;
    font-family: var(--font-mono);
    padding: 4px 8px;
    background: rgba(255, 152, 0, 0.1);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 152, 0, 0.3);
    display: inline-block;
}

.provider-status-badge {
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.provider-status-badge.status-online {
    background: rgba(67, 160, 71, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.provider-status-badge.status-rate_limit {
    background: rgba(255, 152, 0, 0.2);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.provider-status-badge.status-error,
.provider-status-badge.status-deprecated,
.provider-status-badge.status-not_configured {
    background: rgba(229, 57, 53, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .legend {
        gap: 16px;
        flex-wrap: wrap;
    }
    
    .popup-content {
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    /* ===== MOBILE MAP FIRST LAYOUT ===== */
    
    /* Hide desktop-only elements */
    .desktop-only {
        display: none !important;
    }
    
    /* Show mobile-only elements */
    .mobile-only {
        display: block !important;
    }
    
    /* Remove body padding/margin for fullscreen map */
    body {
        overflow: hidden;
    }
    
    .app-container {
        position: relative;
        height: 100vh;
        overflow: hidden;
    }
    
    /* ===== FULL SCREEN MAP ===== */
    .main-content {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 0;
        z-index: 0;
    }
    
    .map-content-wrapper {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        max-width: 100%;
    }
    
    .map-container {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        aspect-ratio: unset;
        max-width: 100%;
        max-height: 100%;
    }
    
    .map-wrapper {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        aspect-ratio: unset;
        /* Remove blue ocean padding - map touches edges */
        background: linear-gradient(
            180deg,
            #a8d4e6 0%,
            #7ec8e3 20%,
            #5eb3d4 50%,
            #4a9fc4 80%,
            #3d8eb3 100%
        );
    }
    
    #worldMap {
        width: 100%;
        height: 100%;
    }
    
    /* Hide ads on mobile */
    .ad-banner {
        display: none !important;
    }
    
    .anchor-ad-container {
        display: none !important;
    }
    
    /* ===== FLOATING HEADER ===== */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        padding: 8px 12px;
        background: linear-gradient(
            180deg,
            rgba(15, 23, 42, 0.95) 0%,
            rgba(15, 23, 42, 0.85) 50%,
            rgba(15, 23, 42, 0.7) 100%
        );
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(51, 65, 85, 0.5);
        z-index: 100;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .header-content {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .header-logo {
        height: 40px;
        max-width: 200px;
    }
    
    .subtitle {
        display: none; /* Hide subtitle on mobile */
    }
    
    /* Settings Menu - Mobile adjustments */
    .settings-menu {
        width: 280px;
        max-width: 85vw;
    }
    
    .settings-header {
        padding: 16px;
    }
    
    .settings-body {
        padding: 16px;
    }
    
    .setting-item label {
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 1px;
    }
    
    .setting-item select {
        padding: 12px;
        min-height: 44px;
    }
    
    /* Mobile: Label-Wrapper und Language-Options */
    .setting-label-wrapper {
        margin-bottom: 20px !important;
        height: auto !important;
        max-height: none !important;
    }
    
    .language-options {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* ===== FLOATING SEARCH BAR ===== */
    .top-controls {
        position: fixed;
        top: 60px; /* Below header */
        left: 12px;
        right: 12px;
        padding: 0;
        background: transparent;
        border: none;
        z-index: 50;
        display: flex;
        flex-direction: column;
        gap: 0;
    }
    
    .country-search {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        background: rgba(15, 23, 42, 0.85);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(51, 65, 85, 0.5);
        border-radius: 12px;
        padding: 12px 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    #countrySearch {
        width: 100%;
        background: rgba(30, 41, 59, 0.6);
        border: 1px solid rgba(51, 65, 85, 0.5);
        border-radius: 8px;
        color: var(--text-primary);
        font-size: 14px;
        padding: 12px 16px;
        min-height: 44px;
    }
    
    #countrySearch:focus {
        outline: none;
        border-color: var(--neon-cyan);
        box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.2);
    }
    
    /* Hide other top controls on mobile */
    .score-changes-controls,
    .btn-ai-status {
        display: none;
    }
    
    /* ===== BOTTOM SHEET FOR COUNTRY LIST ===== */
    .table-section {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px; /* Collapsed state - only header visible */
        max-height: 80vh; /* Max height when expanded */
        background: var(--bg-surface);
        border-top: 2px solid var(--border-color);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
        z-index: 200;
        transition: height 0.3s ease-in-out, z-index 0s linear 0.3s;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    
    /* Wenn Settings-Menü aktiv ist, Table Section komplett nach hinten */
    body:has(.settings-menu.active) .table-section,
    .settings-menu.active ~ .table-section,
    body:has(.settings-menu.active) #tableSection,
    .settings-menu.active ~ #tableSection {
        z-index: 1 !important; /* Sehr niedrig, damit Menü darüber liegt */
        transition: z-index 0s linear 0s; /* Sofort, ohne Verzögerung */
    }
    
    /* Alternative: Wenn body die Klasse hat */
    body.settings-menu-active .table-section,
    body.settings-menu-active #tableSection {
        z-index: 1 !important;
    }
    
    .table-section.expanded {
        height: 80vh;
    }
    
    /* Wenn Settings-Menü aktiv ist, Table Section komplett nach hinten */
    body:has(.settings-menu.active) .table-section,
    .settings-menu.active ~ .table-section,
    body:has(.settings-menu.active) #tableSection {
        z-index: 1 !important; /* Sehr niedrig, damit Menü darüber liegt */
    }
    
    /* Auch alle Elemente innerhalb der Table Section */
    body:has(.settings-menu.active) .table-toggle-btn,
    body:has(.settings-menu.active) .table-ad-banner,
    body:has(.settings-menu.active) .table-header,
    body:has(.settings-menu.active) .table-header-actions {
        z-index: 1 !important;
    }
    
    .table-header {
        flex-shrink: 0;
        padding: 8px 12px;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-color);
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 44px;
    }
    
    .table-title-section {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
    }
    
    .table-header h3 {
        font-size: 13px;
        margin: 0;
        color: var(--text-primary);
        font-weight: 600;
    }
    
    .table-count {
        font-size: 11px;
        color: var(--text-secondary);
        background: var(--bg-tertiary);
        padding: 3px 8px;
        border-radius: var(--radius-sm);
        font-family: var(--font-mono);
    }
    
    .table-header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .table-filter-toggle-btn-compact {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        padding: 0;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        color: var(--text-primary);
        cursor: pointer;
        transition: all 0.2s ease;
        font-size: 14px;
    }
    
    .table-filter-toggle-btn-compact:hover {
        background: var(--bg-secondary);
        border-color: var(--neon-cyan);
    }
    
    .table-filter-toggle-btn-compact.active {
        background: var(--neon-cyan-bg);
        border-color: var(--neon-cyan);
    }
    
    /* Mobile Toggle Button */
    .table-toggle-btn {
        display: none; /* Hidden on desktop */
    }
    
    .table-toggle-btn.mobile-only {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 16px;
        background: var(--neon-cyan);
        color: var(--bg-deep);
        border: none;
        border-radius: 20px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        box-shadow: 0 2px 8px rgba(0, 245, 212, 0.3);
    }
    
    .table-toggle-btn.mobile-only:hover {
        background: var(--neon-pink);
        box-shadow: 0 4px 12px rgba(255, 0, 110, 0.4);
        transform: translateY(-2px);
    }
    
    .table-toggle-btn.mobile-only:active {
        transform: translateY(0);
    }
    
    .table-section.expanded .table-toggle-btn.mobile-only {
        background: var(--neon-pink);
    }
    
    .table-section.expanded .table-toggle-btn.mobile-only .toggle-text::before {
        content: attr(data-i18n-hide);
    }
    
    .toggle-icon {
        font-size: 16px;
        transition: transform 0.3s ease;
    }
    
    .table-section.expanded .toggle-icon {
        transform: rotate(180deg);
    }
    
    /* Controls Container - separate from header */
    .table-controls-container {
        flex-shrink: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s ease-in-out, opacity 0.3s ease, padding 0.3s ease;
        padding: 0 12px;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-color);
    }
    
    .table-section.expanded .table-controls-container {
        max-height: 150px;
        opacity: 1;
        padding: 6px 12px;
    }
    
    .filter-icon {
        font-size: 16px;
        transition: transform 0.3s ease;
    }
    
    .table-filter-toggle-btn.active .filter-icon {
        transform: rotate(180deg);
    }
    
    .table-controls {
        display: none !important;
        gap: 0;
        margin-top: 0;
        padding-top: 0;
        animation: slideDown 0.3s ease;
    }
    
    .table-controls.visible {
        display: flex !important;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .table-controls select {
        width: 100%;
        padding: 6px 10px;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        color: var(--text-primary);
        font-size: 12px;
        min-height: 32px;
    }
    
    .table-scroll {
        flex: 1;
        overflow-y: auto;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        min-height: 0; /* Important for flex scrolling */
    }
    
    .table-section.expanded .table-scroll {
        opacity: 1;
        pointer-events: all;
    }
    
    /* ===== ZOOM CONTROLS (Above Bottom Sheet) ===== */
    .zoom-controls {
        position: fixed;
        bottom: 80px; /* Above collapsed bottom sheet (60px + 20px gap) */
        right: 12px;
        z-index: 150;
        display: flex;
        flex-direction: column;
        gap: 8px;
        transition: bottom 0.3s ease-in-out;
    }
    
    /* When table is expanded, move zoom controls higher */
    .table-section.expanded ~ .main-content .zoom-controls,
    body:has(.table-section.expanded) .zoom-controls {
        bottom: calc(80vh + 20px);
    }
    
    .zoom-btn {
        width: 44px;
        height: 44px;
        background: rgba(15, 23, 42, 0.9);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(51, 65, 85, 0.5);
        border-radius: 50%;
        color: var(--text-primary);
        font-size: 20px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .zoom-btn:hover {
        background: rgba(0, 245, 212, 0.2);
        border-color: var(--neon-cyan);
    }
    
    /* ===== VIEW CONTROLS ===== */
    .view-controls {
        position: fixed;
        top: 70px;
        right: 12px;
        z-index: 50;
    }
    
    .view-btn {
        width: 44px;
        height: 44px;
        background: rgba(15, 23, 42, 0.9);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(51, 65, 85, 0.5);
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    /* ===== LEGEND (Hide on mobile or make it minimal) ===== */
    .legend {
        display: none; /* Hide legend on mobile to save space */
    }
    
    /* ===== POPUP OPTIMIZATION ===== */
    .popup-content {
        width: 95%;
        max-height: 90vh;
        margin: 20px;
    }
    
    .popup-header h2 {
        font-size: 18px;
    }
}

/* ===== Mobile Optimierung für Smartphones (max-width: 480px) ===== */
@media (max-width: 480px) {
    /* Header optimieren */
    .header {
        padding: 8px 10px;
    }
    
    .header-logo {
        height: 35px;
        max-width: 180px;
    }
    
    /* Search Bar Position */
    .top-controls {
        top: 55px; /* Slightly lower for smaller header */
    }
    
    /* Bottom Sheet - Smaller initial height on very small screens */
    .table-section {
        height: 120px;
    }
    
    .table-section.expanded {
        height: 75vh;
    }
    
    /* Zoom Controls - Adjust position for smaller bottom sheet */
    .zoom-controls {
        bottom: 140px;
    }
    
    /* Popup für mobile optimieren */
    .country-popup {
        padding: 0;
    }
    
    .popup-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }
    
    .popup-header {
        padding: 16px 50px 16px 16px;
        flex-shrink: 0;
    }
    
    .popup-header h2 {
        font-size: 18px;
    }
    
    .popup-close {
        width: 40px;
        height: 40px;
        font-size: 24px;
        top: 12px;
        right: 12px;
    }
    
    .popup-body {
        padding: 16px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling auf iOS */
    }
    
    .sentiment-badge {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    /* News List */
    .news-list {
        padding: 12px 0;
    }
    
    .news-list h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .news-list ul {
        gap: 8px;
    }
    
    .news-list li {
        padding: 10px;
        font-size: 13px;
    }
    
    .summary {
        padding: 12px;
        font-size: 13px;
        line-height: 1.6;
    }
    
    .summary h4 {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .summary p {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .sentiment-score,
    .ai-model {
        font-size: 12px;
        padding: 6px 0;
    }
    
    .analysis-time {
        font-size: 11px;
        padding: 8px 0;
    }
    
    /* Tabelle für mobile optimieren */
    .table-section {
        padding: 8px;
    }
    
    /* Wenn Settings-Menü aktiv ist, Table Section komplett nach hinten (Mobile) */
    body:has(.settings-menu.active) .table-section,
    .settings-menu.active ~ .table-section,
    body:has(.settings-menu.active) #tableSection {
        z-index: 1 !important; /* Sehr niedrig, damit Menü darüber liegt */
    }
    
    /* Auch alle Elemente innerhalb der Table Section (Mobile) */
    body:has(.settings-menu.active) .table-toggle-btn,
    body:has(.settings-menu.active) .table-ad-banner,
    body:has(.settings-menu.active) .table-header,
    body:has(.settings-menu.active) .table-header-actions {
        z-index: 1 !important;
    }
    
    .table-section .table-header {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
        gap: 10px;
    }
    
    .table-section .table-title-section {
        display: none !important; /* In Mobile: Titel und Count ausblenden */
    }
    
    .country-search-mobile {
        display: none !important; /* In Mobile: Suche ausblenden */
    }
    
    .table-filter-toggle-btn-compact {
        display: none !important; /* In Mobile: Filter/Such-Icon ausblenden */
    }
    
    .table-section .table-header h3 {
        font-size: 14px;
    }
    
    .table-section .table-controls {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    /* Werbebanner in Table Section */
    .table-ad-banner {
        position: relative;
        width: 100%;
        display: none; /* Vorläufig deaktiviert */
        align-items: center;
        justify-content: center;
        padding: 12px;
        background: var(--bg-tertiary);
        border-top: 1px solid var(--border-color);
        min-height: 80px;
        cursor: pointer; /* Zeigt an, dass Banner klickbar ist */
    }
    
    .ad-close-btn {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.5);
        border: 1px solid var(--border-color);
        border-radius: 50%;
        color: var(--text-primary);
        font-size: 14px;
        cursor: pointer;
        transition: all 0.2s ease;
        z-index: 10;
    }
    
    .ad-close-btn:hover {
        background: rgba(0, 0, 0, 0.7);
        border-color: var(--neon-cyan);
    }
    
    .ad-placeholder-table {
        width: 100%;
        max-width: 728px;
        height: 90px;
        background: #808080;
        color: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
        border: 2px dashed rgba(255, 255, 255, 0.3);
        border-radius: 4px;
    }
    
    .table-ad-banner.hidden {
        display: none;
    }
    
    .table-section .table-controls input,
    .table-section .table-controls select {
        width: 100%;
        padding: 12px;
        font-size: 14px;
        min-height: 44px; /* Touch-optimiert */
    }
    
    .table-scroll {
        max-height: 800px; /* Verdoppelt: 400px -> 800px für mehr sichtbare Zeilen */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #countriesTable {
        min-width: 600px; /* Mindestbreite für horizontales Scrollen */
        font-size: 12px;
    }
    
    #countriesTable th {
        padding: 10px 8px;
        font-size: 11px;
        white-space: nowrap;
    }
    
    #countriesTable td {
        padding: 8px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .table-country {
        min-width: 100px;
    }
    
    .table-color {
        min-width: 50px;
    }
    
    .table-sentiment {
        min-width: 80px;
    }
    
    .table-score {
        min-width: 60px;
    }
    
    .table-date {
        min-width: 120px;
        font-size: 11px;
    }
    
    /* Legend für mobile */
    .legend {
        padding: 10px;
        gap: 8px;
        font-size: 11px;
    }
    
    .legend-item {
        gap: 6px;
    }
    
    .legend-color {
        width: 16px;
        height: 16px;
    }
    
    /* Start AI Button */
    .start-ai-btn {
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: calc(100% - 24px);
        max-width: 300px;
        padding: 16px 24px;
        font-size: 16px;
    }
    
    /* Timeline Section */
    .timeline-section {
        padding: 8px;
    }
    
    .timeline-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }
    
    .timeline-header h3 {
        font-size: 16px;
    }
    
    .timeline-header select {
        width: 100%;
        padding: 12px;
        font-size: 14px;
        min-height: 44px;
    }
    
    /* Config Panel */
    .config-panel {
        padding: 12px;
    }
    
    .config-panel h3 {
        font-size: 16px;
    }
    
    .config-form {
        gap: 12px;
    }
    
    .config-form label {
        font-size: 13px;
    }
    
    .config-form input,
    .config-form select {
        padding: 12px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .config-form button {
        padding: 14px 24px;
        font-size: 14px;
        min-height: 44px;
    }
    
    /* Country History */
    .country-history {
        margin-top: 16px;
    }
    
    .country-history h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .history-list {
        gap: 10px;
    }
    
    .history-item {
        padding: 12px;
        font-size: 12px;
    }
    
    /* Touch-optimierte Interaktionen */
    .country {
        stroke-width: 0.8; /* Dünnere Linien für bessere Sichtbarkeit */
    }
    
    .country:hover {
        stroke-width: 1.5;
    }
    
    /* Verhindere Text-Selektion auf Touch-Gesten */
    .map-container,
    .zoom-btn,
    .view-btn {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Smooth Scrolling */
    html {
        scroll-behavior: smooth;
    }
    
    /* Verbesserte Touch-Targets */
    button,
    .zoom-btn,
    .view-btn,
    .popup-close,
    .table-row {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ===== Start AI Button ===== */
.start-ai-btn {
    position: fixed;
    bottom: 80px;
    left: 24px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    color: white;
    border: none;
    border-radius: 50px;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

.start-ai-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(139, 92, 246, 0.5);
}

.start-ai-btn:active {
    transform: translateY(0);
}

.start-ai-btn.processing {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    pointer-events: none;
}

/* ===== Mini Progress Indicator (unten rechts) ===== */
/* ===== IT-Recht Cookie-Banner komplett entfernen ===== */
.itrk-cookie-banner,
[class*="itrk"][class*="cookie"],
[id*="itrk"][id*="cookie"],
.itrk-cookie-consent,
.itrk-cookie-notice,
#itrk-cookie-banner,
[id*="itrk-cookie"],
[class*="itrk-cookie"],
div[class*="cookie"][class*="itrk"],
div[id*="cookie"][id*="itrk"],
[data-itrk-cookie],
.itrk-cookie,
#itrk-cookie {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    pointer-events: none !important;
}
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* ===== Timeline Section (unter der Karte) ===== */
.timeline-section {
    flex-shrink: 0;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
    padding: 0;
    max-height: 130px;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    overflow: hidden;
}

.timeline-section.hidden {
    max-height: 0;
    opacity: 0;
    border-top: none;
}

.timeline-section .timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.timeline-section .timeline-header h3 {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.timeline-section .timeline-header select {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
}

.timeline-section .timeline-header select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.timeline-scroll {
    display: flex;
    gap: 12px;
    padding: 12px 24px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.timeline-scroll::-webkit-scrollbar {
    height: 6px;
}

.timeline-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.timeline-scroll::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.timeline-hint {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 16px;
    width: 100%;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    min-width: 100px;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-align: center;
}

.timeline-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.timeline-item .color-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.2);
}

.timeline-item .item-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.timeline-item .item-country {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

.timeline-item .item-time {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.timeline-item .item-sentiment {
    font-size: 11px;
    color: var(--accent-primary);
    background: rgba(255, 107, 53, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

/* ===== Country History ===== */
.country-history {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0; /* Verhindert, dass es zu viel Platz einnimmt */
}

.history-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
}

.history-toggle-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-glow);
}

.history-toggle-icon {
    font-size: 16px;
}

.history-toggle-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.history-toggle-btn.expanded .history-toggle-arrow {
    transform: rotate(180deg);
}

.country-history h3 {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: none; /* Versteckt, da jetzt Toggle-Button verwendet wird */
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 120px; /* Reduziert von 200px auf 120px */
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px; /* Reduziert von 10px 12px */
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px; /* Kompakter */
}

.history-item:hover {
    background: var(--bg-secondary);
}

.history-item.active {
    border: 1px solid var(--accent-primary);
    background: rgba(255, 107, 53, 0.1);
}

.history-item .color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.2);
}

.history-item .history-info {
    flex: 1;
}

.history-item .history-date {
    font-size: 11px; /* Reduziert von 12px */
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.history-item .history-sentiment {
    font-size: 10px; /* Reduziert von 11px */
    color: var(--text-muted);
}

/* ===== Analysis Time ===== */
.analysis-time {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ===== Legend Updates ===== */
.legend-separator {
    margin: 0 12px;
    color: var(--border-color);
}

#oldestInfo {
    font-size: 11px;
    color: var(--text-muted);
}

/* Sentiment Score im Log */
.progress-log-item .score {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-left: auto;
}

/* Sentiment Score in der Analyse */
.sentiment-score {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-primary);
    margin-top: 8px;
}

/* ===== Quellen-Info (Urheberrecht) ===== */
.source-info {
    display: none; /* Komplett ausgeblendet */
    list-style: none;
}

.source-hint {
    list-style: none;
    padding: 6px 12px;
    font-size: 11px; /* Kleinerer Text */
    color: var(--text-secondary);
}

.source-hint a {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 11px; /* Kleinerer Text */
    transition: color 0.2s ease;
}

.source-hint a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* Link unter dem Analyse-Text */
.summary-link {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
    text-align: center;
}

.summary-link a {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.summary-link a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* ===== Fullscreen Mode ===== */
.main-content.fullscreen-mode {
    padding: 0;
}

.main-content.fullscreen-mode .map-content-wrapper {
    width: 100%;
    max-width: 100%;
}

.main-content.fullscreen-mode .map-container {
    aspect-ratio: unset;
    height: calc(100vh - 80px);
    max-height: calc(100vh - 80px);
}

.main-content.fullscreen-mode .table-section {
    display: none !important;
}

/* ===== Table Section (unter der Karte) ===== */
.table-section {
    flex-shrink: 0;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
    padding: 0;
    max-height: 800px; /* Verdoppelt: 400px -> 800px für mehr sichtbare Zeilen */
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    overflow: hidden;
}

/* Werbebanner in Table Section - Global deaktiviert */
.table-ad-banner {
    display: none !important; /* Vorläufig deaktiviert */
}

/* Tabelle ist jetzt immer sichtbar, keine hidden-Klasse mehr nötig */

.table-section .table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

.table-section .table-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-section .table-header h3 {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.table-section .table-count {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
}

.table-section .table-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Override for mobile - controls hidden by default */
@media (max-width: 768px) {
    .table-section .table-controls {
        display: none !important;
    }
    
    .table-section .table-controls.visible {
        display: flex !important;
    }
}

.table-section .table-controls input {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    min-width: 200px;
}

.table-section .table-controls select {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
}

.table-scroll {
    max-height: 700px; /* Verdoppelt: 350px -> 700px für mehr sichtbare Zeilen */
    overflow-y: auto;
    overflow-x: auto;
}

#countriesTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#countriesTable thead {
    position: sticky;
    top: 0;
    background: var(--bg-tertiary);
    z-index: 10;
}

#countriesTable th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#countriesTable th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    position: relative;
}

#countriesTable th.sortable:hover {
    background-color: var(--bg-tertiary);
}

#countriesTable th.sortable.sorted {
    color: var(--neon-cyan);
}

#countriesTable td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

#countriesTable tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#countriesTable tbody tr:hover {
    background: var(--bg-tertiary);
}

#countriesTable tbody tr.table-row:active {
    background: var(--bg-secondary);
}

.table-country {
    font-weight: 500;
    color: var(--text-primary);
}

.table-color {
    width: 60px;
}

.color-indicator {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: inline-block;
}

.table-sentiment {
    font-size: 12px;
}

.table-score {
    font-family: var(--font-mono);
    font-size: 12px;
    text-align: right;
}

.table-date {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

.table-loading,
.table-error,
.table-empty {
    text-align: center;
    padding: 24px !important;
    color: var(--text-muted);
    font-style: italic;
}

/* Analysis Time im Modal */
.analysis-time {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.analysis-time-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.analysis-time-value {
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.analysis-time-separator {
    color: var(--border-color);
    margin: 0 4px;
}