/**
 * Radio Page Styles
 * All classes prefixed with radio- to avoid conflicts with base.css
 */

/* ── Hero / Brand Banner ── */
.radio-hero {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.radio-hero-glow {
    position: absolute;
    border-radius: 999px;
    filter: blur(64px);
    opacity: 0.2;
}

.radio-hero-glow-left {
    left: -4rem;
    top: -4rem;
    width: 13rem;
    height: 13rem;
    background: rgba(255, 255, 255, 0.8);
}

.radio-hero-glow-right {
    right: -4rem;
    bottom: -4rem;
    width: 14rem;
    height: 14rem;
    background: rgba(240, 147, 251, 0.8);
}

.radio-hero-inner {
    position: relative;
    padding: 1rem 0;
    width: min(1120px, 100% - 1.5rem);
    margin: 0 auto;
}

.radio-brand-box {
    max-width: 56rem;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.14);
    border-radius: 1rem;
    padding: 0.75rem;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.radio-logo {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.03em;
    font-size: 1.1rem;
}

.radio-brand-title {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.25;
    color: #ffffff;
}

.radio-brand-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    opacity: 0.9;
    color: #ffffff;
}

/* ── Search Panel ── */
.radio-search-panel {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 0;
}

.radio-search-form {
    max-width: 56rem;
    margin: 0 auto;
    padding: 1rem 0.75rem;
    display: grid;
    gap: 0.75rem;
}



.radio-field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.radio-field {
    position: relative;
    flex: 1 1 220px;
    min-width: 140px;
}

.radio-field-lg {
    width: 100%;
}

.radio-field input {
    width: 100%;
    border: 2px solid #dddddd;
    border-radius: 0.5rem;
    background: #f5f5f5;
    color: #333333;
    outline: none;
    padding: 0.65rem 0.85rem 0.65rem 2.45rem;
    transition: border-color 0.15s ease;
    font-size: 1rem;
    font-family: inherit;
}

.radio-field input:focus {
    border-color: #667eea;
}

.radio-field-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    width: 1rem;
    height: 1rem;
    pointer-events: none;
}

.radio-field-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.radio-field-lg .radio-field-icon {
    width: 1.2rem;
    height: 1.2rem;
}

.radio-actions {
    display: flex;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.radio-btn-search,
.radio-btn-clear {
    min-height: 44px;
    border-radius: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.95rem;
    transition: opacity 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
    border: 0;
    cursor: pointer;
}

.radio-btn-search {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
}

.radio-btn-search:hover {
    transform: translateY(-1px);
}

.radio-btn-clear {
    background: #ffffff;
    color: #4b5563;
    border: 1px solid #dddddd;
}

.radio-btn-clear:hover {
    opacity: 0.9;
}

/* Active filter pills */
.radio-active-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.25rem;
}

.radio-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.875rem;
    padding: 0.3rem 0.7rem;
}

.radio-filter-pill svg {
    width: 0.75rem;
    height: 0.75rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Main Content Area ── */
.radio-main {
    padding: 1.25rem 0.75rem 2rem;
    max-width: 56rem;
    margin: 0 auto;
    box-sizing: border-box;
    overflow: hidden;
}

.radio-section-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.radio-section-title-row h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
}

.radio-title-icon {
    width: 1.25rem;
    height: 1.25rem;
    stroke: #667eea;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

/* Loading & Empty states */
.radio-loading-state,
.radio-empty-state {
    text-align: center;
    padding: 3rem 0.75rem;
    color: #6b7280;
}

.radio-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 3px solid transparent;
    border-bottom-color: #667eea;
    margin: 0 auto;
    animation: radio-spin 1s linear infinite;
}

@keyframes radio-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Station Grid ── */
.radio-station-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    min-width: 0;
    overflow: hidden;
}

.radio-station-card {
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 0.75rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
    transition: box-shadow 0.2s ease;
    min-width: 0;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

.radio-station-card:hover {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.radio-station-card-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    overflow: hidden;
    width: 100%;
}

.radio-station-art {
    width: 3.5rem;
    height: 3.5rem;
    flex: 0 0 auto;
    border-radius: 0.5rem;
    overflow: hidden;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    display: grid;
    place-items: center;
}

.radio-station-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.radio-station-fallback {
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 700;
}

.radio-station-body {
    min-width: 0;
    flex: 1 1 0%;
    overflow: hidden;
}

.radio-station-name {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.radio-station-meta {
    margin-top: 0.3rem;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.45rem;
    font-size: 0.8rem;
    color: #6b7280;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.radio-station-tags {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    overflow: hidden;
}

.radio-tag {
    font-size: 0.72rem;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    background: #f3f4f6;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 8rem;
    flex-shrink: 0;
}

.radio-station-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.radio-card-play-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #eef2ff;
    color: #4c51bf;
    border: 0;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease;
}

.radio-card-play-btn:hover {
    transform: translateY(-1px);
}

.radio-card-play-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
}

.radio-card-play-btn svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: currentColor;
}

/* ── Fixed Bottom Player Bar ── */
.radio-player {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.radio-player-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    width: min(1120px, 100% - 1.5rem);
    margin: 0 auto;
}

.radio-player-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1 1 auto;
    min-width: 0;
}

.radio-player-cover {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
}

.radio-player-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.radio-player-meta {
    min-width: 0;
}

.radio-player-meta h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
}

.radio-player-meta p {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
}

.radio-player-error {
    color: #ffa3a3;
}

.radio-player-controls {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex: 0 0 auto;
}

.radio-icon-btn,
.radio-play-btn {
    display: grid;
    place-items: center;
    border-radius: 999px;
    width: 2.75rem;
    height: 2.75rem;
    color: #ffffff;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0;
}

.radio-icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.radio-icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.radio-icon-btn svg,
.radio-play-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.radio-play-btn {
    background: #ffffff;
    color: #667eea;
    width: 3rem;
    height: 3rem;
}

.radio-play-btn:hover {
    transform: scale(1.05);
    transition: transform 0.15s ease;
}

.radio-play-btn svg {
    fill: currentColor;
    stroke: none;
}

.radio-player-volume {
    display: none;
    align-items: center;
    gap: 0.45rem;
    width: 8rem;
    flex: 0 0 auto;
}

.radio-player-volume input[type="range"] {
    width: 100%;
    cursor: pointer;
    accent-color: #ffffff;
    padding: 0;
    border: none;
    background: transparent;
}

.radio-icon-btn.compact {
    width: 2rem;
    height: 2rem;
}

/* ── Favorites Section ── */
.radio-favorites-section {
    background: #ffffff;
    border-bottom: 1px solid #eee;
    padding: 0.75rem 0;
}

.radio-favorites-inner {
    max-width: 56rem;
    margin: 0 auto;
    padding: 0 0.75rem;
}

.radio-favorites-title-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.radio-favorites-title-icon {
    width: 1.1rem;
    height: 1.1rem;
    stroke: #e11d48;
    stroke-width: 2;
    fill: #e11d48;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.radio-favorites-title-row h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #333;
}

.radio-favorites-row {
    display: flex;
    gap: 0.65rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.radio-favorites-row::-webkit-scrollbar {
    height: 4px;
}

.radio-favorites-row::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

/* Compact favorite card */
.radio-fav-card {
    flex: 0 0 auto;
    width: 140px;
    scroll-snap-align: start;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 0.65rem;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-align: center;
    position: relative;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.radio-fav-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.radio-fav-card-art {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.radio-fav-card-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.radio-fav-card-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    line-height: 1.2;
}

.radio-fav-card-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.radio-fav-card-play {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #eef2ff;
    color: #4c51bf;
    border: 0;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease;
}

.radio-fav-card-play:hover {
    transform: scale(1.1);
}

.radio-fav-card-play.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
}

.radio-fav-card-play svg {
    width: 0.9rem;
    height: 0.9rem;
    fill: currentColor;
}

.radio-fav-card-remove {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease;
}

.radio-fav-card-remove svg {
    width: 0.9rem;
    height: 0.9rem;
    stroke: #9ca3af;
    stroke-width: 2;
    fill: #e11d48;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 0.2s ease;
}

.radio-fav-card-remove:hover svg {
    opacity: 0.6;
}

/* Favorites empty state */
.radio-favorites-empty {
    font-size: 0.85rem;
    color: #9ca3af;
    font-style: italic;
    margin: 0;
    padding: 0.25rem 0;
}

/* ── Heart (Favorite) button on station cards ── */
.radio-card-fav-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease;
}

.radio-card-fav-btn svg {
    width: 1.2rem;
    height: 1.2rem;
    stroke: #9ca3af;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.2s ease, fill 0.2s ease;
}

.radio-card-fav-btn:hover svg {
    stroke: #e11d48;
}

.radio-card-fav-btn.is-fav svg {
    stroke: #e11d48;
    fill: #e11d48;
}

.radio-card-fav-btn.is-fav:hover svg {
    opacity: 0.8;
}

/* Heart pulse animation */
@keyframes radio-heart-pulse {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.35);
    }

    60% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

.radio-card-fav-btn.pulse svg {
    animation: radio-heart-pulse 0.4s ease;
}

/* Favorited station card highlight */
.radio-station-card.is-favorite {
    border-left: 3px solid #e11d48;
}

/* ── Utility: radio-scoped hidden ── */
.radio-hidden {
    display: none !important;
}

/* ── Page wrapper — extra bottom padding when player is visible ── */
.radio-page-container {
    padding-bottom: 1rem;
    transition: padding-bottom 0.3s ease;
}

.radio-page-container.has-player {
    padding-bottom: 6rem;
}

/* ── Responsive: Tablet (640px+) ── */
@media (min-width: 640px) {
    .radio-hero-inner {
        padding: 1.5rem 0;
        width: min(1120px, 100% - 2rem);
    }

    .radio-brand-box {
        padding: 1rem 1.25rem;
        gap: 1rem;
    }

    .radio-logo {
        width: 4rem;
        height: 4rem;
    }

    .radio-brand-title {
        font-size: 1.1rem;
    }

    .radio-brand-subtitle {
        font-size: 0.9rem;
    }

    .radio-search-form {
        padding: 1.25rem 0;
        gap: 1rem;
    }

    .radio-field input {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .radio-main {
        padding: 1.5rem 1rem 2.25rem;
    }

    .radio-section-title-row {
        margin-bottom: 1.25rem;
    }

    .radio-section-title-row h2 {
        font-size: 1.5rem;
    }

    .radio-title-icon {
        width: 1.5rem;
        height: 1.5rem;
    }

    .radio-station-grid {
        gap: 1rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .radio-station-card {
        padding: 1rem;
    }

    .radio-station-art {
        width: 4rem;
        height: 4rem;
    }

    .radio-station-name {
        font-size: 1rem;
    }

    .radio-station-meta {
        font-size: 0.88rem;
    }

    .radio-player-inner {
        gap: 1rem;
        padding: 0.7rem 1rem;
        width: min(1120px, 100% - 2rem);
    }

    .radio-player-cover {
        width: 3rem;
        height: 3rem;
    }

    .radio-player-meta h3 {
        font-size: 1rem;
    }

    .radio-player-meta p {
        font-size: 0.84rem;
    }

    .radio-player-controls {
        gap: 0.7rem;
    }

    .radio-icon-btn {
        width: 2.5rem;
        height: 2.5rem;
    }

    .radio-play-btn {
        width: 3rem;
        height: 3rem;
    }

    .radio-player-volume {
        display: flex;
    }
}

/* ── Responsive: Desktop (1024px+) ── */
@media (min-width: 1024px) {
    .radio-station-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}