/* =========================================================
   1. FONTS & ROOT VARIABLES
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700&display=swap');

:root {
    --color-main: #8DE19C;
    --color-main-hover: #A3F5B1;
    --color-1: #44584b;
    --color-2: #202b27;
    --color-3: #25272e;
    --color-bg: #202228;
    --color-red: #ff4242;
    --color-red-hover: #ff5c5c;
}

/* =========================================================
   2. BASE & RESETS
   ========================================================= */
*, 
*::before, 
*::after {
    box-sizing: border-box;
    font-family: 'Titillium Web', sans-serif;
}

html, body {
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background-color: #1a1c21;
    color: white;
}

a {
    text-decoration: none;
}

/* Hide Spinners on Number Inputs */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

/* =========================================================
   3. UTILITIES & SHARED CLASSES
   ========================================================= */
.glass { 
    background: rgba(32, 34, 40, 0.85); 
    backdrop-filter: blur(16px); 
    border: 1px solid rgba(77, 182, 145, 0.2); 
}

.mb-8 { 
    margin-bottom: 2rem; 
}

.grid-2 { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 0.75rem; 
}

.grid-5 { 
    display: grid; 
    grid-template-columns: repeat(5, 1fr); 
    gap: 0.75rem; 
    align-items: stretch; 
}

.col-span-2 { 
    grid-column: span 2 / span 2; 
}

.col-span-1 { 
    grid-column: span 1 / span 1; 
}

/* =========================================================
   4. TYPOGRAPHY & GLOBAL ICONS
   ========================================================= */
.nav-text {
    display: none !important; /* Hidden globally to favor icons */
}

.nav-icon {
    display: block !important;
    width: 22px;
    height: 22px;
}

.mobile-only-icon {
    display: none; /* Only visible on mobile devices */
}

/* =========================================================
   5. BUTTONS
   ========================================================= */
.btn {
    padding: 0.625rem 1.5rem;
    border-radius: 1rem;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--color-main);
    color: var(--color-bg);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover { 
    background-color: var(--color-main-hover); 
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-main);
    color: white;
}

.btn-outline:hover { 
    border-color: #888; 
}

.btn-submit {
    width: 100%;
    padding: 1.25rem;
    background-color: var(--color-main);
    color: black;
    border-radius: 1rem;
    font-weight: 900;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: 0.3s;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-submit:hover { 
    background-color: var(--color-main-hover); 
}

.btn-reset {
    width: 100%;
    padding: 1rem 0 0 0;
    font-size: 10px;
    font-weight: bold;
    color: #888;
    text-transform: uppercase;
    background: none;
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

.btn-reset:hover { 
    color: var(--color-main-hover); 
}

.btn-action {
    padding: 0.625rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: 0.3s;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-action svg { 
    width: 1rem; 
    height: 1rem; 
}

.btn-edit { 
    background-color: var(--color-main); 
    color: black; 
}

.btn-edit:hover { 
    background-color: var(--color-main-hover); 
}

.btn-delete { 
    background-color: var(--color-red); 
    color: white; 
}

.btn-delete:hover { 
    background-color: var(--color-red-hover); 
    color: white; 
}

.btn-icon-outline {
    background-color: rgba(77, 182, 145, 0.1);
    color: var(--color-main);
    border: 1px solid rgba(77, 182, 145, 0.3);
    padding: 1.25rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    cursor: pointer;
    box-sizing: border-box;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-icon-outline:hover { 
    background-color: var(--color-main); 
    color: black; 
}

.btn-icon-outline svg { 
    width: 1.5rem; 
    height: 1.5rem; 
}

/* =========================================================
   6. MAP & LEAFLET OVERRIDES
   ========================================================= */
#map { 
    position: absolute; 
    inset: 0; 
    z-index: 1; 
    background: #000; 
}

.picking-mode #map { 
    cursor: crosshair !important; 
}

.leaflet-popup-content-wrapper { 
    background: var(--color-bg) !important; 
    backdrop-filter: blur(12px); 
    color: white !important; 
    border: 1px solid var(--color-main); 
    border-radius: 1.5rem !important; 
    padding: 0 !important; 
    overflow: hidden; 
    width: 320px !important; 
}

.leaflet-popup-tip { 
    background: var(--color-bg) !important; 
}

.leaflet-popup-content { 
    margin: 0 !important; 
    width: 320px !important; 
}

.popup-content { 
    padding: 1.5rem; 
    text-align: left; 
}

.popup-title { 
    font-size: 1.2em; 
    font-weight: bold; 
    text-transform: uppercase; 
    letter-spacing: -0.05em; 
    color: white; 
    margin-bottom: 0.25rem; 
    line-height: 1.2; 
}

.popup-distance { 
    margin-top: 0.5rem; 
    display: inline-block; 
    padding: 0.25rem 0.5rem; 
    background-color: rgba(255, 255, 255, 0.05); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    color: var(--color-main); 
    border-radius: 0.25rem; 
    font-weight: bold; 
    font-style: italic; 
    font-family: monospace; 
    font-size: 9px; 
    letter-spacing: 0.1em; 
    text-transform: uppercase; 
}

.tx-icon-png { 
    width: 32px; 
    height: 32px; 
    background: url('/img_assets/tx.png') no-repeat center;
    background-size: contain; 
    transition: all 0.3s ease;
}

.tx-active .tx-icon-png { 
    background: url('/img_assets/tx-selected.png') no-repeat center;
    background-size: contain; 
}

.antenna-marker { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background: rgba(255, 255, 255, 0.2); 
    border: 2px solid white; 
    border-radius: 50%; 
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.6); 
    cursor: grab; 
}

/* Floating Cancel Picking Button */
.btn-cancel-picking {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(8px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 24px;
    border-radius: 50px;
    z-index: 9999;
    display: none; /* Shown via JS class */
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-picking:hover { 
    background: var(--color-red-hover); 
    border-color: var(--color-red-hover); 
}

body.picking-mode .btn-cancel-picking { 
    display: flex; 
}

/* =========================================================
   7. MAIN NAVIGATION
   ========================================================= */
.main-nav {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.logo-container { 
    display: flex; 
}

.nav-logo { 
    height: 2.5rem; 
    width: auto; 
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Nav Icon Buttons Constraint */
.nav-actions .btn {
    padding: 10px !important;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px; 
}

.nav-actions .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    color: #888;
    text-decoration: none;
    transition: color 0.3s;
    cursor: pointer;
}

.nav-actions .nav-link:hover { 
    color: var(--color-main); 
}

.logout-icon {
    padding-right: 0 !important;
}

/* =========================================================
   8. FILTER PANEL (UNIVERSAL COLLAPSIBLE)
   ========================================================= */
.filter-panel {
    position: fixed;
    top: 8rem;
    left: 1.5rem;
    z-index: 1900;
    width: 20rem;
    padding: 1.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: left;
    box-sizing: border-box;
    transition: padding 0.3s ease; 
}

.panel-title {
    font-size: 10px;
    font-weight: bold;
    color: var(--color-main);
    text-transform: uppercase;
    letter-spacing: 0.4em;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.hopp-heading {
    color: #8DE19C;            /* Your project's HoppGreen */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 2rem;           /* Matches headlineMedium scale */
    font-weight: 700;          /* FontWeight.Bold */
    letter-spacing: -0.03em;   /* Replicates -0.5sp letter spacing */
    margin: 0;
}

.hopp-heading2 {
    color: #bdbdbd;            /* Your project's HoppGreen */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 1rem;           /* Matches headlineMedium scale */
    font-weight: 700;          /* FontWeight.Bold */
    letter-spacing: -0.03em;   /* Replicates -0.5sp letter spacing */
    margin-left: 0.5rem;
}

#filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0;
    margin-bottom: 1.5rem;
    transition: margin-bottom 0.3s ease;
}

/* Logic for when the header is collapsed */
#filter-header.is-collapsed {
    margin-bottom: 0;
}

/* The base state of the icon (when panel is EXPANDED) */
.filter-toggle-icon {
    transition: transform 0.3s ease;
    transform: rotate(0deg);
}

/* When the header has 'is-collapsed', rotate the icon inside it (to point DOWN/UP) */
#filter-header.is-collapsed .filter-toggle-icon {
    transform: rotate(180deg);
}

#filter-content {
    max-height: 800px; 
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

/* The Collapsed State */
#filter-content.is-collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-input { 
    width: 100%;
    font-family: 'Titillium Web', sans-serif; 
    background: rgba(0,0,0,0.3); 
    border: 1px solid rgba(77, 182, 145, 0.2); 
    padding: 0.75rem; 
    border-radius: 0.75rem;
    font-size: 11px; 
    color: white; 
    outline: none; 
    transition: 0.3s; 
    box-sizing: border-box;
}

.filter-input:focus { 
    border-color: var(--color-main); 
}

/* =========================================================
   9. LAYER BOX
   ========================================================= */
.layer-box {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 2000;
    display: flex;
    padding: 0.25rem;
    background-color: var(--color-bg);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    gap: 0.3rem;
}

.btn-layer {
    padding: 0.75rem 1.5rem;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: 0.3s;
    background: transparent;
    color: #64748b;
}

.btn-layer.active { 
    background-color: rgba(255, 255, 255, 0.1); 
    color: var(--color-main); 
}

.btn-layer:hover:not(.active) { 
    color: #64748b; 
    background-color: var(--color-1); 
}

/* =========================================================
   10. SIDEBAR
   ========================================================= */
#sidebar { 
    position: fixed; 
    top: 0; 
    right: 0; 
    bottom: 0; 
    width: 25rem; 
    z-index: 4000; 
    transform: translateX(100%); 
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    background: var(--color-1); 
    border-left: 1px solid rgba(255, 255, 255, 0.05); 
    display: flex;
    flex-direction: column;
    text-align: left;
}

#sidebar.open { 
    transform: translateX(0); 
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background-color: var(--color-bg);
}

.sidebar-title {
    font-weight: bold;
    color: var(--color-main);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    margin: 0;
}

.btn-close, 
.btn-modal-close, 
.viewer-close {
    color: #888;
    transition: 0.3s;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.btn-close { 
    font-size: 2.25rem; 
    font-weight: 300; 
    line-height: 1; 
    color: white; 
}

.btn-modal-close { 
    margin-left: auto; 
    display: flex; 
}

.btn-close:hover, 
.btn-modal-close:hover, 
.viewer-close:hover { 
    color: var(--color-red); 
}

#sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg);
}

#sidebar-content::-webkit-scrollbar { 
    width: 4px; 
}

#sidebar-content::-webkit-scrollbar-thumb { 
    background: var(--color-2); 
    border-radius: 10px; 
}

/* Sidebar Internal Components */
.tx-header-wrap { 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    margin-bottom: 2rem;
}

.tx-title { 
    font-size: 2rem; 
    font-weight: bold; 
    text-transform: uppercase; 
    letter-spacing: -0.05em; 
    line-height: 1; 
    color: white; 
    text-align: left; 
    word-break: break-word; 
    margin: 0; 
}

.draggable-station[draggable="true"] {
    cursor: grab;
    user-select: none;
}

.draggable-station[draggable="true"]:active {
    cursor: grabbing;
}

.tx-actions { 
    display: flex; 
    gap: 0.5rem; 
    flex-shrink: 0; 
    padding-top: 0.25rem; 
}

.tx-meta { 
    font-family: monospace; 
    font-size: 11px; 
    font-weight: bold; 
    margin-bottom: 2.5rem; 
    margin-top: 0.75rem; 
    letter-spacing: 0.2em; 
    text-transform: uppercase; 
    opacity: 0.7; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 0.5rem; 
    align-items: center; 
}

#choiceLinkExisting:hover, #choiceCreateNew:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--accent-primary, #3b82f6) !important;
    transform: translateY(-2px);
}

.tx-coord-link { 
    padding: 0.25rem 0.5rem; 
    background-color: rgba(255, 255, 255, 0.05); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    color: var(--color-main); 
    border-radius: 0.25rem; 
    transition: 0.3s; 
    text-decoration: none; 
}

.tx-coord-link:hover { 
    background-color: var(--color-main); 
    color: black; 
}

.tx-dist-badge { 
    padding: 0.25rem 0.5rem; 
    background-color: rgba(255, 255, 255, 0.05); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    color: var(--color-main); 
    border-radius: 0.25rem; 
}

/* Sidebar Carousel */
.carousel-container { 
    position: relative; 
    width: 100%; 
    height: 20rem; 
    border-radius: 1.5rem; 
    overflow: hidden; 
    border: 1px solid rgba(77, 182, 145, 0.1); 
    margin-bottom: 1.5rem; 
}

.carousel-slide { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    cursor: zoom-in; 
    transition: opacity 0.3s; 
}

.carousel-container.group .btn-action { 
    position: absolute; 
    top: 1rem; 
    right: 1rem; 
    z-index: 110; 
    opacity: 0; 
    transition: opacity 0.3s; 
}

.carousel-container.group:hover .btn-action { 
    opacity: 1; 
}

.nav-btn { 
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    background: rgba(0, 0, 0, 0.7); 
    color: white; 
    border: none; 
    cursor: pointer; 
    z-index: 100; 
    width: 44px; 
    height: 44px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 20px; 
    transition: 0.2s; 
}

.nav-btn:hover { 
    background: var(--color-main-hover); 
}

.btn-prev { 
    left: 20px; 
}

.btn-next { 
    right: 20px; 
}

/* Sidebar Stations */
.btn-add-card { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 100%; 
    min-height: 80px; 
    background-color: transparent; 
    border: 2px dashed rgba(255, 255, 255, 0.1); 
    border-radius: 1.5rem; 
    cursor: pointer; 
    transition: 0.3s; 
    font-weight: bold; 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    letter-spacing: 0.1em; 
    color: #888; 
    margin-bottom: 2.5rem; 
    text-decoration: none; 
    box-sizing: border-box; 
}

.btn-add-card:hover { 
    background-color: rgba(255, 255, 255, 0.05); 
    color: var(--color-main); 
}

.btn-add-card.lg { 
    margin-bottom: 0; 
}

.stations-header { 
    display: flex; 
    align-items: center; 
    gap: 1rem; 
    margin-bottom: 0.5rem;
}

.stations-title { 
    font-size: 11px; 
    font-weight: bold; 
    text-transform: uppercase; 
    letter-spacing: 0.4em; 
    color: #888; 
    margin: 0; 
}

.stations-line { 
    flex: 1; 
    height: 1px; 
    background-color: rgba(255, 255, 255, 0.1); 
}

.stations-list { 
    display: flex; 
    flex-direction: column; 
    gap: 1rem; 
}

.station-card { 
    background-color: #2b3a35; 
    border: 1px solid rgba(255, 255, 255, 0.05); 
    border-radius: 1.5rem; 
    display: flex; 
    align-items: stretch; 
    position: relative; 
    overflow: hidden; 
    width: 100%; 
    min-height: 100px; 
    transition: 0.3s; 
    box-sizing: border-box;
    flex-wrap: wrap;
    min-height: auto !important;
}

.station-actions { 
    position: absolute; 
    top: 0.75rem; 
    right: 0.75rem; 
    display: flex; 
    gap: 0.5rem; 
    opacity: 0; 
    transition: opacity 0.3s; 
    z-index: 20; 
}

.station-card:hover .station-actions { 
    opacity: 1; 
}

.station-logo-wrap { 
    flex-shrink: 0; 
    background-color: var(--color-2); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-right: 1px solid rgba(255, 255, 255, 0.1); 
    padding: 0.75rem 0.5rem; 
    box-sizing: border-box;
    order: 1;
    width: 5rem !important;
    height: 5rem;
}

.station-logo-wrap img { 
    width: 100%; 
    height: 100%; 
    object-fit: contain;
}

.station-name-wrap { 
    flex-grow: 1; 
    display: flex; 
    align-items: center; 
    padding: 0 1.25rem; 
    min-width: 0; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    box-sizing: border-box;
    order: 2;
    width: calc(100% - 10.5rem) !important; /* Remaining space minus logo & freq */
    height: 5rem;
    padding: 0 0.75rem !important;
}

.station-name-btn { 
    font-size: 1rem; 
    font-weight: bold; 
    color: #ececec; 
    transition: 0.3s; 
    text-align: left; 
    line-height: 1.2; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    background: none; 
    border: none; 
    cursor: pointer; 
    padding: 0; 
    width: 100%; 
}

.station-pi-btn { 
    font-size: 1rem; 
    font-weight: bold; 
    color: var(--color-main); 
    transition: 0.3s; 
    line-height: 1.2; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    background: none; 
    border: none; 
    cursor: pointer; 
    padding: 0; 
    width: 100%; 
}

.station-name-btn:hover, .station-pi-btn:hover { 
    color: var(--color-main-hover); 
}

.station-pi { 
    flex-shrink: 0; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-right: 1px solid rgba(255, 255, 255, 0.1); 
    background-color: var(--color-2); 
    font-family: monospace; 
    font-size: 0.875rem; 
    font-weight: bold; 
    color: var(--color-main); 
    text-transform: uppercase; 
    letter-spacing: -0.05em; 
    text-align: center; 
    box-sizing: border-box;
    order: 4;
    width: 50%;
    height: 2.5rem;
    background-color: transparent !important; /* Blends better on bottom row */
    border-top: 1px solid rgba(255, 255, 255, 0.1)
}

.station-details { 
    flex-shrink: 0; 
    display: flex; 
    text-align: center; 
    box-sizing: border-box;
    order: 5;
    width: 50%;
    height: 2.5rem;
    flex-direction: row !important; /* Put Pol and Power side-by-side */
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    padding: 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.station-detail-item { 
    font-weight: bold; 
    color: #ececec; 
    margin-bottom: 0.375rem; 
    line-height: 1; 
    text-align: center; 
    margin-bottom: 0;
    font-size: 0.8rem;
}

.station-detail-item:last-child { 
    margin-bottom: 0; 
}

.station-freq-wrap { 
    flex-shrink: 0; 
    flex-grow: 0; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    padding: 0; 
    background-color: rgba(0, 0, 0, 0.4); 
    box-sizing: border-box;
    order: 3;
    width: 5.5rem !important;
    height: 5rem;
}

.station-freq { 
    font-size: 1.5rem; 
    font-weight: bold; 
    color: var(--color-main); 
    line-height: 1; 
    letter-spacing: -0.05em; 
    margin: 0; 
}

.station-unit { 
    font-size: 10px; 
    font-weight: bold; 
    color: #888; 
    margin-top: 0.375rem; 
    letter-spacing: 0.1em; 
    text-align: center; 
}

.frequency-unit { 
    display: flex; 
    flex-direction: column; 
}

/* =========================================================
   11. MODALS & FORMS
   ========================================================= */
.modal { 
    display: none; 
    position: fixed; 
    inset: 0; 
    background: rgba(10, 11, 14, 0.9); 
    backdrop-filter: blur(12px); 
    z-index: 5000; 
    align-items: center; 
    justify-content: center; 
    padding: 1.5rem;
}

.modal.active { 
    display: flex; 
}

.modal-content {
    position: relative;
    background-color: var(--color-bg);
    border: 0.01rem solid var(--color-main);
    padding: 3rem;
    border-radius: 3.5rem;
    width: 100%;
    max-width: 28rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: left;
    box-sizing: border-box;
}

.modal-content.lg { 
    max-width: 32rem; 
}

.modal-content.xl { 
    max-width: 42rem; 
}

.modal-title {
    font-weight: 900;
    color: var(--color-main);
    margin-top: 0;
    margin-bottom: 2.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 1.125rem;
    text-align: center;
}

.login_register-error {
    display: none;
    color: var(--color-red);
    background: rgba(255, 66, 66, 0.1);
    margin-bottom: 1rem;
    padding: 0.5rem;
    font-size: 0.9rem;
    text-align: center;
    border-radius: 0.5rem;
    font-weight: 500;
}

/* Modal Forms */
.form { 
    display: flex; 
    flex-direction: column; 
    gap: 1.25rem; 
}

.form-input, 
.form-select, 
.form-textarea {
    width: 100%;
    background-color: var(--color-3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem;
    border-radius: 1rem;
    color: white;
    outline: none;
    box-sizing: border-box;
    transition: 0.3s;
    font-size: 1rem;
}

.form-input.text-xs, 
.form-select.text-xs, 
.form-textarea.text-xs { 
    font-size: 0.75rem; 
}

.form-input.mono { 
    font-family: monospace; 
}

.form-textarea { 
    height: 6rem; 
    resize: vertical; 
}

.form-input:focus, 
.form-select:focus, 
.form-textarea:focus { 
    border-color: var(--color-main); 
}

.form-file { 
    width: 100%; 
    font-size: 0.75rem; 
    color: #888; 
    display: block; 
}

.form-file::file-selector-button {
    background-color: rgba(77, 182, 145, 0.1);
    color: var(--color-main);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    margin-right: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.form-file::file-selector-button:hover { 
    background-color: rgba(77, 182, 145, 0.2); 
}

/* Admin Modal Specifics */
.admin-list { 
    max-height: 400px; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
    gap: 0.75rem; 
}

.admin-list::-webkit-scrollbar { 
    width: 4px; 
}

.admin-list::-webkit-scrollbar-thumb { 
    background: var(--color-2); 
    border-radius: 10px; 
}

.admin-user-row { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 1.25rem; 
    background-color: rgba(255, 255, 255, 0.05); 
    border-radius: 1rem; 
    border: 1px solid rgba(255, 255, 255, 0.05); 
    transition: 0.3s; 
}

.admin-user-row:hover { 
    background-color: rgba(255, 255, 255, 0.08); 
}

.admin-user-name { 
    color: white; 
    font-weight: bold; 
    font-size: 0.875rem; 
    margin-bottom: 0.25rem; 
}

.admin-user-id { 
    font-size: 10px; 
    color: #888; 
    text-transform: uppercase; 
    letter-spacing: 0.2em; 
}

.admin-select { 
    background-color: var(--color-1); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    color: var(--color-main); 
    font-size: 10px; 
    font-weight: bold; 
    text-transform: uppercase; 
    padding: 0.75rem; 
    border-radius: 0.75rem; 
    outline: none; 
    cursor: pointer; 
    transition: 0.3s; 
}

.admin-select:focus { 
    border-color: var(--color-main); 
}

.flex-container-vertical {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.add-station-choice-modal-span {
    padding: 1rem;
}

.add-station-choice-modal-span svg {
    margin-right: 0.5rem;
}

/* =========================================================
   12. MOBILE RESPONSIVE OVERRIDES
   ========================================================= */
@media (max-width: 768px) {
    /* 1. Add transitions to all floating elements for smooth hide/show */
    .main-nav, .filter-panel, .layer-box {
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease !important;
    }

    /* 2. Defined Hidden states (sliding out of view) */
    .main-nav.nav-hidden {
        transform: translateY(-150%) !important;
    }

    .filter-panel.nav-hidden {
        transform: translateY(-200%) !important;
        opacity: 0 !important;
    }

    .layer-box.nav-hidden {
        transform: translateY(200%) !important;
        opacity: 0 !important;
    }

    .main-nav {
        width: auto; 
        left: 1rem;
        right: 1rem;
        top: 1rem; 
    }

    .filter-panel {
        width: auto; 
        left: 1rem;
        right: 1rem;
        top: 7rem;
        padding: 1rem;
    }

    #sidebar {
        background: transparent; 
        border: none;
        box-shadow: none;
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 65vh; 
        transform: translateY(100%);
    }

    .sidebar-header {
        position: relative;
        padding: 1rem; 
        background-color: var(--color-bg);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 -8px 24px rgba(0,0,0,0.4);
    }

    #sidebar-content {
        background-color: var(--color-bg);
        padding-top: 1rem;
        padding-bottom: 5rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .layer-box {
        left: 1rem;
        bottom: 1rem;
    }
  
    .stations-list {
        order: 5;
    }
}

/* =========================================================
   LINK STATION LIST (MODAL)
   ========================================================= */
#link-station-list {
    max-height: 300px; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
    gap: 0.75rem; /* Ensures items are separate and not connected */
    margin-top: 1rem;
    padding-right: 4px;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

#link-station-list::-webkit-scrollbar {
  display: none;
}

/* Custom scrollbar matching the site UI */
#link-station-list::-webkit-scrollbar { 
    width: 4px; 
}

#link-station-list::-webkit-scrollbar-thumb { 
    background: var(--color-2); 
    border-radius: 10px; 
}

.station-row {
    background-color: var(--color-bg); /* Your solid default background */
    padding: 10px;                     /* Optional: makes it easier to click */
    transition: background-color 0.2s ease; /* Optional: smooths the hover effect */
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 1.125rem 1.5rem; 
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05); 
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ececec;
    font-weight: 600;
}

/* Hover state (only applies if it isn't already selected) */
.station-row:not(.selected):hover {
    background-color: var(--color-3);
}

/* Persistent Selected State (Stays until another is clicked) */
.station-row.selected {
    background-color: var(--color-1); /* Your persistent color */
    border-color: var(--color-main);
}