/* ============================================
   RETROSPECTIVA 2025 - ESTILOS
   Um visual romântico e apaixonado
   ============================================ */

/* Reset e configurações base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    /* Dynamic viewport height for mobile */
    overflow: hidden;
    font-family: 'Cormorant Garamond', Georgia, serif;
    background-color: #1a0a10;
    color: #fff5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Safe area for notch/URL bar */
    padding-bottom: env(safe-area-inset-bottom);
}

/* Tela de Início (Splash Screen) */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a0a10;
    background-image:
        radial-gradient(circle at 50% 50%, #2d1520 0%, #1a0a10 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.splash-content {
    text-align: center;
    max-width: 90%;
}

.splash-content h1 {
    font-size: clamp(2rem, 8vw, 3.5rem);
    color: #ffd9e4;
    margin-bottom: 1rem;
    font-weight: 300;
    letter-spacing: 2px;
}

.splash-content p {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 3rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.btn-iniciar {
    background: linear-gradient(135deg, #8b455a 0%, #a65d73 100%);
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 2px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
}

.btn-iniciar:active {
    transform: scale(0.95);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Notificações (antigo debug overlay) */
#debug-overlay {
    position: fixed;
    bottom: 120px;
    /* Aumentado para não conflitar com barra do iPhone */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(45, 21, 32, 0.95);
    backdrop-filter: blur(10px);
    color: #ffd9e4;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-family: 'Quicksand', sans-serif;
    z-index: 11000;
    pointer-events: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 182, 193, 0.15);
    transition: all 0.4s ease;
    opacity: 0;
    text-align: center;
    min-width: 200px;
    letter-spacing: 0.5px;
}

#debug-overlay.active {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

/* Container principal */
#retrospectiva-container {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    /* Dynamic viewport height */
    position: relative;
    overflow: hidden;
}

/* ============================================
   TELA INICIAL
   ============================================ */

#tela-inicial {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(139, 69, 90, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(178, 102, 128, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at center, #2d1520 0%, #1a0a10 70%);
    z-index: 1000;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

#tela-inicial.ativa {
    opacity: 1;
}

.conteudo-inicial {
    text-align: center;
    padding: 2.5rem;
    max-width: 850px;
}

.linha-texto {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
    margin-bottom: 0.8rem;
}

.linha-texto.visivel {
    opacity: 1;
    transform: translateY(0);
}

.linha-texto p {
    font-size: clamp(1.4rem, 3.5vw, 2.2rem);
    line-height: 1.8;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: #fff5f5;
}

/* Primeira linha maior (título) */
.linha-texto[data-linha="0"] p {
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    font-weight: 400;
    margin-bottom: 1rem;
    color: #ffd9e4;
}

.instrucao {
    margin-top: 4rem;
    opacity: 0;
    animation: fadeInInstrucao 1s ease-in-out 5s forwards;
}

.instrucao p {
    font-family: 'Quicksand', sans-serif;
    font-size: clamp(0.75rem, 1.8vw, 0.9rem);
    color: rgba(255, 182, 193, 0.5);
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
}

@keyframes fadeInInstrucao {
    to {
        opacity: 0.8;
    }
}

/* ============================================
   MOMENTOS DA RETROSPECTIVA
   ============================================ */

.momento {
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.momento.ativo {
    display: flex;
    opacity: 1;
}

.momento.saindo {
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

/* ============================================
   MOMENTOS DE TEXTO
   ============================================ */

.momento[data-tipo="texto"] {
    background:
        radial-gradient(ellipse at 30% 70%, rgba(139, 69, 90, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(178, 102, 128, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at center, #251318 0%, #1a0a10 70%);
}

.conteudo-texto {
    text-align: center;
    padding: 3rem 2.5rem;
    max-width: 800px;
    animation: fadeInTexto 1.5s ease-out;
}

@keyframes fadeInTexto {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Data do evento */
.data {
    font-family: 'Quicksand', sans-serif;
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: #e8a0b5;
    margin-bottom: 2.5rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 500;
    position: relative;
    display: inline-block;
}

.data::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e8a0b5, transparent);
}

/* Texto principal do momento */
.texto-momento {
    font-size: clamp(1.35rem, 3.2vw, 1.9rem);
    line-height: 2.2;
    font-weight: 300;
    letter-spacing: 0.3px;
    color: #fff5f5;
    white-space: pre-line;
}

/* Parênteses/comentários em itálico */
.texto-momento br+br {
    display: block;
    content: '';
    margin-top: 1rem;
}

/* Mini imagem dentro do texto */
.mini-imagem {
    display: block;
    max-width: 50%;
    max-height: 250px;
    height: auto;
    margin: 2.5rem auto 0;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border: 4px solid rgba(255, 255, 255, 0.15);
    animation: fadeInImagem 1.5s ease-out;
    object-fit: contain;
}

@media (max-width: 768px) {
    .mini-imagem {
        max-width: 85%;
        max-height: 200px;
        margin-top: 2rem;
        border-width: 3px;
    }
}

/* ============================================
   MOMENTOS DE IMAGEM
   ============================================ */

.momento[data-tipo="imagem"] {
    background: linear-gradient(135deg, #1a0a10 0%, #2d1520 50%, #1a0a10 100%);
}

.conteudo-imagem {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    /* Organiza imagem e legenda verticalmente */
    align-items: center;
    justify-content: center;
    padding-bottom: calc(180px + env(safe-area-inset-bottom, 0px));
    /* Espaço garantido para a legenda */
}

.conteudo-imagem img {
    max-width: 95%;
    max-height: 70%;
    /* Limita a altura da imagem para sobrar espaço embaixo */
    object-fit: contain;
    animation: fadeInImagem 2s ease-out;
    filter: brightness(0.95) contrast(1.02);
    margin-top: -5vh;
    /* Sobe um pouco a imagem para centralizar melhor no espaço útil */
}

@keyframes fadeInImagem {
    from {
        opacity: 0;
        transform: scale(1.03);
        filter: blur(8px);
    }

    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

.legenda-imagem {
    position: absolute;
    bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
    /* Subiu significativamente */
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Quicksand', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: #fff;
    background: rgba(45, 21, 32, 0.9);
    padding: 1rem 1.5rem;
    border-radius: 20px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0.3px;
    animation: fadeInLegenda 1s ease-out 1s both;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 182, 193, 0.2);
    width: 85%;
    max-width: 400px;
    text-align: center;
    z-index: 10;
}

@keyframes fadeInLegenda {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ============================================
   MOMENTOS DE ÁUDIO
   ============================================ */

.momento[data-tipo="audio"] {
    background:
        radial-gradient(ellipse at 40% 60%, rgba(178, 102, 128, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at center, #2d1520 0%, #1a0a10 70%);
}

.conteudo-audio {
    text-align: center;
    padding: 3rem 2.5rem;
    max-width: 650px;
    animation: fadeInTexto 1.5s ease-out;
}

.conteudo-audio .data {
    color: #f0b8c8;
    font-size: clamp(0.9rem, 2.2vw, 1.1rem);
    margin-bottom: 1.5rem;
}

.conteudo-audio .data::after {
    background: linear-gradient(90deg, transparent, #f0b8c8, transparent);
}

.conteudo-audio .texto-momento {
    font-size: clamp(1.2rem, 2.8vw, 1.5rem);
    margin-bottom: 2rem;
    color: #ffe4ec;
}

/* Estilos para o player de áudio personalizado */
.conteudo-audio {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    width: 100%;
}

.custom-audio-player {
    width: 90%;
    max-width: 500px;
    height: 60px;
    border-radius: 30px;
    background: rgba(255, 240, 245, 0.9);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.custom-audio-player:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #8b455a;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.play-btn:hover {
    transform: scale(1.1);
    background: #a65d73;
}

.play-btn .icon-play,
.play-btn .icon-pause {
    color: #fff;
    font-size: 0.8rem;
    line-height: 1;
}

.play-btn .icon-pause {
    display: none;
}

.custom-audio-player.playing .play-btn .icon-play {
    display: none;
}

.custom-audio-player.playing .play-btn .icon-pause {
    display: block;
}

.progress-container {
    flex-grow: 1;
    height: 6px;
    background: #e6c8d1;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: #8b455a;
    border-radius: 3px;
    transition: width 0.1s linear;
}

.time-display {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.8rem;
    color: #5c3a44;
    font-weight: 500;
    min-width: 70px;
    text-align: right;
    white-space: nowrap;
}

/* ============================================
   TELA DE ENCERRAMENTO
   ============================================ */

#tela-encerramento {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(178, 102, 128, 0.2) 0%, transparent 60%),
        radial-gradient(ellipse at center, #2d1520 0%, #1a0a10 70%);
}

#tela-encerramento .conteudo-texto {
    max-width: 700px;
    padding: 2rem;
}

.bloco-texto-longo {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.bloco-texto-longo p {
    font-size: clamp(1.3rem, 3vw, 1.7rem);
    line-height: 1.8;
    color: #fff0f5;
    font-weight: 300;
}

.bloco-final {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.bloco-final p {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    line-height: 1.6;
    color: #fff0f5;
    font-weight: 300;
}

.bloco-final .destaque-final {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    color: #ffd9e4;
    margin-top: 1rem;
    font-weight: 400;
    letter-spacing: 1px;
}

/* ============================================
   RESPONSIVIDADE MOBILE
   ============================================ */

@media (max-width: 768px) {
    .conteudo-inicial {
        padding: 2rem 1.8rem;
    }

    .conteudo-texto,
    .conteudo-audio {
        padding: 2.5rem 1.8rem;
    }

    .linha-texto {
        margin-bottom: 0.6rem;
    }

    .instrucao {
        margin-top: 3rem;
    }

    .legenda-imagem {
        bottom: 4rem;
        padding: 0.7rem 1.4rem;
        font-size: 0.85rem;
        max-width: 90%;
    }

    .texto-momento {
        line-height: 2;
    }

    .data {
        margin-bottom: 2rem;
    }

    .data::after {
        bottom: -10px;
        width: 30px;
    }
}

@media (max-width: 480px) {
    .conteudo-inicial {
        padding: 1.5rem 1.2rem;
    }

    .conteudo-texto,
    .conteudo-audio {
        padding: 2rem 1.2rem;
    }

    .data {
        margin-bottom: 1.8rem;
        letter-spacing: 3px;
    }

    .legenda-imagem {
        bottom: calc(100px + env(safe-area-inset-bottom, 0px));
        /* Posição de segurança absoluta */
        width: 90%;
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }

    .texto-momento {
        line-height: 1.9;
    }

    .linha-texto p {
        line-height: 1.7;
    }
}

/* ============================================
   ANIMAÇÕES DE TRANSIÇÃO
   ============================================ */

/* Efeito de fade suave entre momentos */
.fade-out {
    animation: fadeOut 1s ease-in-out forwards;
}

.fade-in {
    animation: fadeIn 1.5s ease-in-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Desabilita seleção de texto durante a experiência */
.momento,
#tela-inicial {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Scrollbar personalizada (caso apareça em algum momento) */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* ============================================
   CONTROLE DE MÚSICA DE FUNDO
   ============================================ */

.btn-musica {
    position: fixed;
    bottom: calc(2.2rem + env(safe-area-inset-bottom, 0px));
    /* Mais para cima */
    right: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(255, 182, 193, 0.2);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    /* Começa invisível e aparece após iniciar */
    pointer-events: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-musica.visible {
    opacity: 0.8;
    pointer-events: auto;
}

.btn-musica.tocando {
    opacity: 1;
    background: rgba(139, 69, 90, 0.4);
    border-color: rgba(255, 182, 193, 0.4);
    box-shadow: 0 0 20px rgba(139, 69, 90, 0.3);
}

.btn-musica:active {
    transform: scale(0.9);
}

.btn-musica .icone-play,
.btn-musica .icone-pause {
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.3s ease;
}

.btn-musica .icone-pause {
    display: none;
}

.btn-musica.tocando .icone-play {
    display: none;
}

.btn-musica.tocando .icone-pause {
    display: block;
}

@media (max-width: 480px) {
    .btn-musica {
        width: 48px;
        height: 48px;
        bottom: calc(2.2rem + env(safe-area-inset-bottom, 0px));
        right: 1.2rem;
    }
}