:root {
    --bg: #1a1a2e;
    --surface: #16213e;
    --surface-light: #1c2a4a;
    --border: #2a3a5e;
    --text: #e0e0e0;
    --text-dim: #8892a4;
    --accent: #4fc3f7;
    --accent-dim: #2196f3;
    --green: #66bb6a;
    --orange: #ffa726;
    --red: #ef5350;
    --purple: #ab47bc;

    --band-160: #ef5350;
    --band-80: #ffa726;
    --band-40: #66bb6a;
    --band-20: #4fc3f7;
    --band-15: #ab47bc;
    --band-10: #ec407a;

    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

header {
    text-align: center;
    padding: 2rem 1rem 1rem;
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-size: 1.8rem;
    color: var(--accent);
    font-weight: 700;
}

header .subtitle {
    color: var(--text-dim);
    font-size: 0.9rem;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    font-size: 0.8rem;
}

/* Panels */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
}

.panel h2 {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 1rem;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

/* Selector */
.selector-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.selector-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.selector-group label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.callsign-group {
    position: relative;
    flex: 1;
    min-width: 200px;
}

select, input[type="text"] {
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem 1rem;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}

select:focus, input[type="text"]:focus {
    border-color: var(--accent);
}

select:disabled, input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

input[type="text"] {
    width: 100%;
    text-transform: uppercase;
}

/* Dropdown */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.dropdown-item:hover {
    background: var(--border);
}

.dropdown-item .call {
    font-family: var(--mono);
    font-weight: 600;
    color: var(--accent);
}

.dropdown-item .meta {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Station Info */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1rem;
    font-family: var(--mono);
}

.info-value.big {
    font-size: 1.4rem;
    color: var(--accent);
    font-weight: 700;
}

/* Solar Bar */
.solar-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.solar-label {
    color: var(--text-dim);
}

.solar-label strong {
    color: var(--text);
}

/* Brush info */
.brush-info {
    display: flex;
    gap: 2rem;
    padding: 0.8rem 1rem;
    background: var(--surface-light);
    border-radius: 4px;
    margin-top: 0.8rem;
    font-size: 0.85rem;
    font-family: var(--mono);
}

.brush-info span {
    color: var(--text-dim);
}

/* Band grid */
.band-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .band-grid {
        grid-template-columns: 1fr;
    }
}

/* Band table */
#band-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

#band-table th, #band-table td {
    padding: 0.4rem 0.6rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

#band-table th {
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
}

#band-table td:first-child, #band-table th:first-child {
    text-align: left;
}

#band-table .band-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

/* Openings controls */
.openings-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.openings-controls label {
    color: var(--text-dim);
}

.openings-controls select {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}

/* Compare */
.compare-controls {
    margin-bottom: 1rem;
}

.compare-controls input {
    width: 250px;
    text-transform: uppercase;
}

#compare-tags {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.compare-tag {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    font-family: var(--mono);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.compare-tag .remove {
    cursor: pointer;
    color: var(--red);
    font-weight: bold;
}

/* Charts */
svg text {
    fill: var(--text-dim);
    font-size: 11px;
}

svg .axis-label {
    font-size: 12px;
    fill: var(--text);
}

svg .grid line {
    stroke: var(--border);
    stroke-opacity: 0.5;
}

svg .grid .domain {
    stroke: none;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
    pointer-events: none;
    z-index: 200;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 600px) {
    .selector-row {
        flex-direction: column;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .brush-info {
        flex-wrap: wrap;
        gap: 0.5rem 1.5rem;
    }
}