/* =============================================
   GLOBAL VARIABLES & RESET
   ============================================= */

:root {
    --radio-body: #2a2a2a;
    --radio-face: #1a1a1a;
    --metal: #8b8b8b;
    --metal-dark: #4a4a4a;
    --led-green: #00ff41;
    --led-red: #ff0033;
    --led-off: #1a3a1a;
    --speaker: #0a0a0a;
    --dial-gold: #d4af37;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Share Tech Mono', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #fff;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    padding: 0.5rem 1rem;
    background: var(--led-green);
    color: var(--radio-face);
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    text-decoration: none;
    border-radius: 4px;
    z-index: 100;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 1rem;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    color: var(--led-green);
    text-shadow: 0 0 20px var(--led-green), 0 0 40px var(--led-green);
    margin-bottom: 0.5rem;
}

.header .subtitle {
    font-size: 1rem;
    letter-spacing: 0.3em;
    color: var(--metal);
    text-transform: uppercase;
}

.radio-container {
    background: linear-gradient(180deg, var(--radio-body) 0%, var(--radio-face) 100%);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 800px;
    width: 100%;
    position: relative;
    border: 3px solid var(--metal-dark);
    animation: slideUp 1s ease-out 0.3s both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Speaker Grill */
.speaker-grill {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 120px;
    height: 120px;
    background: var(--speaker);
    border-radius: 50%;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

.speaker-grill::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, var(--metal-dark) 1px, transparent 1px);
    background-size: 8px 8px;
}

/* Display */
.display {
    background: var(--led-off);
    border: 4px solid var(--metal-dark);
    border-radius: 10px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow:
        inset 0 0 30px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(0, 255, 65, 0.3);
    position: relative;
    overflow: hidden;
}

.display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 255, 65, 0.05) 100%);
    pointer-events: none;
}

.frequency-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--led-green);
    text-align: center;
    text-shadow:
        0 0 10px var(--led-green),
        0 0 20px var(--led-green),
        0 0 30px var(--led-green);
    letter-spacing: 0.1em;
    line-height: 1;
}

.frequency-display .mhz {
    font-size: 1.5rem;
    opacity: 0.8;
    margin-left: 0.5rem;
}

.station-info {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--led-green);
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    min-height: 1.5rem;
}

/* Spectrum */
.spectrum {
    background: var(--radio-face);
    border: 2px solid var(--metal-dark);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.spectrum-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    position: relative;
}

.freq-marker {
    font-size: 0.75rem;
    color: var(--metal);
    font-family: 'Orbitron', sans-serif;
}

.spectrum-bar {
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg,
            var(--led-red) 0%,
            var(--dial-gold) 50%,
            var(--led-green) 100%);
    border-radius: 4px;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 255, 65, 0.3);
}

.tuner-needle {
    position: absolute;
    top: -10px;
    width: 3px;
    height: 28px;
    background: var(--led-green);
    box-shadow: 0 0 10px var(--led-green);
    transition: left 0.3s ease;
    pointer-events: none;
}

.tuner-needle::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid var(--led-green);
}

/* Station markers on spectrum */
.station-marker {
    position: absolute;
    bottom: 15px;
    width: 2px;
    height: 12px;
    background: var(--dial-gold);
    opacity: 0.6;
}

.station-marker.pos-4 {
    left: 4%;
}

.station-marker.pos-24 {
    left: 24%;
}

.station-marker.pos-44 {
    left: 44%;
}

.station-marker.pos-64 {
    left: 64%;
}

.station-marker.pos-84 {
    left: 84%;
}

.station-marker.pos-84 {
    left: 84%;
}

/* Controls */
.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.control-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    color: var(--metal);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
}

.knob {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at 30% 30%, var(--metal), var(--metal-dark));
    border-radius: 50%;
    position: relative;
    cursor: grab;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 2px 5px rgba(255, 255, 255, 0.3),
        inset 0 -2px 5px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s ease;
}

.knob:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.knob::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 30%;
    background: var(--dial-gold);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--dial-gold);
}

.knob::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: var(--radio-face);
    border-radius: 50%;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

/* Preset buttons */
.presets {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.preset-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(180deg, var(--metal) 0%, var(--metal-dark) 100%);
    border: 2px solid var(--metal-dark);
    border-radius: 8px;
    color: var(--led-off);
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.preset-btn:hover {
    background: linear-gradient(180deg, var(--dial-gold) 0%, var(--metal) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
}

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

.preset-btn.active {
    background: var(--led-green);
    color: var(--radio-face);
    box-shadow: 0 0 20px var(--led-green);
}

/* Content area */
.content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 2rem;
    min-height: 200px;
    margin-bottom: 2rem;
}

.content h2 {
    font-family: 'Orbitron', sans-serif;
    color: var(--led-green);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.content p {
    line-height: 1.8;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.content li {
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Static/noise indicator */
.signal-strength {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 1rem;
}

.signal-bar {
    width: 8px;
    height: 20px;
    background: var(--led-off);
    border-radius: 2px;
    transition: background 0.3s ease;
}

.signal-bar.active {
    background: var(--led-green);
    box-shadow: 0 0 10px var(--led-green);
}

/* Footer CTA */
.cta {
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.1) 0%, rgba(255, 0, 51, 0.1) 100%);
    border: 2px solid var(--led-green);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
}

.cta h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--led-green);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.cta p {
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.cta a {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--led-green);
    color: var(--radio-face);
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px var(--led-green);
}

.cta a:hover {
    background: var(--dial-gold);
    box-shadow: 0 0 30px var(--dial-gold);
    transform: translateY(-2px);
}

.footer {
    margin-top: 3rem;
    text-align: center;
    color: var(--metal);
    font-size: 0.85rem;
}

/* ===== Les mer link (station content → kanal page) ===== */
.les-mer {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--led-green);
    border-radius: 4px;
    color: var(--led-green);
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    transition: all 0.2s ease;
}

.les-mer:hover {
    background: var(--led-green);
    color: var(--radio-face);
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.4);
}

/* ===== Scanline flash on station swap ===== */
@keyframes scanline-sweep {
    0%   { background-position: 0 -100%; }
    100% { background-position: 0 200%; }
}

.display.scanline-flash::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 255, 65, 0.12) 2px,
        rgba(0, 255, 65, 0.12) 4px
    );
    background-size: 100% 200%;
    animation: scanline-sweep 0.25s ease-out forwards;
    pointer-events: none;
    z-index: 1;
}

/* ===== Broadcast-end card (initial / no station) ===== */
.broadcast-end {
    text-align: center;
    padding: 2.5rem 1rem;
}

.broadcast-end__icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.broadcast-end__title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--metal);
    letter-spacing: 0.3em;
    margin-bottom: 0.8rem;
}

.broadcast-end__sub {
    color: var(--metal-dark);
    font-size: 0.82rem;
    letter-spacing: 0.1em;
}

/* ===== Footer nav (LIVE / ARKIV / OM) ===== */
.footer-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.8rem;
}

.footer-nav__link {
    color: var(--metal);
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    transition: color 0.2s ease;
}

.footer-nav__link:hover {
    color: var(--led-green);
}

.footer-nav__link--active {
    color: var(--led-green);
}

/* ===== Freq-marker links on spectrum bar ===== */
a.freq-marker {
    text-decoration: none;
    color: var(--metal);
    cursor: pointer;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

a.freq-marker:hover {
    color: var(--led-green);
    text-shadow: 0 0 6px var(--led-green);
}

@media (max-width: 768px) {
    .radio-container {
        padding: 2rem 1.5rem;
    }

    .speaker-grill {
        width: 80px;
        height: 80px;
        top: 1rem;
        right: 1rem;
    }

    .frequency-display {
        font-size: 2.5rem;
    }

    .controls {
        grid-template-columns: 1fr;
    }

    .knob {
        width: 80px;
        height: 80px;
    }
}

/* Foote Line */
.footer-line {
    margin-top: 1.0rem;
    font-size: 0.82rem;
    line-height: 1.4;
    color: #8a8a8a;
    letter-spacing: 0.01em;
    text-align: center;
}

.footer-line a {
    color: inherit;
    text-decoration: none;
}

.footer-line a:hover {
    color: #585858;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-line .sep {
    margin: 0 0.35rem;
    opacity: 0.5;
}
