/* ============================================================
   STATIONS HERO
============================================================ */

.stations-hero {
    padding: 52px 0;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--header),
            var(--header-light)
        );
}

.stations-hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.stations-hero h1 {
    margin: 7px 0 12px;
    color: #ffffff;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.05;
}

.stations-hero p {
    max-width: 720px;
    margin: 0;
    color: #dceff4;
    font-size: 1.05rem;
    line-height: 1.7;
}

.stations-hero .section-kicker {
    color: #c8edf5;
}

.stations-hero-actions {
    flex: 0 0 auto;
}

/* ============================================================
   PAGE CONTENT
============================================================ */

.stations-content {
    padding-top: 36px;
    padding-bottom: 70px;
}

/* ============================================================
   ALERTS
============================================================ */

.site-alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 24px;
    padding: 14px 16px;
    border: 1px solid;
    border-radius: 4px;
    line-height: 1.5;
}

.site-alert-success {
    border-color: #4c765d;
    color: #9bd4b0;
    background: var(--surface-muted);
}

.site-alert-error {
    border-color: #7b4848;
    color: #e59a9a;
    background: var(--surface-muted);
}

/* ============================================================
   SELECTED STATION
============================================================ */

.selected-station-panel {
    margin-bottom: 28px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface-muted);
}

.selected-station-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.selected-station-heading h2 {
    margin: 4px 0 0;
    color: var(--text);
    font-size: 1.35rem;
}

.selected-station {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
}

.selected-station-logo {
    display: flex;
    flex: 0 0 58px;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    overflow: hidden;
    border-radius: 4px;
    color: #ffffff;
    background: var(--header-light);
    font-size: 1.4rem;
}

.selected-station-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selected-station-details {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.selected-station-details strong {
    overflow: hidden;
    color: var(--text);
    font-size: 1.05rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-station-details span {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.selected-station-empty {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px;
    border: 1px dashed var(--border-dark);
    border-radius: 4px;
    color: var(--text-muted);
    background: var(--surface);
}

.selected-station-empty > i {
    color: var(--header-light);
    font-size: 1.7rem;
}

.selected-station-empty strong {
    display: block;
    color: var(--text);
}

.selected-station-empty p {
    margin: 4px 0 0;
}

/* ============================================================
   FILTER TOOLBAR
============================================================ */

.stations-toolbar {
    margin-bottom: 30px;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
}

.stations-filter-form {
    display: grid;
    grid-template-columns:
        minmax(220px, 1fr)
        minmax(150px, 200px)
        minmax(150px, 200px)
        auto
        auto;
    gap: 12px;
}

.stations-search-field,
.stations-select-field {
    position: relative;
}

.stations-search-field i {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 1;
    color: var(--text-muted);
    transform: translateY(-50%);
}

.stations-search-field input,
.stations-select-field select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    color: var(--text);
    background: var(--surface);
    font: inherit;
}

.stations-search-field input::placeholder {
    color: var(--text-muted);
}

.stations-search-field input {
    padding: 9px 13px 9px 40px;
}

.stations-select-field select {
    padding: 9px 35px 9px 12px;
}

.stations-search-field input:focus,
.stations-select-field select:focus {
    outline: 2px solid rgba(7, 120, 151, 0.22);
    border-color: var(--header-light);
}

/* ============================================================
   RESULTS HEADING
============================================================ */

.stations-results-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.stations-results-heading h2 {
    margin: 5px 0 0;
    color: var(--text);
    font-size: 1.65rem;
}

.stations-results-heading p {
    margin: 0;
    color: var(--text-muted);
}

/* ============================================================
   STATION GRID
============================================================ */

.stations-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.station-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 19px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    transition:
        border-color 0.2s ease,
        transform 0.2s ease,
        background 0.2s ease;
}

.station-card:hover {
    border-color: var(--header-light);
    background: var(--surface-muted);
    transform: translateY(-2px);
}

.station-card.is-selected {
    border-color: var(--header-light);
    box-shadow:
        inset 0 3px 0 var(--header-light);
}

.station-card-top {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.station-logo {
    display: flex;
    flex: 0 0 66px;
    align-items: center;
    justify-content: center;
    width: 66px;
    height: 66px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--header-light),
            var(--header)
        );
    font-size: 1.45rem;
}

.station-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.station-card-title {
    flex: 1 1 auto;
    min-width: 0;
}

.station-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.station-name-row h3 {
    width: 100%;
    margin: 0 0 3px;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 1.05rem;
    line-height: 1.3;
}

.station-featured,
.station-selected-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
}

.station-featured {
    color: #d6b963;
    background: rgba(241, 196, 15, 0.12);
}

.station-selected-badge {
    color: #8bd1a5;
    background: rgba(96, 186, 43, 0.12);
}

.station-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 12px;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.station-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.station-description {
    display: -webkit-box;
    min-height: 78px;
    margin: 17px 0 12px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
    white-space: pre-line;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.station-stat {
    margin-top: auto;
    padding-top: 4px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.station-stat i {
    margin-right: 5px;
}

/* ============================================================
   STATION ACTIONS
============================================================ */

.station-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.station-card-actions form {
    margin: 0;
}

.station-preview-button,
.station-website-button,
.station-select-button,
.station-current-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 37px;
    padding: 8px 11px;
    border-radius: 3px;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
}

.station-preview-button {
    border: 1px solid var(--header-light);
    color: var(--header-light);
    background: var(--surface);
    cursor: pointer;
}

.station-preview-button:hover {
    color: #ffffff;
    background: var(--header-light);
}

.station-website-button {
    border: 1px solid var(--border-dark);
    color: var(--text);
    background: var(--surface);
}

.station-website-button:hover {
    border-color: var(--header-light);
    color: var(--header-light);
}

.station-select-button {
    border: 1px solid var(--header-light);
    color: #ffffff;
    background: var(--header-light);
    cursor: pointer;
}

.station-select-button:hover {
    background: var(--header);
}

.station-current-button {
    border: 1px solid #4c765d;
    color: #8bd1a5;
    background: var(--surface-muted);
}

/* ============================================================
   EMPTY STATE
============================================================ */

.stations-empty {
    padding: 55px 20px;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-align: center;
    background: var(--surface);
}

.stations-empty > i {
    color: var(--text-muted);
    font-size: 2.4rem;
}

.stations-empty h2 {
    margin: 15px 0 7px;
    color: var(--text);
}

.stations-empty p {
    margin: 0 0 20px;
    color: var(--text-muted);
}

/* ============================================================
   PREVIEW BAR
============================================================ */

.station-preview-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    border-top: 1px solid var(--border-dark);
    background: var(--surface);
    box-shadow:
        0 -5px 18px rgb(0 0 0 / 20%);
}

.station-preview-bar[hidden] {
    display: none;
}

.station-preview-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    min-height: 68px;
}

.station-preview-information {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.station-preview-information > i {
    color: var(--header-light);
    font-size: 1.4rem;
}

.station-preview-information div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.station-preview-information span {
    color: var(--text-muted);
    font-size: 0.73rem;
}

.station-preview-information strong {
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.station-preview-controls {
    display: flex;
    align-items: center;
    gap: 11px;
}

.station-preview-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    background: var(--header-light);
    cursor: pointer;
}

.station-preview-controls input {
    width: 130px;
}

/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 1050px) {
    .stations-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .stations-filter-form {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .stations-hero {
        padding: 38px 0;
    }

    .stations-hero-content,
    .selected-station-heading,
    .stations-results-heading,
    .station-preview-inner {
        align-items: stretch;
        flex-direction: column;
    }

    .stations-filter-form,
    .stations-grid {
        grid-template-columns: 1fr;
    }

    .selected-station {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .selected-station .station-preview-button {
        width: 100%;
    }

    .station-card-actions > *,
    .station-card-actions form,
    .station-card-actions form button {
        width: 100%;
    }

    .station-preview-inner {
        gap: 10px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .station-preview-controls {
        width: 100%;
    }

    .station-preview-controls input {
        flex: 1 1 auto;
        width: auto;
    }
}