/* SPA layout: home catalog + fullscreen player */
body:not(.app-ready) #uradio-app {
    visibility: hidden;
}

body.app-ready #uradio-app {
    visibility: visible;
}

.spa-loader {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    transition: opacity 0.25s ease, visibility 0.25s;
}

html.spa-player .spa-loader,
body.spa-player .spa-loader {
    background: #000;
}

.spa-loader__ring {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.12);
    border-top-color: rgba(0, 0, 0, 0.72);
    border-radius: 50%;
    animation: spa-loader-spin 0.75s linear infinite;
}

html.spa-player .spa-loader__ring,
body.spa-player .spa-loader__ring {
    border-color: rgba(255, 255, 255, 0.15);
    border-top-color: rgba(255, 255, 255, 0.85);
}

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

body.app-loader-done .spa-loader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.spa-home {
    overflow: auto;
}

html.spa-home {
    overflow: auto;
}

body.spa-player {
    background: #000;
    overflow: hidden;
}

body.spa-player .view-home {
    display: none !important;
}

.view-player {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #000;
    overflow: hidden;
}

.view-player .backdrop_cover {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.view-player .glass {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: transparent;
}

.view-player .glass:before {
    background: transparent;
}

.view-player .tools {
    z-index: 50;
}

.view-player .player {
    z-index: 10;
}

.view-player .playlist {
    z-index: 15;
}

.player-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 16px;
    pointer-events: none;
}

.player-topbar > * {
    pointer-events: auto;
}

.player-logo {
    cursor: pointer;
}

.spa-home-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 70;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

body[data-cover-tone="light"] .spa-home-btn {
    color: rgba(0, 0, 0, 0.75);
    background: rgba(0, 0, 0, 0.08);
}

body[data-cover-tone="light"] .spa-home-btn:hover {
    background: rgba(0, 0, 0, 0.14);
}

body[data-cover-tone="dark"] .spa-home-btn {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.12);
}

body[data-cover-tone="dark"] .spa-home-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.spa-home-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.view-home .header a {
    cursor: pointer;
}

/* mini now-playing bar on home when audio is active */
.spa-now-playing {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(20, 20, 20, 0.92);
    color: #fff;
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.spa-now-playing img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
}

.spa-now-playing .np-title {
    flex: 1;
    font-size: 14px;
    line-height: 1.3;
    opacity: 0.95;
}

.spa-now-playing .np-play {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #000;
    cursor: pointer;
}

.settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.settings-dialog {
    position: relative;
    width: min(100%, 360px);
    background: #fff;
    color: #111;
    border-radius: 16px;
    padding: 24px 20px 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    animation: settings-dialog-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes settings-dialog-in {
    from {
        transform: translateY(48px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.settings-title {
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 700;
}

.settings-label {
    margin: 0 0 10px;
    font-size: 14px;
    opacity: 0.7;
}

.settings-label--section {
    margin-top: 20px;
}

.settings-option-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-option-btn {
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    background: #f7f7f7;
    font: inherit;
    font-size: 15px;
    cursor: pointer;
}

.settings-option-btn.active {
    border-color: #111;
    background: #111;
    color: #fff;
}

.settings-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.5;
}

.settings-close:hover {
    opacity: 1;
}

html.theme-dark .settings-dialog {
    background: #1e1e1e;
    color: #f5f5f5;
}

html.theme-dark .settings-option-btn {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.12);
    color: #f5f5f5;
}

html.theme-dark .settings-option-btn.active {
    background: #f5f5f5;
    color: #111;
    border-color: #f5f5f5;
}

/* Server-rendered SEO block: visible to crawlers, hidden after Vue mounts */
.seo-static {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px 8px;
    color: var(--text-color, #111);
}

.seo-home-page h1,
.seo-station-page h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.seo-station-loc {
    opacity: 0.7;
    margin: 0 0 0.25rem;
}

.seo-station-tagline {
    font-size: 1.1rem;
    margin: 0 0 1rem;
}

.seo-station-page img {
    display: block;
    width: min(280px, 70vw);
    height: auto;
    border-radius: 12px;
    margin: 0 0 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.seo-station-desc {
    line-height: 1.5;
    margin: 0 0 1rem;
}

.seo-station-list {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0;
}

.seo-station-list li {
    margin: 0 0 0.75rem;
    line-height: 1.4;
}

.seo-station-list a {
    color: inherit;
    text-decoration: none;
}

.seo-station-list a:hover {
    text-decoration: underline;
}

body.app-ready .seo-static {
    display: none !important;
}
