:root {
    --primary-color: #00ff00;
    --primary-rgb: 0, 255, 0;
    --background-color: #0a0a0a;
    --panel-bg: #111;
    --border-color: #333;
    --text-dim: #666;

    --color-ana-1: oklch(69.3% 0.152 180);
    --color-ana-1-contrast: #000;
    --color-ana-2: oklch(49.3% 0.11 150);
    --color-ana-2-contrast: #fff;
    --color-ana-3: oklch(59.3% 0.123 160);
    --color-ana-3-contrast: #000;
    --color-ana-4: oklch(80% 0.14237 167.878);
    --color-ana-4-contrast: #000;
    --color-ana-5: oklch(94.3% 0.096 195);
    --color-ana-5-contrast: #000;
    --color-ana-6: oklch(95% 0.082 210);
    --color-ana-6-contrast: #000;

    --ui-bg: var(--color-ana-2);
    --ui-bg-hover: var(--color-ana-1);
    --ui-bg-active: var(--color-ana-3);
    --ui-border: var(--color-ana-3);

    --dialog-border-width: 2px;
    --dialog-border-color: #00ff00;
    --dialog-box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

/* Theme variants: default is green via :root; others override on body */

body.theme-blue {
    --primary-color: #4fd5ff;
    --primary-rgb: 79, 213, 255;
    --ui-bg: oklch(48% 0.12 245);
    --ui-bg-hover: oklch(64% 0.16 245);
    --ui-bg-active: oklch(55% 0.15 245);
    --ui-border: oklch(70% 0.16 245);
    --dialog-border-color: #4fd5ff;
    --dialog-box-shadow: 0 0 20px rgba(79, 213, 255, 0.35);
}

body.theme-red {
    --primary-color: #ff4b4b;
    --primary-rgb: 255, 75, 75;
    --ui-bg: oklch(48% 0.16 25);
    --ui-bg-hover: oklch(64% 0.18 25);
    --ui-bg-active: oklch(55% 0.17 25);
    --ui-border: oklch(70% 0.18 25);
    --dialog-border-color: #ff4b4b;
    --dialog-box-shadow: 0 0 20px rgba(255, 75, 75, 0.35);
}

body.theme-amber {
    --primary-color: #ffc857;
    --primary-rgb: 255, 200, 87;
    --ui-bg: oklch(50% 0.10 80);
    --ui-bg-hover: oklch(66% 0.13 80);
    --ui-bg-active: oklch(74% 0.13 80);
    --ui-border: oklch(72% 0.13 80);
    --dialog-border-color: #ffc857;
    --dialog-box-shadow: 0 0 20px rgba(255, 200, 87, 0.35);
}

/* Zoom-Button in der Himmelsansicht */
.sky-container .zoom-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 50;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    color: var(--primary-color);
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    min-height: 36px;
    min-width: 44px;
}

.sky-container .zoom-button:hover {
    background: var(--ui-bg-hover);
}

.sky-text {
    white-space: pre;
    font-family: monospace;
}

* {
    box-sizing: border-box;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
    align-items: center;
}

.magnitude-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.magnitude-filter input {
    width: 60px;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    color: var(--primary-color);
    padding: 5px;
    border-radius: 3px;
    font-family: inherit;
}

body {
    font-family: 'Courier New', monospace;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--background-color);
    color: var(--primary-color);
    line-height: 1.4;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    color: var(--primary-color);
    margin: 0 0 10px 0;
}

.sky-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.view-mode-tabs {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 4px;
}

.view-tab {
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    color: var(--primary-color);
    padding: 6px 10px;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    min-height: 30px;
    min-width: 44px;
}

.view-tab.active {
    background: var(--ui-bg-active);
    border-color: var(--primary-color);
    border-bottom-color: #000;
}

.sky-container {
    background-color: #000;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-bottom: 20px;
    font-family: monospace;
    white-space: pre;
    line-height: 1;
    letter-spacing: 2px;
    font-size: 1rem;
    /* Feste Größe: Breite UND Höhe bleiben beim Zoom konstant */
    /* 40 Zeilen * ~16px (1rem line-height) + 40px padding = ~680px */
    width: calc(100% - 2px);
    min-height: 680px !important;
    height: 680px !important;
    max-height: 680px !important;
    overflow: hidden;
    cursor: crosshair;
    position: relative;
}

.sky-text {
    position: absolute;
    top: 20px;
    left: 20px;
    transform: none;
}

#sky-container.planisphere-view .sky-text {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#object-dialog {
    position: absolute;
    background: var(--panel-bg);
    border: 1px solid var(--primary-color);
    padding: 15px 20px;
    color: var(--primary-color);
    font-family: monospace;
    white-space: pre;
    z-index: 1000;
    min-width: 200px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    max-width: 300px;
}

.controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.object-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0px;
}

.object-btn {
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    color: var(--primary-color);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    min-height: 36px;
    min-width: 44px;
}

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

.object-btn.active {
    background: var(--ui-bg-active);
    border-color: var(--primary-color);
}

.header-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-btn {
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    color: var(--primary-color);
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    font-size: 0.9rem;
    min-height: 30px;
    min-width: 30px;
}

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

.theme-btn.active {
    background: var(--ui-bg-active);
    border-color: var(--primary-color);
}

.language-selector {
    display: flex;
    gap: 5px;
}

.control-btn {
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    color: var(--primary-color);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    font-size: 1rem;
    min-height: 36px;
    min-width: 44px;
}

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

.lang-btn {
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    color: var(--primary-color);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    min-height: 36px;
    min-width: 44px;
}

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

.lang-btn.active {
    background: var(--ui-bg-active);
    border-color: var(--primary-color);
}

.status-bar {
    display: flex;
    justify-content: space-between;
    color: color-mix(in oklch, var(--text-dim) 70%, var(--color-ana-5) 30%);
    font-size: 0.9em;
    margin-top: 10px;
}

#object-dialog {
    position: absolute;
    background: color-mix(in oklch, var(--panel-bg) 70%, var(--ui-bg) 30%);
    border: var(--dialog-border-width) solid var(--dialog-border-color);
    padding: 15px 20px;
    color: var(--primary-color);
    font-family: monospace;
    white-space: pre;
    z-index: 1000;
    min-width: 200px;
    box-shadow: var(--dialog-box-shadow);
}

#object-dialog button {
    position: absolute;
    top: -5px;
    right: 5px;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    color: var(--primary-color);
    cursor: pointer;
    font-weight: bold;
    padding: 8px;
    min-height: 36px;
    min-width: 36px;
    border-radius: 4px;
}

#object-dialog button:hover {
    background: var(--ui-bg-hover);
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        margin-top: 50px;
        /* Add space above header for controls */
        padding-top: 10px;
    }

    .header-controls {
        top: 10px;
        right: 10px;
    }

    .theme-controls {
        top: 10px;
        left: 10px;
    }

    .controls {
        flex-direction: column;
        gap: 15px;
    }

    .sky-container {
        font-size: var(--sky-font-size, 0.7rem);
        padding: 10px;
        margin-top: 10px;
    }

    .object-btn,
    .control-btn,
    .lang-btn {
        padding: 10px 15px;
        font-size: 1.1rem;
        min-height: 44px;
        min-width: 44px;
    }

    .filter-controls {
        gap: 20px;
    }

    .magnitude-filter {
        gap: 12px;
    }

    .magnitude-filter input {
        width: 70px;
        padding: 10px;
        font-size: 1.1rem;
    }

    #object-dialog button {
        padding: 10px;
        min-height: 44px;
        min-width: 44px;
    }

    .object-list {
        gap: 15px;
    }
}