/* ==========================================================================
   AURORA DECK — layout alternativo do Jailson Webradio
   Self-contained: não depende de css/main.min.css nem de custom.css.
   Mantém todos os seletores que js/main.js consulta diretamente.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --accent: #6c6fc6;
    --bg-0: #050507;
    --glass: rgba(255, 255, 255, 0.07);
    --glass-strong: rgba(20, 20, 26, 0.82);
    --border: rgba(255, 255, 255, 0.12);
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.6);
    --radius-lg: 28px;
    --radius-md: 18px;
    --ease: cubic-bezier(.16, 1, .3, 1);
}

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg-0);
    color: var(--text);
    font-family: Montserrat, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
button, input { font-family: inherit; }
button { cursor: pointer; background: none; border: 0; color: inherit; }
a { color: inherit; text-decoration: none; }
svg.i { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* --- utilities (mínimo necessário, usadas também pelo HTML gerado por JS) - */
.flex { display: flex; }
.column { flex-direction: column; }
.wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-none { flex: none; }
.relative { position: relative; }
.uppercase { text-transform: uppercase; }
.text-center { text-align: center; }
.truncate-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.color-title { color: var(--text); }
.color-text { color: var(--text-dim); }
.fw-500 { font-weight: 500; }
.fw-700 { font-weight: 700; }
.g-0\.5 { gap: .5rem; }
.g-0\.75 { gap: .75rem; }
.g-1 { gap: 1rem; }
.g-2 { gap: 2rem; }

.scrollbar { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .3) transparent; }
.scrollbar::-webkit-scrollbar { width: 6px; }
.scrollbar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .25); border-radius: 999px; }

/* ---------------------------------------------------------------- shell -- */

body.preload .app { opacity: 0; }
.app {
    position: relative;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transition: opacity .8s var(--ease);
}

.player-cover-image {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(70px) brightness(.45) saturate(1.3);
    transform: scale(1.35);
    z-index: -3;
    animation: bgDrift 40s ease-in-out infinite alternate;
}

@keyframes bgDrift {
    0% { transform: scale(1.35) translate(0, 0); }
    100% { transform: scale(1.55) translate(-2%, 2%); }
}

/* Ambient equalizer: fills the viewport on purpose — main.js draws bar
   heights as raw 0-255px values with no scaling, so the container needs
   real headroom or every bar clips and reads as a solid block. */
.visualizer {
    position: fixed;
    inset: 0;
    z-index: -2;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    opacity: .3;
    pointer-events: none;
}
.visualizer::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--accent), #ffffff);
    mix-blend-mode: color;
    pointer-events: none;
}
.visualizer canvas { display: block; }

.bg-veil {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(60% 50% at 50% 0%, rgba(0, 0, 0, .1), transparent 70%),
        linear-gradient(180deg, rgba(0, 0, 0, .45) 0%, rgba(0, 0, 0, .7) 60%, rgba(0, 0, 0, .88) 100%);
}

/* --------------------------------------------------------------- header -- */

.header { padding: 1.25rem clamp(1rem, 4vw, 3rem) 0; }
.header-wrapper { gap: .75rem; }
.brand { display: flex; align-items: center; }
/* mesmo porte do layout clássico (80px / teto de 10vw em telas largas) */
.header-logo-img { height: 52px; width: auto; opacity: .95; }
@media (min-width: 992px) { .header-logo-img { max-width: 10vw; height: auto; } }

.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    height: 2.5rem;
    padding: 0 1rem;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    font-size: .78rem;
    font-weight: 600;
    color: var(--text);
    transition: .25s var(--ease);
    white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, .16); transform: translateY(-1px); }

.icon-btn {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 50%;
    background: var(--glass);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: .25s var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, .16); transform: translateY(-1px); }
.icon-btn.is-active { background: var(--accent); border-color: transparent; }
/* display:inline-flex acima empatava em especificidade com o [hidden] padrão
   do navegador e vencia por vir depois — sem isso, prev/next ficavam visíveis
   mesmo com o atributo hidden presente no HTML. */
.icon-btn[hidden] { display: none; }

#install-pwa-btn { order: -1; }
#install-pwa-btn svg { display: none; }

/* ---------------------------------------------------------------- deck --- */

.deck {
    flex: 1;
    width: min(1120px, 100%);
    margin: clamp(1rem, 3vw, 2.5rem) auto;
    padding: 0 clamp(1rem, 4vw, 3rem);
    display: flex;
    align-items: center;
}

/* cartão único: arte + info dentro de uma moldura só — antes eram peças
   soltas flutuando na tela, o que deixava a leitura confusa */
.deck-card {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(240px, 340px) 1fr;
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
    padding: clamp(1.5rem, 3.5vw, 3rem);
    border-radius: var(--radius-lg);
    background: var(--glass);
    border: 1px solid var(--border);
    backdrop-filter: blur(22px) saturate(140%);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}

.deck-art { display: flex; flex-direction: column; align-items: center; }

.art-frame {
    position: relative;
    width: min(320px, 70vw);
    aspect-ratio: 1 / 1;
}

.art-glow {
    position: absolute;
    inset: -18%;
    z-index: 0;
    background: radial-gradient(circle, var(--accent) 0%, transparent 68%);
    filter: blur(50px);
    opacity: .55;
    animation: glowPulse 6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes glowPulse {
    0%, 100% { opacity: .4; transform: scale(1); }
    50% { opacity: .65; transform: scale(1.08); }
}

.art-frame::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 13%; height: 13%;
    background: #0a0a0c;
    border: 3px solid rgba(255, 255, 255, .18);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
}

.player-artwork {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    animation: spin 22s linear infinite;
    animation-play-state: paused;
}
body.is-playing .player-artwork { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }

.player-artwork img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, .7), inset 0 0 0 6px rgba(255, 255, 255, .06);
}

/* Vive junto do "Now Playing" (não mais sobre a capa): a capa gira via
   .player-artwork { animation: spin } enquanto toca, e um filho absoluto
   dela girava junto — texto girando era ilegível. */
.player-program {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.player-program:empty { display: none; }
.player-program-time-container { display: flex; align-items: center; gap: .5rem; }
.player-program-badge {
    background: var(--accent);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .06em;
    padding: .2rem .55rem;
    border-radius: 999px;
    text-transform: uppercase;
}
.player-program-time { font-size: .78rem; color: var(--text-dim); font-weight: 600; }
.player-program-name { font-size: .92rem; font-weight: 700; color: var(--text); }
.player-program-description { font-size: .78rem; color: var(--text-dim); }

/* ---------------------------------------------------------------- info --- */

.deck-info { display: flex; flex-direction: column; gap: 1.4rem; min-width: 0; }

.track-meta { display: flex; flex-direction: column; gap: .45rem; }
.np-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--accent);
}
/* título em Montserrat (a Akira Expanded não tinha acentos e virava
   colcha de retalhos); 2 linhas no máximo, com a altura já reservada */
.title {
    margin: 0;
    font-weight: 800;
    font-size: clamp(1.6rem, 3vw, 2.5rem);
    line-height: 1.12;
    letter-spacing: -.01em;
    color: var(--text);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    min-height: 2.24em;
}
.artist { font-size: 1rem; font-weight: 600; color: var(--text-dim); }

.deck-divider { height: 1px; background: linear-gradient(90deg, var(--border) 60%, transparent); }

/* chips de estação — atalho na página para o painel #stations (só aparecem
   com mais de uma estação; o JS nem os cria no caso comum de estação única) */
.deck-stations { display: flex; flex-wrap: wrap; gap: .5rem; }
.deck-stations:empty { display: none; }
.deck-station {
    padding: .5rem 1rem;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--text-dim);
    transition: .25s var(--ease);
    white-space: nowrap;
}
.deck-station:hover { background: rgba(255, 255, 255, .14); color: var(--text); }
.deck-station.is-active { background: var(--accent); border-color: transparent; color: #fff; }

/* controles em dois grupos claros: transporte à esquerda,
   utilidades (volume, letra, TV) à direita */
.controls-dock {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.transport { display: flex; align-items: center; gap: .75rem; }
.transport .icon-btn { width: 3rem; height: 3rem; }
.dock-utils { display: flex; align-items: center; gap: .75rem; }

.player-button-volume { position: relative; }

.player-button-play {
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), rgba(255, 255, 255, .25));
    box-shadow: 0 10px 30px -6px var(--accent), inset 0 0 0 1px rgba(255, 255, 255, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .3s var(--ease);
}
.player-button-play svg { width: 1.6rem; height: 1.6rem; }
.player-button-play:hover { transform: scale(1.05); }
.player-button-play.is-active { animation: playPulse 2.6s ease-in-out infinite; }
@keyframes playPulse {
    0%, 100% { box-shadow: 0 10px 30px -6px var(--accent), inset 0 0 0 1px rgba(255, 255, 255, .2); }
    50% { box-shadow: 0 10px 46px 2px var(--accent), inset 0 0 0 1px rgba(255, 255, 255, .3); }
}
.i-spinner { animation: none; }

.player-button-tv {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    height: 2.5rem;
    padding: 0 1rem;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--border);
    font-size: .75rem;
    font-weight: 700;
}
.player-button-tv:hover { background: rgba(255, 255, 255, .16); }

/* volume popover */
.dropdown {
    position: absolute;
    bottom: calc(100% + .75rem);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: 150px;
    padding: 1rem .9rem;
    background: var(--glass-strong);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 14px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: .25s var(--ease);
    z-index: 40;
}
.dropdown.is-active { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }

.player-range-wrapper { position: relative; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .18); }
.player-range-fill { position: absolute; inset: 0; width: 0%; border-radius: 999px; background: var(--accent); }
.player-range-thumb {
    position: absolute; top: 50%; left: 0;
    width: 14px; height: 14px;
    background: #fff; border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .18);
}
.player-volume {
    position: absolute; inset: -8px 0;
    width: 100%; opacity: 0; margin: 0; cursor: pointer;
}

/* --------------------------------------------------------------- footer -- */

.glass-footer {
    margin: 0 clamp(1rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    background: var(--glass);
    border: 1px solid var(--border);
    backdrop-filter: blur(16px);
    font-size: .75rem;
    color: var(--text-dim);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

.player-social { justify-self: start; }
.footer-copyright { justify-self: center; text-align: center; }
.footer-app { justify-self: end; align-items: center; }

.player-social-item {
    width: 2.25rem; height: 2.25rem;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .06);
    transition: .2s;
}
.player-social-item:hover { background: var(--accent); }

/* Selos oficiais das lojas: exibidos no tamanho/proporção originais,
   sem recorte — a imagem já é o botão completo. */
.footer-app .player-apps-item { display: inline-flex; align-items: center; }
.footer-app img { height: 30px; width: auto; opacity: .9; transition: opacity .2s; }
.footer-app .player-apps-item:hover img { opacity: 1; }

/* -------------------------------------------------------------- offcanvas */

.offcanvas {
    position: fixed;
    top: 0; right: 0;
    height: 100dvh;
    width: min(380px, 90vw);
    background: var(--glass-strong);
    backdrop-filter: blur(26px) saturate(140%);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform .4s var(--ease);
    z-index: 60;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow-y: auto;
}
.offcanvas.is-active { transform: translateX(0); }
/* painel de estações aposentado: os chips na página assumiram a troca.
   O <aside> fica no DOM porque o main.js popula #stations e os chips
   acionam esses botões ocultos — só não há mais UI para abri-lo. */
#offcanvas-stations { display: none; }
.offcanvas-head { margin-bottom: 1rem; }
.offcanvas-head h2 { margin: 0; font-size: 1.1rem; }

#stations { display: flex; flex-direction: column; gap: .5rem; }
.station {
    display: flex;
    align-items: center;
    width: 100%;
    padding: .5rem;
    border-radius: 14px;
    background: transparent;
    box-shadow: inset 0 0 0 1px transparent;
    transition: .2s;
}
.station:hover { background: rgba(255, 255, 255, .06); }
.station.is-active { background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px var(--accent); }
.station-img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }

.history-item {
    padding: .6rem;
    border-radius: 14px;
    transition: .2s;
    margin-bottom: .4rem;
}
.history-item:hover { background: rgba(255, 255, 255, .06); }
.history-image img { border-radius: 10px; width: 52px; height: 52px; object-fit: cover; }
.history-meta { min-width: 0; flex: 1; gap: .1rem; }
.history-spotify {
    width: 2rem; height: 2rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .08);
    flex-shrink: 0;
}

.programacao-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    border-radius: 14px;
    margin-bottom: .4rem;
    transition: .2s;
}
.programacao-item:hover { background: rgba(255, 255, 255, .06); }
.programacao-item.is-active {
    background: rgba(255, 255, 255, .08);
    box-shadow: inset 0 0 0 1px var(--accent);
}
.programacao-item-time {
    flex-shrink: 0;
    font-weight: 700;
    font-size: .78rem;
    color: var(--accent);
    white-space: nowrap;
}
.programacao-item-info { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.programacao-item-name { font-weight: 600; }
.programacao-item-description { font-size: .78rem; color: var(--text-dim); }

/* ----------------------------------------------------------------- modal */

.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(8px);
    opacity: 0; visibility: hidden;
    transition: .3s var(--ease);
    z-index: 70;
}
#modal-lyrics.is-active ~ .modal-overlay,
#modal-tv.is-active ~ .modal-overlay { opacity: 1; visibility: visible; }

.modal {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: .3s var(--ease);
    z-index: 80;
}
.modal.is-active { opacity: 1; visibility: visible; pointer-events: auto; }

.modal-content {
    width: min(560px, 100%);
    max-height: 78vh;
    display: flex;
    flex-direction: column;
    background: var(--glass-strong);
    backdrop-filter: blur(26px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transform: translateY(14px) scale(.97);
    transition: .3s var(--ease);
}
.modal.is-active .modal-content { transform: translateY(0) scale(1); }
.modal-title { margin-bottom: 1rem; }
.modal-title-text { margin: 0; font-size: 1.1rem; }
.modal-body { overflow-y: auto; line-height: 1.85; color: var(--text-dim); }
.modal-body p { margin: 0; }

.modal-video {
    position: fixed; inset: 0;
    background: #000;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: .3s var(--ease);
    z-index: 80;
}
.modal-video.is-active { opacity: 1; visibility: visible; pointer-events: auto; }
.modal-video > .btn { position: absolute; top: 1.25rem; right: 1.25rem; z-index: 2; }
.modal-body-video, .modal-body-video iframe { width: 100%; height: 100%; border: 0; }

/* ---------------------------------------------------------------- mobile --
   Um único breakpoint (768px) para telas pequenas, alinhado com o limite
   que js/main.js usa para decidir se o bargraph roda ou não — evita a faixa
   "no meio do caminho" (ex.: 769-900px) onde a arte ficava em tamanho de
   desktop dentro de uma coluna única e empurrava os controles para fora
   da tela.
   ---------------------------------------------------------------------- */

@media (max-width: 768px) {
    .header { padding: 1rem 1rem 0; }
    .header-wrapper { gap: .5rem; }
    .header-logo-img { height: 52px; }
    /* botões do cabeçalho voltam a ser só ícone */
    .btn-label { display: none; }
    .toggle-options .btn { width: 2.5rem; padding: 0; justify-content: center; border-radius: 50%; }

    .deck { margin: 1rem auto; padding: 0 1rem; }
    .deck-card {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        padding: 1.25rem;
        gap: 1.25rem;
    }
    .deck-info { align-items: center; gap: 1rem; }
    .track-meta { align-items: center; }
    .deck-divider { width: 100%; background: linear-gradient(90deg, transparent, var(--border), transparent); }

    .art-frame { width: min(220px, 58vw); }

    .np-label { font-size: .65rem; }
    .title { font-size: clamp(1.3rem, 6.5vw, 1.8rem); line-height: 1.15; }

    .deck-stations { justify-content: center; }
    .player-button-volume { display: none; }   /* sem volume no celular: botões físicos */

    .controls-dock { justify-content: center; }
    .transport, .dock-utils { justify-content: center; }
    .icon-btn, .player-button-tv { width: 2.5rem; height: 2.5rem; }
    .transport .icon-btn { width: 2.75rem; height: 2.75rem; }
    .player-button-tv { width: auto; padding: 0 .75rem; font-size: .7rem; }
    .player-button-play { width: 3.75rem; height: 3.75rem; }

    .glass-footer {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: .75rem;
        margin: 0 1rem 1rem;
        padding: .85rem 1rem;
    }
    .player-social, .footer-app { justify-self: center; }
}
