/* ==========================================================================
   RADIO FM THEME — camada visual moderna (nao mexe no main.css do vendor)
   ========================================================================== */

:root {
    --fm-accent: #004da7;
    --fm-accent-2: #1e88e5;
    --fm-gradient: linear-gradient(120deg, #002d63 0%, var(--fm-accent) 50%, var(--fm-accent-2) 100%);
    --fm-glass-bg: rgba(18, 20, 26, 0.55);
    --fm-glass-border: rgba(255, 255, 255, 0.08);
    --fm-radius: 16px;
    --fm-shadow-glow: 0 8px 32px rgba(0, 77, 167, 0.28);
}

[data-bs-theme='light'] {
    --fm-glass-bg: rgba(255, 255, 255, 0.65);
    --fm-glass-border: rgba(0, 0, 0, 0.06);
}

/* ---------- Full-bleed layout: usa a tela toda ---------- */
.container,
header nav.navbar > .container,
footer .container {
    max-width: 100% !important;
    width: 100%;
    padding-left: clamp(1rem, 3vw, 3rem) !important;
    padding-right: clamp(1rem, 3vw, 3rem) !important;
}

/* trava um teto confortavel em telas ultra largas, sem parecer "com margem" */
@media (min-width: 1900px) {
    #ajaxArea .container {
        max-width: 1900px !important;
        margin-left: auto;
        margin-right: auto;
    }
}

body {
    overflow-x: hidden;
}

/* ---------- Rodape sempre grudado no fim da tela (sem espaco em branco sobrando
   quando a pagina e mais curta que a altura da janela) ---------- */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#ajaxArea {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

/* ---------- Navbar estilo "app" com efeito vidro ---------- */
header {
    margin-bottom: 0 !important;
}

header nav.navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    background: var(--fm-glass-bg) !important;
    border-bottom: 1px solid var(--fm-glass-border);
    transition: background 0.25s ease, box-shadow 0.25s ease, padding 0.25s ease;
}

header nav.navbar.fm-scrolled {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

header nav.navbar {
    min-height: 116px !important;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

header nav .navbar-logo {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
}

header nav .navbar-logo img {
    max-height: 128px !important;
    width: auto;
    filter: drop-shadow(0 0 14px rgba(0, 77, 167, 0.4)) drop-shadow(0 0 2px rgba(0, 0, 0, 0.25));
    transition: transform 0.25s ease;
}

@media (max-width: 768px) {
    header nav.navbar {
        min-height: 92px !important;
    }
    header nav .navbar-logo img {
        max-height: 84px !important;
    }
}

header nav .navbar-logo:hover img {
    transform: scale(1.04);
}

header nav li .nav-link {
    position: relative;
    font-weight: 600;
    letter-spacing: 0.02em;
}

header nav li .nav-link::after {
    content: '';
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 2px;
    height: 2px;
    background: var(--fm-gradient);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

header nav li .nav-link:hover::after,
header nav li .nav-link.active::after {
    transform: scaleX(1);
}

/* ---------- Player: dock estilo FM moderno ---------- */
#player {
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    background: var(--fm-glass-bg) !important;
    border-top: 1px solid var(--fm-glass-border);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.35);
}

.sticky-top#player {
    border-top: none;
    border-bottom: 1px solid var(--fm-glass-border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

#player .player-radio {
    padding: 0.75rem 0.25rem !important;
}

.player-info img {
    height: 54px !important;
    width: 54px !important;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: transform 4s linear;
}

/* disco girando quando esta tocando */
#player.fm-playing .player-info img {
    animation: fm-spin 6s linear infinite;
    border-radius: 50%;
}

@keyframes fm-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.player-info .now {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.12em;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 6px;
}

.player-info .now::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #888;
    display: inline-block;
}

#player.fm-playing .player-info .now::before {
    background: var(--fm-accent);
    box-shadow: 0 0 8px var(--fm-accent), 0 0 2px var(--fm-accent);
    animation: fm-pulse 1.4s ease-in-out infinite;
}

@keyframes fm-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.player-controls .b-play {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--fm-gradient) !important;
    box-shadow: var(--fm-shadow-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.player-controls .b-play::before {
    color: #fff !important;
    font-size: 22px !important;
    height: 52px !important;
    line-height: 52px !important;
    width: 52px !important;
}

.player-controls .b-play:hover {
    transform: scale(1.06);
    box-shadow: 0 10px 36px rgba(0, 77, 167, 0.45);
}

/* equalizador animado — injetado via JS ao lado da capa */
.fm-eq {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
    height: 18px;
    margin-right: 10px;
}

.fm-eq span {
    display: block;
    width: 3px;
    height: 4px;
    border-radius: 2px;
    background: var(--fm-gradient);
    opacity: 0.35;
    transition: opacity 0.2s ease;
}

#player.fm-playing .fm-eq span {
    opacity: 1;
    animation: fm-bar 1s ease-in-out infinite;
}

#player.fm-playing .fm-eq span:nth-child(1) { animation-delay: -0.9s; }
#player.fm-playing .fm-eq span:nth-child(2) { animation-delay: -0.6s; }
#player.fm-playing .fm-eq span:nth-child(3) { animation-delay: -0.3s; }
#player.fm-playing .fm-eq span:nth-child(4) { animation-delay: -0.15s; }
#player.fm-playing .fm-eq span:nth-child(5) { animation-delay: 0s; }

@keyframes fm-bar {
    0%, 100% { height: 4px; }
    50% { height: 18px; }
}

/* ---------- Slider: altura fixa e responsiva, imagem inteira, sem cortar e sem sobrar vazio ----------
   Tecnica usada por sites grandes (Netflix, Spotify etc.): a imagem real fica
   inteira (object-fit: contain) centralizada, e o espaco que sobraria vazio
   nas laterais/topo e preenchido com a propria imagem, ampliada e desfocada
   ao fundo, entao nunca corta e nunca fica "pequena" dentro do slide. */
#slide.carousel {
    border-radius: var(--fm-radius);
    overflow: hidden;
}

#slide .carousel-item {
    position: relative;
    height: clamp(180px, 30vw, 420px);
    background-color: #0b0c10;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

/* fundo desfocado, usa a mesma imagem do slide (definida via style="" no PHP) */
#slide .carousel-item::before {
    content: '';
    position: absolute;
    inset: -20px;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(0.55) saturate(1.15);
    transform: scale(1.15);
    z-index: 0;
}

#slide .carousel-item img {
    position: relative;
    z-index: 1;
    display: block;
    width: auto;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0 auto;
    object-fit: contain;
}

#slide .carousel-caption {
    z-index: 2;
}

/* em telas pequenas o slide fica mais baixo, mas continua visivel e inteiro */
@media (max-width: 767.98px) {
    #slide .carousel-item {
        height: clamp(140px, 45vw, 260px);
    }
}

/* ---------- Hero "no ar agora" ---------- */
.fm-hero {
    position: relative;
    min-height: min(78vh, 720px);
    display: flex;
    align-items: center;
    border-radius: var(--fm-radius);
    overflow: hidden;
    margin-bottom: 2rem;
    padding: clamp(1.5rem, 5vw, 4rem);
    isolation: isolate;
}

.fm-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(0, 77, 167, 0.4), transparent 55%),
        radial-gradient(circle at 85% 80%, rgba(30, 136, 229, 0.28), transparent 55%),
        linear-gradient(160deg, rgba(10, 11, 15, 0.96), rgba(20, 15, 25, 0.9));
    z-index: -2;
}

.fm-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 22px 22px;
    z-index: -1;
    opacity: 0.5;
}

.fm-hero-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(1.5rem, 4vw, 3.5rem);
    width: 100%;
    color: #f8f9fa;
}

.fm-hero-art {
    position: relative;
    flex: 0 0 auto;
    width: clamp(160px, 22vw, 260px);
    height: clamp(160px, 22vw, 260px);
    border-radius: 50%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 10px rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.fm-hero-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fm-hero-art.fm-playing img {
    animation: fm-spin 8s linear infinite;
}

.fm-hero-art::after {
    content: '';
    position: absolute;
    inset: 38%;
    border-radius: 50%;
    background: #0b0c10;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.fm-hero-info {
    flex: 1 1 320px;
    min-width: 0;
}

.fm-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 1rem;
}

.fm-hero-tag .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fm-accent);
    box-shadow: 0 0 8px var(--fm-accent);
    animation: fm-pulse 1.4s ease-in-out infinite;
}

.fm-hero-title {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 0.75rem;
    background: var(--fm-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.fm-hero-track {
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    opacity: 0.85;
    margin-bottom: 1.75rem;
    max-width: 640px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fm-hero-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.fm-hero-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: none;
    background: var(--fm-gradient);
    color: #fff;
    font-size: 24px;
    box-shadow: var(--fm-shadow-glow);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.fm-hero-play:hover {
    transform: scale(1.06);
    box-shadow: 0 12px 40px rgba(0, 77, 167, 0.5);
}

.fm-hero-actions .fm-eq {
    height: 26px;
}

.fm-hero-actions .fm-eq span {
    width: 4px;
}

@media (max-width: 767.98px) {
    .fm-hero {
        min-height: auto;
        padding: 2rem 1.25rem;
    }
    .fm-hero-content {
        justify-content: center;
        text-align: center;
    }
    .fm-hero-info {
        flex-basis: 100%;
    }
    .fm-hero-actions {
        justify-content: center;
    }
    .fm-hero-track {
        white-space: normal;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ---------- Layout aberto: tira a sensacao de "caixa fechada" ---------- */
#ajaxArea .container.bg-body-tertiary,
.container.bg-body-tertiary#footer {
    background: transparent !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

#ajaxArea .container.bg-body-tertiary > .row,
#ajaxArea .container.bg-body-tertiary {
    padding-top: 1rem;
}

/* ---------- Barra lateral: mantida do lado, mas esticando ate a borda da tela,
   com acabamento mais bonito e sticky (acompanha o scroll) ---------- */
#ajaxArea > .container > .row > .col-md-4 > aside {
    position: sticky;
    top: calc(116px + 1rem); /* logo abaixo da navbar */
}

#ajaxArea > .container > .row > .col-md-4 > aside > section > * {
    margin-bottom: 1.25rem;
}

@media (max-width: 991.98px) {
    #ajaxArea > .container > .row > .col-md-4 > aside {
        position: static;
        margin-top: 1.5rem;
    }
}

/* ---------- Cards com toque moderno ---------- */
.card {
    border-radius: var(--fm-radius) !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.article-card:hover,
.top-music-card:hover,
.post1-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

/* ---------- Scrollbar neon ---------- */
::-webkit-scrollbar-thumb {
    background: var(--fm-gradient) !important;
}

/* ---------- Botao primario com identidade FM ---------- */
.btn-primary {
    background: var(--fm-gradient) !important;
    border: none !important;
    box-shadow: 0 6px 20px rgba(0, 77, 167, 0.28);
}
