/* 
 * World News Radio - Main Styles
 * Supports 5 Themes via CSS Variables
 */

:root {
    /* DEFAULT THEME (Theme 1: Warm Sepia & Burnt Orange) */
    --bg-body: #f4ecd8;
    /* Warm Sepia */
    --text-main: #2c2c2c;
    --text-muted: #5d564a;
    --accent-color: #d35400;
    /* Burnt Orange */
    --accent-glow: rgba(211, 84, 0, 0.3);
    --panel-bg: #fffbf2;
    --border-color: #dccdbb;
    --map-bg: #e3d5c0;
    --clock-face: #fffbf2;
    --clock-hand: #333;
    --clock-sec: #d35400;

    /* Font Tokens */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Theme Button Colors for UI */
    --color-1-bg: #d35400;
    --color-2-bg: #8e44ad;
    --color-3-bg: #00f3ff;
    --color-4-bg: #27ae60;
    --color-5-bg: #000000;
}

/* THEME 2: Dark Purple-Gray & Pink */
[data-theme="theme-2"] {
    --bg-body: #1a1a2e;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent-color: #ff007f;
    /* Neon Pink */
    --accent-glow: rgba(255, 0, 127, 0.4);
    --panel-bg: #16213e;
    --border-color: #333;
    --map-bg: #0f3460;
    --clock-face: #16213e;
    --clock-hand: #fff;
    --clock-sec: #ff007f;
}

/* THEME 3: Cyberpunk (Deep Blue & Neon Cyan) */
[data-theme="theme-3"] {
    --bg-body: #050510;
    --text-main: #aaffff;
    --text-muted: #5588aa;
    --accent-color: #00f3ff;
    /* Cyan */
    --accent-glow: rgba(0, 243, 255, 0.6);
    --panel-bg: rgba(10, 20, 40, 0.8);
    --border-color: #00f3ff;
    --map-bg: #02020a;
    --clock-face: #000;
    --clock-hand: #00f3ff;
    --clock-sec: #ff0055;
    --font-heading: 'JetBrains Mono', monospace;
    /* Tech feel */
}

/* THEME 4: Forest Green & Gold */
[data-theme="theme-4"] {
    --bg-body: #1e3a28;
    --text-main: #f1f8e9;
    --text-muted: #aed581;
    --accent-color: #ffd700;
    /* Gold */
    --accent-glow: rgba(255, 215, 0, 0.4);
    --panel-bg: #2e5c40;
    --border-color: #4a7c59;
    --map-bg: #142a1d;
    --clock-face: #2e5c40;
    --clock-hand: #fff;
    --clock-sec: #ffd700;
}

/* THEME 5: Minimalist Black & White */
[data-theme="theme-5"] {
    --bg-body: #ffffff;
    --text-main: #000000;
    --text-muted: #555555;
    --accent-color: #000000;
    --accent-glow: rgba(0, 0, 0, 0.1);
    --panel-bg: #f5f5f5;
    --border-color: #00;
    --map-bg: #ddd;
    --clock-face: #fff;
    --clock-hand: #000;
    --clock-sec: #eb0000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s;
}

h1,
h2,
h3 {
    transition: none !important;
    transform: translateZ(0);
    /* Force GPU layering to stop flicker */
    will-change: transform;
    backface-visibility: hidden;
}

/* THEME SWITCHER */
.theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--panel-bg);
    padding: 10px;
    border-radius: 30px;
    display: flex;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

.theme-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s;
}

.theme-btn:hover {
    transform: scale(1.2);
}

/* HEADER */
.main-header {
    text-align: center;
    padding: 2rem 1rem;
}

.main-header h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
    text-shadow: 0 2px 10px var(--accent-glow);
}





/* MAP SECTION */
.map-section {
    position: relative;
    width: calc(100% - 4in);
    max-width: 1600px;
    height: 60vh;
    min-height: 400px;
    margin: 2rem auto 4rem auto;
    /* Added extra bottom margin */
    background: var(--map-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

#world-map {
    width: 100%;
    height: 100%;
    background: var(--map-bg);
    z-index: 1;
}

.map-overlay-info {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.3);
    /* Lighter bg */
    color: rgba(255, 255, 255, 0.5);
    /* Muted gray text */
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    pointer-events: none;
    z-index: 400;
    /* Above Leaflet controls */
}

/* City Labels on Map */
.city-label-div {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    text-shadow:
        1px 1px 2px rgba(0, 0, 0, 0.8),
        -1px -1px 2px rgba(0, 0, 0, 0.8),
        0 0 4px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
    cursor: pointer;
    transition: color 0.2s, text-shadow 0.2s;
}

.city-label-div:hover {
    color: var(--accent-color);
    text-shadow: 0 0 8px var(--accent-glow);
}

/* City Dots */
.city-dot {
    cursor: pointer;
    transition: transform 0.2s;
}

.city-dot:hover {
    transform: scale(1.5);
}

/* Custom Zoom Control */
.custom-zoom-control {
    display: flex;
    flex-direction: column;
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
}

.custom-zoom-control a {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    text-decoration: none;
    background: transparent;
    transition: background 0.2s;
}

.custom-zoom-control a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.zoom-indicator {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-color);
    padding: 4px 0;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Map Controls (Right Side) */
.map-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-mode-toggle {
    display: flex;
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
}

.mode-btn {
    padding: 6px 10px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #888;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.mode-btn.active {
    color: var(--accent-color);
    background: rgba(var(--accent-color), 0.2);
}

.satellite-toggle {
    padding: 8px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #888;
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.satellite-toggle:hover {
    color: #fff;
    background: rgba(50, 50, 50, 0.9);
}

.satellite-toggle.active {
    color: #00ff88;
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

/* INFO PANEL (Fixed Bottom or Below Map) */
.info-panel {
    width: calc(100% - 4in);
    max-width: 1600px;
    margin: 2rem auto 4rem auto;
    /* Added extra bottom margin */
    padding: 2rem;
    background: var(--panel-bg);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.info-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.city-details {
    flex: 1;
    min-width: 250px;
}

.city-details h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.city-details p {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* CONTENT GRID (Info & News) */
.content-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    /* Ensure children have equal height */
    gap: 2rem;
    width: calc(100% - 4in);
    max-width: 1600px;
    margin: 2rem auto 6rem auto;
    /* Extra bottom margin for page end */
    padding: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.content-grid.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Wiki Section */
.city-wiki {
    flex: 2;
    min-width: 300px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.city-wiki h3,
.news-header {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-header h3 {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    font-size: inherit;
    color: inherit;
    font-family: inherit;
}

.wiki-body h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
    font-family: var(--font-heading);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.wiki-body h3 {
    font-size: 1.4rem;
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
    color: var(--text-main);
    font-family: var(--font-heading);
}

.wiki-body p {
    margin-bottom: 1.2rem;
    line-height: 1.8;
    color: var(--text-main);
    font-size: 1.05rem;
}

.wiki-body ul,
.wiki-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.wiki-body li {
    margin-bottom: 0.6rem;
    line-height: 1.6;
}

/* News Section */
.city-news {
    flex: 1;
    min-width: 300px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.news-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.news-item:last-child {
    border-bottom: none;
}

.news-item h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.news-item h4 a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s;
}

.news-item h4 a:hover {
    color: var(--accent-color);
}

.news-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .content-grid {
        flex-direction: column;
    }
}

/* CLOCKS */
/* Analog Clock Container (Centered by Grid) */
.clock-analog {
    justify-self: center;
}

/* Analog Clock */
.clock-analog {
    width: 200px;
    height: 200px;
    position: relative;
    border-radius: 50%;
    background: var(--clock-face);
    border: 6px solid var(--border-color);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.1), 0 10px 20px rgba(0, 0, 0, 0.1);
}

.clock-face {
    position: relative;
    width: 100%;
    height: 100%;
}

.clock-number {
    position: absolute;
    width: 40px;
    /* Increased to fit larger numbers like 12 */
    height: 40px;
    text-align: center;
    line-height: 40px;
    /* Centered vertically */
    color: var(--text-main);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    transform-origin: center;
    /* Reset transforms for base state, specific numbers will override */
    transform: translate(-50%, -50%);
}

/* Positioning Numbers - Using % from center for better layouts */
/* 12 - Top Center */
.num-12 {
    top: 10%;
    left: 50%;
    width: 50px;
    font-size: 1.5rem;
    color: var(--accent-color);
    text-shadow: 0 0 5px var(--accent-glow);
}

/* 3 - Right Center */
.num-3 {
    top: 50%;
    left: 90%;
    font-size: 1.2rem;
}

/* 6 - Bottom Center */
.num-6 {
    top: 90%;
    left: 50%;
    font-size: 1.2rem;
}

/* 9 - Left Center */
.num-9 {
    top: 50%;
    left: 10%;
    font-size: 1.2rem;
}

/* Off-axis: Approx positions for circular look (Radius ~80%) */
.num-1 {
    top: 16%;
    left: 70%;
}

.num-2 {
    top: 30%;
    left: 84%;
}

.num-4 {
    top: 70%;
    left: 84%;
}

.num-5 {
    top: 84%;
    left: 70%;
}

.num-7 {
    top: 84%;
    left: 30%;
}

.num-8 {
    top: 70%;
    left: 16%;
}

.num-10 {
    top: 30%;
    left: 16%;
}

.num-11 {
    top: 16%;
    left: 30%;
}

.hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    background: var(--clock-hand);
    transform-origin: bottom center;
    border-radius: 4px;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.hour-hand {
    width: 5px;
    height: 25%;
    margin-left: -2.5px;
}

.min-hand {
    width: 3px;
    height: 35%;
    margin-left: -1.5px;
    opacity: 0.8;
}

.second-hand {
    width: 2px;
    height: 42%;
    margin-left: -1px;
    background: var(--clock-sec);
    z-index: 11;
}

.center-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background: var(--clock-sec);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 12;
}

/* Map Labels */
.city-label-div {
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px #000;
    cursor: pointer;
    transition: all 0.2s;
    pointer-events: auto !important;
    /* Ensure clickable */
}

.city-label-div:hover {
    color: var(--accent-color);
    font-size: 14px;
    z-index: 1000 !important;
    text-shadow: 0 0 10px var(--accent-glow);
}

/* Digital Clock */
.clock-digital {
    text-align: right;
    min-width: 200px;
}

.time-display {
    font-family: var(--font-mono);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.date-display {
    font-size: 1.2rem;
    margin-top: 5px;
    color: var(--text-muted);
}

.utc-display {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-left: 0.5rem;
    opacity: 0.7;
}

.timezone-display {
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* FOOTER */
.main-footer {
    margin-top: auto;
    text-align: center;
    padding: 2rem;
    background: var(--panel-bg);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* VIEW SWITCHER */
.view-switcher {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: var(--panel-bg);
    padding: 0;
    border-radius: 6px;
    /* Smaller radius */
    display: flex;
    gap: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.view-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    /* Was 1.2rem */
    padding: 5px 8px;
    /* Was 10px 14px */
    border-radius: 0;
    transition: background 0.2s;
    line-height: 1;
    /* Tighten height */
}

.view-btn:hover {
    background: rgba(128, 128, 128, 0.1);
}

.view-btn.active {
    background: var(--accent-color);
    color: #fff;
}

/* APP WRAPPER MODES */
#app-wrapper {
    width: 100%;
    margin: 0 auto;
    transition: width 0.3s, box-shadow 0.3s, margin 0.3s;
    background: var(--bg-body);
}

/* Simulated Mobile View */
#app-wrapper.view-mobile {
    max-width: 400px;
    margin-top: 20px;
    margin-bottom: 20px;
    border: 8px solid #333;
    border-radius: 20px;
    box-shadow: 0 0 0 2px #555, 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    height: 800px;
    /* Fixed height for simulation */
    overflow-y: auto;
}

/* RESPONSIVE & MOBILE RULES */
@media (max-width: 768px),
(pointer: coarse) {
    .main-header h1 {
        font-size: 2rem;
    }

    .clocks-container {
        flex-direction: column;
        gap: 1rem;
        align-items: start;
    }

    .info-panel {
        flex-direction: column;
        align-items: start;
    }

    .clock-digital {
        text-align: left;
    }

    .map-section,
    .info-panel,
    .content-grid {
        width: 96% !important;
        height: auto;
        min-height: 300px;
    }

    .map-section {
        height: 50vh;
    }
}

#app-wrapper.view-mobile .main-header h1 {
    font-size: 1.8rem;
}

#app-wrapper.view-mobile .map-section {
    width: 94% !important;
    margin: 1rem auto !important;
}

#app-wrapper.view-mobile .info-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 94% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center;
    gap: 1.5rem;
}

#app-wrapper.view-mobile .clock-analog {
    order: 2;
    /* Center-ish in mobile vertical stack */
}

#app-wrapper.view-mobile .city-details {
    order: 1;
    text-align: center;
    width: 100%;
}

#app-wrapper.view-mobile .clock-digital {
    order: 3;
    text-align: center;
    width: 100%;
}

#app-wrapper.view-mobile .content-grid {
    width: 94% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0;
}

#app-wrapper.view-mobile .time-display {
    font-size: 2.5rem;
    /* Scaled down for mobile */
}

#app-wrapper.view-mobile .map-section {
    height: 400px;
}

#app-wrapper.view-mobile .city-details h2 {
    font-size: 2.2rem;
}

/* 11. Loading Animations */
.loading-dots::after {
    display: inline-block;
    content: '.';
    width: 1.5em;
    text-align: left;
    animation: loading-dots-sequence 1.5s steps(4, end) infinite;
}

@keyframes loading-dots-sequence {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }

    100% {
        content: '';
    }
}

.placeholder-text {
    opacity: 0.8;
    font-style: italic;
    color: var(--text-muted);
}

/* 12. Refresh Button */
.refresh-btn {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    appearance: none;
    -webkit-appearance: none;
    color: var(--accent-color);
    cursor: pointer;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.refresh-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.refresh-btn:active {
    transform: scale(0.9);
}

.refresh-btn.spinning {
    opacity: 1;
}

.refresh-btn.spinning svg {
    animation: spin-refresh 1s linear infinite;
}

@keyframes spin-refresh {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 13. Retro Radio Section */
.radio-section {
    width: calc(100% - 4in);
    max-width: 1600px;
    margin: 2rem auto 6rem auto;
    padding: 0;
}

.radio-panel {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    border: 4px solid #333;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow:
        inset 0 2px 10px rgba(255, 255, 255, 0.1),
        0 15px 35px rgba(0, 0, 0, 0.5),
        0 0 0 1px #000;
    position: relative;
    overflow: hidden;
}

/* Brushed Metal Effect */
.radio-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(rgba(255, 255, 255, 0.03) 0, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 2px);
    pointer-events: none;
}

.radio-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* LCD Display */
.radio-display {
    background: #000;
    border: 3px solid #111;
    border-radius: 8px;
    height: 120px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 1);
    display: flex;
    padding: 1rem;
}

.lcd-backlight {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--accent-color);
    opacity: 0.15;
    pointer-events: none;
}

/* Theme-specific Backlights */
[data-theme="theme-1"] .lcd-backlight {
    background: #ffaa00;
    opacity: 0.2;
}

[data-theme="theme-2"] .lcd-backlight {
    background: #ff00ff;
    opacity: 0.15;
}

[data-theme="theme-3"] .lcd-backlight {
    background: #00f3ff;
    opacity: 0.25;
}

[data-theme="theme-4"] .lcd-backlight {
    background: #00ff00;
    opacity: 0.15;
}

[data-theme="theme-5"] .lcd-backlight {
    background: #ffffff;
    opacity: 0.1;
}

.lcd-content {
    flex: 1;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
}

.lcd-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 700;
    letter-spacing: 2px;
}

.lcd-main {
    display: flex;
    align-items: baseline;
    gap: 2rem;
}

.radio-freq {
    font-size: 3rem;
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-glow);
    font-weight: 700;
    min-width: 140px;
    line-height: 1;
}

.ticker-container {
    flex: 1;
    overflow: hidden;
    height: 1.5rem;
    position: relative;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    padding-left: 1rem;
}

.ticker-text {
    white-space: nowrap;
    position: absolute;
    color: var(--accent-color);
    opacity: 0.8;
    font-size: 1rem;
    animation: ticker-move 15s linear infinite;
}

@keyframes ticker-move {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Controls */
.radio-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #333;
    gap: 2rem;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.control-panel {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.control-panel.center {
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid #333;
    border-right: 1px solid #333;
    padding: 0 3rem;
    min-width: 320px;
}

.transport-controls {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-top: 1.5rem;
}

.dial-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.dial-container label {
    font-size: 0.7rem;
    color: #888;
    font-weight: 700;
    letter-spacing: 1px;
}

.retro-dial {
    width: 90px;
    height: 90px;
    /* Dimensional Beveled Look with distinct top face */
    background:
        radial-gradient(circle at center,
            #333 0%,
            #1a1a1a 44%,
            #000 45%,
            #111 50%);
    border-radius: 50%;
    border: 3px solid #090909;
    position: relative;
    cursor: pointer;
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.8),
        inset 0 2px 5px rgba(255, 255, 255, 0.1);
    transition: transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dial-grooves {
    position: absolute;
    inset: 0px;
    border-radius: 50%;
    /* Pattern shifted by 7.5deg so a peak sits exactly at 12 o'clock */
    background: repeating-conic-gradient(from -7.5deg,
            #000 0deg 4deg,
            #777 7.5deg,
            #000 11deg 15deg);
    /* Pattern moved to the absolute boundary (46% to 50%) */
    -webkit-mask: radial-gradient(circle, transparent 45%, black 46%, black 50%);
    mask: radial-gradient(circle, transparent 45%, black 46%, black 50%);
    pointer-events: all;
    z-index: 2;
}

.dial-knob {
    /* Large Bright Marker Groove at the Outer Rim (Extended Length) */
    position: absolute;
    width: 6px;
    height: 30px;
    background: var(--accent-color);
    left: 50%;
    top: 0px;
    /* Moved to the absolute edge */
    transform: translateX(-50%);
    border-radius: 4px;
    box-shadow:
        0 0 15px var(--accent-glow),
        0 0 25px rgba(var(--accent-rgb), 0.4);
    z-index: 5;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

.retro-btn {
    background: linear-gradient(to bottom, #444, #222);
    border: 1px solid #111;
    border-radius: 4px;
    color: #e0e0e0;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 0 #111;
    transition: transform 0.1s, box-shadow 0.1s;
}

.retro-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #111;
}

.retro-btn.play {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #555, #333);
}

.retro-btn svg {
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}

.retro-btn.auto-scan,
.retro-btn.lock-city {
    width: auto;
    padding: 0 1rem;
    height: 42px;
    /* Thicker buttons */
    gap: 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #888;
    background: linear-gradient(to bottom, #3a3a3a, #222);
}

.retro-btn.lock-city {
    margin-top: 1.5rem;
    /* Align with dial centers (skipping label height) */
}

.retro-btn.auto-scan .scan-label,
.retro-btn.lock-city .lock-label {
    letter-spacing: 1px;
}

.scan-led,
.lock-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid #000;
    box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.5);
    transition: background 0.2s, box-shadow 0.2s;
}

.scan-led,
.lock-led {
    background: #400;
    /* Deep red when off */
}

.retro-btn.auto-scan.scanning .scan-led,
.retro-btn.lock-city.locked .lock-led {
    background: #f00;
    box-shadow: 0 0 8px #f00, 0 0 12px rgba(255, 0, 0, 0.5);
}

@keyframes led-blink {
    from {
        opacity: 0.4;
    }

    to {
        opacity: 1;
    }
}

.hidden {
    display: none;
}

/* Mobile Responsive Radio */
@media (max-width: 768px) {
    .radio-section {
        width: 96% !important;
    }

    .radio-panel {
        padding: 1.5rem;
    }

    .radio-controls {
        flex-direction: column;
        gap: 2rem;
    }

    .dial-group {
        width: 100%;
        justify-content: space-around;
        gap: 1rem;
    }
}