@media screen and (min-width: 1025px) {
    .nav-icons a, .nav-join, [id^="nav-"] {
        padding: 0.05rem 1rem !important;
        display: flex;
        align-items: center;
        box-sizing: border-box;
    }
    .nav-icons a svg, .nav-join svg, [id^="nav-"] svg {
        padding: 0 !important;
        margin-right: 0.5rem;
        margin-left: 0;
    }
}

/* ========================================================================= */
/* === Author Information === */
/* Created by: Enok                                                        */
/* Version: 1.0.5                                                          */
/* Website: www.esml.se                                                     */
/* ========================================================================= */

/* --- Heading Styles --- */
h2 {
    display: block;
    font-size: 1.5em;
    margin: 0.83em 0 -10px;
    font-weight: bold;
}

/* --- Responsive Adjustments for h2 on Small Screens --- */
@media screen and (max-width: 480px) {
    h2 {
        margin: 0 0 -10px !important;
    }
}

/* --- Global Link Styles (excluding .right-cta) --- */
a:not(.right-cta) {
    color: var(--pink-primary);
    text-decoration: underline;
    -webkit-transition: color 0.3s ease, text-decoration-color 0.3s ease;
    -moz-transition: color 0.3s ease, text-decoration-color 0.3s ease;
    -o-transition: color 0.3s ease, text-decoration-color 0.3s ease;
    transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

a:not(.right-cta):hover,
a:not(.right-cta):focus {
    color: rgb(255, 120, 150);
    text-decoration-color: rgb(255, 120, 150);
}

/* --- Root Variables with Fallbacks --- */
:root {
    --background: #171717;
    --foreground: rgb(238, 238, 238);
    --border: rgba(214, 226, 255, 0.08);
    --primary: rgb(130, 130, 130);
    --primary-foreground: rgb(255, 255, 255);
    --secondary: linear-gradient(180deg, rgba(120, 120, 120, 0.3), rgba(120, 120, 120, 0.1));
    --solid-header-background: #171717;
    --solid-footer-background: #171717;
    --footer-background: linear-gradient(180deg, rgba(120, 120, 120, 0.1), rgba(120, 120, 120, 0.02));
    --gray-header-footer: linear-gradient(180deg, rgba(120, 120, 120, 0.1), rgba(120, 120, 120, 0.02));
    --pink-primary: rgb(200, 80, 110);
    --pink-primary-foreground: rgb(255, 255, 255);
    --gray-primary: rgb(130, 130, 130);
    --gray-primary-foreground: rgb(255, 255, 255);
    --blue-primary: rgb(90, 140, 200);
    --blue-primary-foreground: rgb(255, 255, 255);
    --green-primary: rgb(100, 180, 130);
    --green-primary-foreground: rgb(0, 0, 0);
    --purple-primary: rgb(150, 110, 200);
    --purple-primary-foreground: rgb(255, 255, 255);
    --orange-primary: rgb(200, 130, 90);
    --orange-primary-foreground: rgb(0, 0, 0);
    --footer-primary: rgb(130, 130, 130);
    --footer-primary-foreground: rgb(255, 255, 255);
    --header-logo-size: 84.48px;
    --icon-size: 24px;
    --nav-icon-size: 44px;
    --album-cover-size: 24px;
    --text-size-h1: 2.5rem;
    --text-size-h2: 2.5rem;
    --text-size-h1-footer: 1rem;
    --text-size-p: 1.2rem;
    --text-size-metar: 0.9rem;
    --padding-base: 1rem;
    --scroll-duration: 35s; /* Increased for smoother scrolling */
}

body {
    background-color: var(--background);
    color: var(--foreground);
    font-family: 'Inter', Arial, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100vh;
    overflow-x: hidden;
}

/* === Utility Classes === */
ul li {
    margin-bottom: 10px;
}

/* === Header Styles === */
.header {
    background: var(--secondary);
    position: sticky;
    top: 0;
    z-index: 20;
    padding: var(--padding-base);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 1.5vw, 0.75rem);
}

.header-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.header-text h1 {
    font-size: clamp(1rem, 2vw, 1.8rem);
    margin: 0;
    color: rgb(238, 238, 238);
    white-space: nowrap;
}

.header-text p {
    font-size: var(--text-size-p);
    margin: 0;
    color: rgb(173, 173, 173);
    white-space: nowrap;
}

.header-logo {
    height: var(--header-logo-size);
    width: auto;
}

/* === Navigation Icons === */
.nav-icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.52rem;
    padding: 0.2rem;
}

.nav-icons a, .nav-join, [id^="nav-"] {
    background: var(--gray-header-footer);
    border: 1px solid var(--border);
    color: var(--foreground);
    flex: 1 1 auto;
    width: auto;
    max-width: 100%;
    padding: 0.05rem 0.4rem;
    white-space: nowrap;
    text-align: center;
    box-sizing: border-box;
    height: var(--nav-icon-size);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    text-decoration: none;
    transition: color 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
    font-size: 0.9rem;
}

.nav-icons a svg, .nav-join svg, [id^="nav-"] svg {
    fill: var(--foreground);
    width: 18px;
    height: 18px;
    padding: 0 0.3rem 0 0;
}

.nav-icons a:hover, .nav-icons a:focus, .nav-join:hover, .nav-join:focus, [id^="nav-"]:hover, [id^="nav-"]:focus {
    color: var(--primary);
    background: var(--gray-header-footer);
    transform: scale(1.1);
    outline: none;
}

.nav-icons a:hover svg, .nav-icons a:focus svg, [id^="nav-"]:hover svg, [id^="nav-"]:focus svg {
    fill: var(--primary);
}

.nav-join {
    background: var(--primary);
    border: 1px solid var(--primary-foreground);
    color: var(--primary-foreground);
}

.nav-join svg {
    fill: var(--primary-foreground);
}

#nav-atc {
    color: var(--pink-primary);
}

#nav-atc svg {
    fill: var(--pink-primary);
}

#nav-atc.active {
    color: var(--green-primary);
}

#nav-atc.active svg {
    fill: var(--green-primary);
}

/* === Fullscreen Button Styles === */
.player-button[aria-label="Fullscreen"] {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.05rem 0.4rem;
    height: var(--nav-icon-size);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    color: #FFF;
}

.player-button[aria-label="Fullscreen"]:hover,
.player-button[aria-label="Fullscreen"]:focus {
    background: transparent;
    transform: scale(1.1);
    outline: none;
}

.player-button[aria-label="Fullscreen"].active {
    background: transparent;
}

.player-button[aria-label="Fullscreen"].active:hover,
.player-button[aria-label="Fullscreen"].active:focus {
    background: transparent;
    transform: scale(1.1);
}

.player-button[aria-label="Fullscreen"] svg {
    fill: #FFF;
    width: 18px;
    height: 18px;
    padding: 0 0.3rem 0 0;
}

/* === Footer Styles === */
.footer {
    background: var(--footer-background);
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding: calc(var(--padding-base) * 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    align-items: center;
    gap: clamp(0.1rem, 1.5vw, 0.75rem);
}

.footer-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.footer-text h1 {
    font-size: var(--text-size-h1-footer);
    margin: 0;
    color: rgb(238, 238, 238);
    white-space: nowrap;
}

.footer-text p, .metar-info, #metar-display {
    font-size: var(--text-size-metar);
    margin: 0;
    color: rgb(173, 173, 173);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80vw;
    display: block;
}

.album-cover {
    height: 100%;
    width: auto;
    max-height: calc(var(--text-size-h1-footer) + 0.8rem + 2 * 1.2);
    object-fit: contain;
}

/* === Content Layout === */
.content {
    display: flex;
    gap: 1.5%;
    padding: 1vw 1vw 1vw;
    flex: 1;
    overflow-y: hidden;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    min-height: 0;
}

@supports not ((-webkit-backdrop-filter: blur(16px)) or (backdrop-filter: blur(16px))) {
    .content {
        background2: rgba(23, 23, 23, 0.95);
    }
}

.left-column {
    background: var(--secondary);
    border-radius: 5px;
    flex: 0 0 auto;
    min-width: 60px;
    max-width: 100px;
    opacity: 0.9;
    border: 1px solid var(--border);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 8px 0;
    box-sizing: border-box;
}

.color-square {
    width: clamp(24px, 4vw, 28px);
    height: clamp(24px, 4vw, 28px);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-square:hover {
    transform: scale(1.1);
}

#grey-square { background: rgb(130, 130, 130); }
#pink-square { background: rgb(200, 80, 110); }
#blue-square { background: rgb(90, 140, 200); }
#green-square { background: rgb(100, 180, 130); }
#purple-square { background: rgb(150, 110, 200); }
#orange-square { background: rgb(200, 130, 90); }

.middle-column {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding-right: 1.7%;
    height: 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(214, 226, 255, 0.12) rgba(30, 30, 30, 0.9);
}

.middle-column::-webkit-scrollbar {
    width: 8px;
}

.middle-column::-webkit-scrollbar-track {
    background: linear-gradient(180deg, rgba(30, 30, 30, 0.95), rgba(30, 30, 30, 0.85));
    border-radius: 4px;
}

.middle-column::-webkit-scrollbar-thumb {
    background: rgba(214, 226, 255, 0.12);
    border-radius: 4px;
}

.middle-column::-webkit-scrollbar-thumb:hover {
    background: rgba(214, 226, 255, 0.20);
}

@supports (scrollbar-width: thin) {
    .middle-column {
        scrollbar-width: thin;
        scrollbar-color: rgba(214, 226, 255, 0.12) rgba(30, 30, 30, 0.9);
    }
}

.right-column {
    background: transparent;
    border-radius: 5px;
    min-width: 350px;
    flex: 0 0 350px;
    opacity: 0.9;
    height: 100%;
    overflow: hidden;
    position: relative;
    border: none;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

@supports not ((-webkit-backdrop-filter: blur(16px)) or (backdrop-filter: blur(16px))) {
    .right-column {
        background: rgba(23, 23, 23, 0.95);
    }
}

/* === Right Column Content === */
.right-scroller {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: transparent;
    padding: 0 0 1.2rem;
    animation: infinite-scroll var(--scroll-duration) linear infinite;
    will-change: transform;
    height: auto;
}

@keyframes infinite-scroll {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%); /* Move only the height of the original content */
    }
}

.right-scroller:hover {
    animation-play-state: paused;
}

.right-scroller > .right-container {
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.right-container {
    background: var(--gray-header-footer);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.right-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
}

.right-headline {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: rgb(238, 238, 238);
}

.right-description {
    font-size: 0.9rem;
    color: rgb(173, 173, 173);
    margin-bottom: 1rem;
}

.right-cta {
    background: var(--primary);
    color: var(--primary-foreground);
    font-weight: bold;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.3s ease, background-color 0.3s ease;
    display: inline-block;
}

.right-cta:hover, .right-cta:focus {
    background: var(--primary);
    transform: scale(1);
    outline: none;
}

/* === Main Content === */
.main-content {
    position: relative;
    z-index: 10;
}

.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 0 auto;
    z-index: 10;
}

#space-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* === News and About Sections === */
.news-section, .border-section {
    background: var(--gray-header-footer);
    border-radius: 12px;
    padding: 0 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    position: relative;
    z-index: 10;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

@supports not ((-webkit-backdrop-filter: blur(16px)) or (backdrop-filter: blur(16px))) {
    .news-section, .border-section {
        background: rgba(23, 23, 23, 0.95);
    }
}

.news-section p {
    margin: 0;
    padding: 1.5rem;
    color: rgb(173, 173, 173);
    font-size: 1.1rem;
    text-align: center;
    word-break: break-word;
}

.news-item {
    background: var(--gray-header-footer);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, background-color 0.3s ease;
    cursor: pointer;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

@supports not ((-webkit-backdrop-filter: blur(16px)) or (backdrop-filter: blur(16px))) {
    .news-item {
        background: rgba(23, 23, 23, 0.95);
    }
}

.news-item:hover, .news-item:focus {
    transform: scale(1);
    background: var(--gray-header-footer);
    outline: none;
}

.border-section h1 {
    text-align: left;
    font-size: var(--text-size-h1);
    margin: 1rem 0;
}

.border-section h3 {
    font-size: var(--text-size-h3);
    margin: 0.5rem 0;
    text-align: left;
    word-wrap: break-word;
    overflow: visible;
    white-space: normal;
    line-height: 1.2;
}

.border-section p {
    text-align: left;
    word-break: break-word;
}

/* === Live ATC === */
#live-atc {
    background: var(--gray-header-footer);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border);
    text-align: center;
    margin-bottom: 2rem;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

@supports not ((-webkit-backdrop-filter: blur(16px)) or (backdrop-filter: blur(16px))) {
    #live-atc {
        background: rgba(23, 23, 23, 0.95);
    }
}

#live-atc h3 {
    font-size: var(--text-size-h3);
    margin: 0.5rem 0;
    color: rgb(238, 238, 238);
}

#live-atc p {
    font-size: var(--text-size-p);
    color: rgb(173, 173, 173);
}

#live-atc.active {
    color: var(--green-primary);
}

#live-atc.active h3,
#live-atc.active p,
#live-atc.active svg {
    color: var(--green-primary);
    fill: var(--green-primary);
}

#live-atc:not(.active) {
    color: var(--pink-primary);
}

#live-atc:not(.active) h3,
#live-atc:not(.active) p,
#live-atc:not(.active) svg {
    color: var(--pink-primary);
    fill: var(--pink-primary);
}

/* === Responsive Design === */
@media screen and (min-width: 1025px) {
    .header {
        background: var(--secondary);
        padding: clamp(0.75rem, 2.5vw, 1.5rem);
    }
    .footer {
        background: var(--footer-background);
        padding: calc(clamp(0.75rem, 2.5vw, 1.5rem) * 0.8);
    }
    .footer-text p, .metar-info, #metar-display {
        max-width: 50vw;
    }
}

@media screen and (max-width: 1024px) {
    .header {
        background: var(--solid-header-background);
    }
    .footer {
        background: var(--solid-footer-background);
    }
    .left-column, .right-column {
        display: none !important;
    }
    .content {
        flex-wrap: wrap;
        gap: 0;
        overflow-y: hidden;
    }
    .middle-column {
        flex: 1 1 100%;
        padding-right: 0;
        scrollbar-width: none;
    }
    .middle-column::-webkit-scrollbar {
        display: none;
    }
    .nav-icons {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .nav-icons a, .nav-join, [id^="nav-"] {
        flex: 1 1 auto;
        width: auto;
        max-width: 48%;
        margin-bottom: 0.5rem;
    }
    .footer-text p, .metar-info, #metar-display {
        max-width: 70vw;
    }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
    .header, .footer {
        flex-direction: row;
        background: var(--solid-header-background);
    }
    .footer {
        background: var(--solid-footer-background);
    }
    .header-content, .footer-content {
        flex-direction: row;
        justify-content: flex-start;
    }
    .header-text {
        align-items: flex-start;
    }
    .nav-icons {
        width: auto;
        justify-content: flex-start;
        flex-wrap: nowrap;
    }
    .nav-icons a, .nav-join, [id^="nav-"] {
        width: auto;
        max-width: none;
        flex: 1 1 auto;
    }
}

@media screen and (max-width: 768px) {
    .header, .footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        background: var(--solid-header-background);
    }
    .header-logo {
        height: calc(var(--header-logo-size) * 0.64);
    }
    .footer {
        background: var(--solid-footer-background);
        padding-bottom: calc(var(--padding-base) * 0.08);
    }
    .header-content, .footer-content {
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
    }
    .header-text {
        align-items: flex-start;
    }
    .nav-icons {
        width: -webkit-fill-available;
        width: -moz-available;
        width: fill-available;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .nav-icons a, .nav-join, [id^="nav-"] {
        flex: 1 1 auto;
        width: auto;
        max-width: 48%;
        padding: 0.05rem 0.4rem;
        font-size: 0.9rem;
    }
    .footer .nav-icons {
        flex-wrap: nowrap;
    }
    .footer .nav-icons a, .footer .nav-join, .footer [id^="nav-"] {
        max-width: none;
    }
    .middle-column {
        padding-inline-start: 5px;
    }
    .footer-text p, .metar-info, #metar-display {
        max-width: 80vw;
    }
}

@media screen and (max-width: 480px) {
    .news-section p, .border-section p {
        font-size: clamp(0.7rem, 1.8vw, 0.9rem);
        padding: 0.5rem;
    }
    .radio-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .right-image {
        height: 120px;
    }
    .border-section {
        padding: 1rem 1rem .5rem !important;
    }
    .border-section h3 {
        font-size: clamp(0.7rem, 1.8vw, 0.9rem);
    }
    .nav-icons a, .nav-join, [id^="nav-"] {
        padding: 0.05rem 0.3rem;
        font-size: clamp(0.6rem, 1.5vw, 0.7rem);
    }
    .nav-icons a svg, .nav-join svg, [id^="nav-"] svg, .player-button[aria-label="Fullscreen"] svg {
        width: 16px;
        height: 16px;
        padding: 0 0.2rem 0 0;
    }
    .footer-text p, .metar-info, #metar-display {
        font-size: clamp(0.5rem, 1.3vw, 0.7rem);
        max-width: 90vw;
    }
}

/* === Accessibility === */
@media (prefers-reduced-motion: reduce) {
    .nav-icons a, .nav-join, [id^="nav-"], .right-cta, .news-item, .color-square {
        transition: none;
        transform: none;
    }
    .right-scroller {
        animation: none;
    }
}

/* === Radar Page Layout === */
.radar-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.radar-header {
    padding: 20px;
    background: var(--gray-header-footer);
    color: var(--foreground);
    flex: 1;
    min-height: 25vh;
    box-sizing: border-box;
}

.radar-map {
    flex: 3;
    min-height: 75vh;
}

.radar-map iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* === IE Fallbacks for Grid === */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .radio-grid {
        display: block;
    }
    .radio-grid > * {
        float: left;
        width: 250px;
        margin: 0 1.5rem 1.5rem 0;
    }
}

/* === Fallback for older browsers without CSS variables or clamp === */
.no-cssvariables .header,
.no-cssvariables .footer,
.no-cssvariables .left-column,
.no-cssvariables .right-container,
.no-cssvariables .news-section,
.no-cssvariables .border-section,
.no-cssvariables .news-item,
.no-cssvariables #live-atc {
    background: #171717;
}
.no-cssvariables .nav-icons a,
.no-cssvariables .nav-join,
.no-cssvariables [id^="nav-"] {
    background: linear-gradient(180deg, rgba(120, 120, 120, 0.1), rgba(120, 120, 120, 0.02));
    border: 1px solid rgba(214, 226, 255, 0.08);
    color: rgb(238, 238, 238);
}
.no-cssvariables .nav-join {
    background: rgb(130, 130, 130);
    color: rgb(255, 255, 255);
}
.no-cssvariables #nav-atc {
    color: rgb(200, 80, 110);
}
.no-cssvariables #nav-atc.active {
    color: rgb(100, 180, 130);
}
.no-cssvariables .right-cta {
    background: rgb(130, 130, 130);
    color: rgb(255, 255, 255);
}
.no-cssvariables .header-logo {
    height: 84.48px;
}
.no-cssvariables .nav-icons a, .no-cssvariables .nav-join, .no-cssvariables [id^="nav-"] {
    height: 44px;
    font-size: 0.9rem;
    padding: 0.05rem 0.4rem;
}
.no-cssvariables .color-square {
    width: 28px;
    height: 28px;
}