/* ============================================================
   TV Display Premium — Digital Signage de Aniversariantes
   Layout: Split-Screen 72% semana / 28% mês
   Paleta: Azul-marinho escuro + Branco + Dourado
   ============================================================ */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #050d1a;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.tv-player {
    position: relative;
}

/* ============================================================
   BACKGROUND
   ============================================================ */
.tv-background {
    position: fixed;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(ellipse 70% 60% at 15% 25%, rgba(30, 80, 200, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 85% 75%, rgba(212, 175, 55, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse 80% 80% at 50% 50%, rgba(5, 20, 50, 0.6) 0%, transparent 100%),
        #050d1a;
}

/* ============================================================
   CONFETTI
   ============================================================ */
.confetti-container {
    position: fixed;
    inset: 0;
    z-index: 3;
    overflow: hidden;
    pointer-events: none;
}

.confetti-particle {
    position: absolute;
    top: -20px;
    border-radius: 3px;
    animation: confettiFall linear infinite;
    opacity: 0.75;
}

@keyframes confettiFall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
    8%   { opacity: 0.75; }
    92%  { opacity: 0.75; }
    100% { transform: translateY(108vh) rotate(420deg); opacity: 0; }
}

/* ============================================================
   CAMADA PRINCIPAL DA TV
   ============================================================ */
.tv-main {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    overflow: hidden;
}

/* ============================================================
   SLIDE BASE (transições)
   ============================================================ */
.tv-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity;
    z-index: 1;
}

.tv-slide.active {
    opacity: 1;
    z-index: 5;
}

/* ============================================================
   MODO PUBLICIDADE
   ============================================================ */
.mode-publicity .tv-main { z-index: 20; }

.slide-publicity {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
    box-shadow: none;
    position: relative;
    background: #000;
}

.slide-publicity.slide-publicity-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    filter: blur(28px) brightness(0.35);
    z-index: 1;
}

.slide-publicity img,
.slide-publicity video,
.slide-publicity iframe {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    border: 0;
}

.slide-publicity-image.active {
    animation: kenburns 18s infinite alternate ease-in-out;
}

@keyframes kenburns {
    0%   { transform: scale(1); }
    100% { transform: scale(1.04); }
}

.slide-publicity-video {
    background:
        radial-gradient(circle at center, rgba(20, 60, 180, 0.1), transparent 55%),
        rgba(0, 0, 0, 0.95);
}

/* ============================================================
   SLIDE DE ANIVERSÁRIO — ESTRUTURA SPLIT-SCREEN
   ============================================================ */
.slide-birthday {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

/* ──────────────────────────────────────
   SEÇÃO PRINCIPAL — ANIVERSARIANTES DA SEMANA (≈72%)
   ────────────────────────────────────── */
.bday-week-section {
    position: relative;
    flex: 0 0 65%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 2rem 4rem 1.5rem;
}

/* Gradiente sutil no fundo da seção */
.bday-week-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 65% 80% at 50% 45%, rgba(20, 60, 180, 0.14) 0%, transparent 70%),
        rgba(5, 15, 35, 0.4);
    z-index: 0;
    pointer-events: none;
}

/* Linha divisória decorativa no topo */
.bday-week-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.8rem;
}

.bday-week-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    white-space: nowrap;
}

.bday-week-title-line {
    flex: 1;
    max-width: 160px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.45), transparent);
}

/* Área interna que muda entre slides da semana */
.bday-week-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5rem;
    width: 100%;
    max-width: 1340px;
    flex: 1;
}

/* ── Foto / Avatar ── */
.bday-avatar-container {
    position: relative;
    width: 330px;
    height: 330px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.45s ease, transform 0.45s ease;
}

/* Anel externo giratório pontilhado */
.bday-glow-ring {
    position: absolute;
    inset: -8%;
    border-radius: 50%;
    border: 2px dashed rgba(212, 175, 55, 0.35);
    animation: rotateDashed 30s linear infinite;
}

/* Anel interno com glow pulsante */
.bday-glow-ring-inner {
    position: absolute;
    inset: -2%;
    border-radius: 50%;
    border: 2.5px solid rgba(212, 175, 55, 0.75);
    box-shadow:
        0 0 30px rgba(212, 175, 55, 0.3),
        inset 0 0 20px rgba(212, 175, 55, 0.04);
    animation: pulseGlow 3.5s ease-in-out infinite alternate;
}

@keyframes rotateDashed {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulseGlow {
    0%   { box-shadow: 0 0 20px rgba(212, 175, 55, 0.2), inset 0 0 10px rgba(212, 175, 55, 0.03); }
    100% { box-shadow: 0 0 55px rgba(212, 175, 55, 0.55), inset 0 0 25px rgba(212, 175, 55, 0.06); }
}

.bday-image-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    z-index: 10;
    background: linear-gradient(145deg, #0d1a30, #071025);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.55),
        0 0 0 4px rgba(212, 175, 55, 0.15);
}

.bday-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border-radius: 50%;
}

.bday-image-wrapper .bday-no-photo-icon {
    font-size: 9rem;
    color: rgba(212, 175, 55, 0.25);
}

/* ── Informações do Aniversariante ── */
.bday-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 680px;
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.bday-info.transitioning,
.bday-avatar-container.transitioning {
    opacity: 0;
    transform: translateY(12px);
}

.bday-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.05));
    border: 1px solid rgba(212, 175, 55, 0.38);
    padding: 0.45rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #D4AF37;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 1.4rem;
    width: fit-content;
}

.bday-badge-icon {
    font-size: 1rem;
}

.bday-name {
    font-size: clamp(3rem, 5.5vw, 5.2rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #ffffff;
    text-shadow:
        0 4px 30px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(30, 80, 200, 0.15);
    margin-bottom: 0.8rem;
    word-break: break-word;
}

.bday-date {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: clamp(1.2rem, 2vw, 1.65rem);
    font-weight: 600;
    color: #D4AF37;
    letter-spacing: 0.06em;
    margin-bottom: 1.8rem;
}

.bday-date-icon {
    font-size: 1.1em;
    opacity: 0.8;
}

.bday-divider {
    width: 100%;
    height: 1.5px;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.55) 0%, rgba(212, 175, 55, 0.08) 70%, transparent 100%);
    margin-bottom: 1.8rem;
    border-radius: 2px;
}

.bday-message {
    font-size: clamp(1.1rem, 1.7vw, 1.55rem);
    font-weight: 300;
    font-style: italic;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.65;
    padding-left: 1.5rem;
    border-left: 3px solid rgba(212, 175, 55, 0.6);
    position: relative;
}

/* ── Indicadores de Slide (Dots) ── */
.bday-week-dots {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 1.5rem;
    min-height: 20px;
}

.bday-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    transition: all 0.4s ease;
    cursor: default;
}

.bday-dot.active {
    background: #D4AF37;
    border-color: #D4AF37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
    transform: scale(1.25);
}

/* ── Estado Vazio (sem aniversariantes na semana) ── */
.bday-empty-state {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1.5rem;
    padding: 1rem 3rem;
    flex: 1;
}

.bday-empty-icon {
    font-size: 5rem;
    opacity: 0.35;
    animation: floatEmpty 4s ease-in-out infinite alternate;
}

@keyframes floatEmpty {
    0%   { transform: translateY(0) scale(1); }
    100% { transform: translateY(-10px) scale(1.05); }
}

.bday-empty-title {
    font-size: clamp(1.4rem, 2.8vw, 2.6rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.04em;
    line-height: 1.3;
}

.bday-empty-upcoming {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.5rem;
}

.bday-upcoming-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    min-width: 130px;
    transition: border-color 0.3s ease;
}

.bday-upcoming-card:hover {
    border-color: rgba(212, 175, 55, 0.25);
}

.bday-upcoming-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 2px solid rgba(212, 175, 55, 0.35);
}

.bday-upcoming-photo-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.08);
    border: 2px solid rgba(212, 175, 55, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: rgba(212, 175, 55, 0.3);
}

.bday-upcoming-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
    letter-spacing: 0.05em;
    line-height: 1.2;
    text-transform: uppercase;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bday-upcoming-date {
    font-size: 0.78rem;
    font-weight: 500;
    color: #D4AF37;
    letter-spacing: 0.08em;
}

.bday-upcoming-days {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.05em;
}

/* ──────────────────────────────────────
   DIVISOR ENTRE SEÇÕES
   ────────────────────────────────────── */
.bday-section-divider {
    position: relative;
    z-index: 8;
    flex: 0 0 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(212, 175, 55, 0.3) 30%, rgba(212, 175, 55, 0.3) 70%, transparent 100%);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.12);
}

/* ──────────────────────────────────────
   SEÇÃO INFERIOR — ANIVERSARIANTES DO MÊS (≈28%)
   ────────────────────────────────────── */
.bday-month-section {
    position: relative;
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(5, 12, 28, 0.85) 0%, rgba(3, 8, 20, 0.98) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.bday-month-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.2rem 2rem 0.8rem;
}

.bday-month-title {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
}

.bday-month-title-line {
    flex: 1;
    max-width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* ── Wrapper do Carrossel / Estático ── */
.bday-month-carousel-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

/* Modo carrossel: fade nas bordas e scroll */
.bday-month-carousel-wrapper--scroll {
    mask-image: linear-gradient(90deg, transparent 0%, black 7%, black 93%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 7%, black 93%, transparent 100%);
}

/* Track base */
.bday-month-track {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Track estático: centralizado, sem animação */
.bday-month-track--static {
    justify-content: center;
    flex-wrap: nowrap;
    width: 100%;
    padding: 0 2.5rem;
}

/* Track em scroll: contínuo */
.bday-month-track--scroll {
    padding: 0 3rem;
    white-space: nowrap;
    animation: scrollCarousel var(--carousel-duration, 30s) linear infinite;
    will-change: transform;
}

.bday-month-track--scroll:hover {
    animation-play-state: paused;
}

@keyframes scrollCarousel {
    0%   { transform: translateX(0); }
    100% { transform: translateX(var(--carousel-shift, -50%)); }
}

/* ── Card Individual do Mês ── */
.bday-month-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    padding: 1.2rem 1.4rem 1.1rem;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    min-width: 140px;
    max-width: 165px;
    flex-shrink: 0;
    transition: border-color 0.35s ease, background 0.35s ease;
    vertical-align: middle;
    white-space: normal;
    text-align: center;
}

.bday-month-card.is-today {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.12);
}

.bday-month-card.is-week {
    background: rgba(30, 80, 200, 0.1);
    border-color: rgba(80, 140, 255, 0.3);
}

.bday-month-photo {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 2.5px solid rgba(255, 255, 255, 0.14);
    flex-shrink: 0;
    display: block;
}

.bday-month-card.is-today .bday-month-photo,
.bday-month-card.is-week .bday-month-photo {
    border-color: rgba(212, 175, 55, 0.5);
}

.bday-month-photo-placeholder {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    color: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.bday-month-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.2;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.bday-month-date {
    font-size: 0.9rem;
    font-weight: 700;
    color: #D4AF37;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.bday-month-date-icon {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* ============================================================
   UTILITÁRIOS / ANIMAÇÕES GLOBAIS
   ============================================================ */

/* Fade in suave para o slide inteiro */
@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bday-info-enter {
    animation: fadeInSlide 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.bday-avatar-enter {
    animation: fadeInSlide 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
}

/* ============================================================
   RESPONSIVIDADE
   ============================================================ */

/* 1280px — monitores menores */
@media (max-width: 1400px) {
    .bday-avatar-container { width: 280px; height: 280px; }
    .bday-week-inner { gap: 3.5rem; }
    .bday-month-card { min-width: 108px; }
    .bday-month-photo { width: 54px; height: 54px; }
    .bday-month-photo-placeholder { width: 54px; height: 54px; }
}

/* Telas muito curtas / wide extremo */
@media (max-height: 620px) {
    .bday-week-section { flex: 0 0 68%; padding: 1rem 3rem 1rem; }
    .bday-month-section { flex: 0 0 32%; }
    .bday-avatar-container { width: 220px; height: 220px; }
    .bday-week-header { margin-bottom: 0.8rem; }
}

/* 4K — escala das fontes */
@media (min-width: 2560px) {
    .bday-avatar-container { width: 460px; height: 460px; }
    .bday-week-inner { gap: 7rem; max-width: 1900px; }
    .bday-week-title { font-size: 1.5rem; }
    .bday-month-title { font-size: 1.1rem; }
    .bday-month-photo { width: 80px; height: 80px; }
    .bday-month-photo-placeholder { width: 80px; height: 80px; }
    .bday-month-card { min-width: 150px; }
    .bday-dot { width: 10px; height: 10px; }
}
