/* Paleta de Cores e Fontes */
:root {
    --bg-color: #FFF0F5; /* Rosa Pastel */
    --text-main: #4A4A4A;
    --text-light: #7A7A7A;
    --pink-light: #FFB6C1;
    --pink-mid: #FF69B4;
    --red-passion: #E63946; /* Vermelho apaixonado mas elegante */
    --white: #FFFFFF;
    
    --font-title: 'Dancing Script', cursive;
    --font-text: 'Montserrat', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-text);
    overflow-x: hidden; /* Evita rolagem horizontal */
    scroll-behavior: smooth;
    position: relative;
}

body.locked {
    overflow: hidden; /* Bloqueia rolagem até clicar no botão */
}

/* --- Efeitos de Fundo: Corações Flutuantes --- */
#hearts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.heart {
    position: absolute;
    top: -10vh;
    font-size: 20px;
    color: var(--pink-light);
    opacity: 0.6;
    animation: fall linear infinite;
}

@keyframes fall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0;
    }
}

/* --- Tipografia Geral --- */
.romantic-title {
    font-family: var(--font-title);
    color: var(--red-passion);
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.05);
}

.light-text {
    color: var(--white);
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* --- Tela de Início (Overlay) --- */
#start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(255, 240, 245, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s ease, visibility 1s ease;
    backdrop-filter: blur(8px); /* Efeito Glassmorphism */
}

#start-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

.romantic-btn {
    background: linear-gradient(45deg, var(--pink-mid), var(--red-passion));
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1rem;
    font-family: var(--font-text);
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(230, 57, 70, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulse 2s infinite;
    max-width: 90%;
    line-height: 1.4;
    text-align: center;
}

.romantic-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(230, 57, 70, 0.5);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* --- Player de Música --- */
#music-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    transition: opacity 0.5s ease;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    display: none !important;
}

.music-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid var(--pink-light);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-btn:hover {
    transform: scale(1.1) rotate(10deg);
}

/* --- Seções Gerais --- */
main {
    position: relative;
    z-index: 1;
}

section {
    min-height: 100vh;
    padding: 80px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Seção 1: Hero --- */
.hero-image-container {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    overflow: hidden;
    border: 8px solid var(--white);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    margin: 0 auto 40px;
    position: relative;
}

.heartbeat {
    animation: heartbeat 2s infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.03); }
    30% { transform: scale(1); }
    45% { transform: scale(1.03); }
    60% { transform: scale(1); }
}

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

/* Contador */
.counter-container {
    background: rgba(255, 255, 255, 0.65);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    text-align: center;
    max-width: 850px;
    width: 100%;
}

.counter-text {
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 20px;
    font-weight: 500;
    letter-spacing: 1px;
}

.time-counter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.time-box {
    position: relative;
    background: rgba(255, 182, 193, 0.1);
    backdrop-filter: blur(5px);
    padding: 20px 25px;
    border-radius: 20px;
    min-width: 100px;
    border: 1px solid rgba(255, 105, 180, 0.3);
    box-shadow: 0 8px 25px rgba(220, 20, 60, 0.15);
    transition: transform 0.3s ease, border-color 0.3s ease;
    overflow: hidden;
}

.time-box:hover {
    transform: translateY(-5px) scale(1.03);
    border-color: rgba(255, 105, 180, 0.8);
}

.time-box::before {
    content: "❤️";
    position: absolute;
    top: -15px;
    right: -15px;
    font-size: 4rem;
    opacity: 0.08;
    transform: rotate(20deg);
    pointer-events: none;
}

.time-box span {
    display: block;
    font-size: 2.8rem;
    font-weight: 700;
    color: #ff4d6d;
    line-height: 1;
    margin-bottom: 8px;
    font-family: var(--font-title);
    text-shadow: 0 0 10px rgba(255, 77, 109, 0.2);
    position: relative;
    z-index: 2;
}

.time-box p {
    font-size: 0.85rem;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

.time-box p::after {
    content: "💕";
    position: absolute;
    margin-left: 5px;
    font-size: 0.8rem;
    opacity: 0.8;
}

.scroll-indicator {
    margin-top: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-light);
    font-weight: 500;
    animation: bounce 2s infinite;
}

.arrow-down {
    width: 15px;
    height: 15px;
    border-right: 3px solid var(--pink-mid);
    border-bottom: 3px solid var(--pink-mid);
    transform: rotate(45deg);
    margin-top: 10px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
    60% { transform: translateY(-7px); }
}

/* --- Envelope Interativo --- */
.envelope-container {
    margin-top: 50px;
    width: 320px;
    max-width: 90vw;
    height: 220px;
    position: relative;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.3s ease;
}

.envelope-container:hover {
    transform: translateY(-5px);
}

.envelope {
    position: relative;
    width: 100%;
    height: 100%;
    background: #ff4d6d; /* Darker inside */
    border-radius: 8px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.envelope-paper {
    position: absolute;
    top: 10px;
    left: 5%;
    width: 90%;
    height: 190px;
    background: #fff;
    border-radius: 5px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    z-index: 2; /* Below flap and front initially */
    transition: transform 0.6s ease 0.2s, height 0.6s ease 0.2s, z-index 0s ease 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.envelope-paper p {
    font-family: var(--font-title);
    font-size: 1.35rem;
    line-height: 1.3;
    color: var(--text-main);
    opacity: 0;
    transition: opacity 0.4s ease 0.6s;
    max-height: 100%;
    overflow-y: auto;
}
/* Scrollbar customizado para o papel da carta */
.envelope-paper p::-webkit-scrollbar {
    width: 4px;
}
.envelope-paper p::-webkit-scrollbar-thumb {
    background: var(--pink-light);
    border-radius: 4px;
}

.envelope-front-left {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #ff8fa3;
    clip-path: polygon(0 0, 50% 55%, 0 100%);
    z-index: 3;
    border-radius: 0 0 0 8px;
}
.envelope-front-right {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #ff9ebb;
    clip-path: polygon(100% 0, 100% 100%, 50% 55%);
    z-index: 3;
    border-radius: 0 0 8px 0;
}
.envelope-front-bottom {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #ffb3c6;
    clip-path: polygon(0 100%, 50% 55%, 100% 100%);
    z-index: 4; /* Above sides */
    border-radius: 0 0 8px 8px;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ff758f;
    clip-path: polygon(0 0, 100% 0, 50% 60%);
    z-index: 5; /* Above everything */
    transform-origin: top;
    transition: transform 0.6s ease, z-index 0s ease 0.6s;
    border-radius: 8px 8px 0 0;
}

.envelope-label {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-text);
    font-weight: 600;
    color: var(--white);
    font-size: 1.2rem;
    z-index: 6;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    pointer-events: none;
    transition: opacity 0.3s ease;
    width: 100%;
    text-align: center;
}

/* Animations for open state */
.envelope-container.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 1; /* Goes behind paper */
    transition: transform 0.6s ease, z-index 0s ease 0.3s; 
}

.envelope-container.open .envelope-paper {
    transform: translateY(-240px);
    height: 420px;
    z-index: 6; /* Pops above everything */
    transition: transform 0.6s ease 0.3s, height 0.6s ease 0.3s, z-index 0s ease 0.3s;
}

.envelope-container.open .envelope-paper p {
    opacity: 1;
}

.envelope-container.open .envelope-label {
    opacity: 0;
}

/* --- Seção 2: Galeria Polaroid --- */
.section-subtitle {
    font-family: var(--font-title);
    font-size: 2.2rem;
    color: var(--pink-mid);
    text-align: center;
    margin-bottom: 30px;
    max-width: 800px;
    line-height: 1.2;
}

.polaroid-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 40px;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

.polaroid {
    background: var(--white);
    padding: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    border-radius: 8px;
    border: 1px solid rgba(255, 182, 193, 0.3);
}

.polaroid:nth-child(even) {
    transform: rotate(3deg);
}

.polaroid:nth-child(odd) {
    transform: rotate(-3deg);
}

.polaroid:hover {
    transform: rotate(0deg) scale(1.08);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    z-index: 10;
}

.polaroid img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 4px;
}

/* --- Seção 3: Marquee (Carrossel Contínuo) --- */
.marquee-container {
    width: 100%;
    max-width: 1000px;
    overflow: hidden;
    padding: 20px 0;
    margin-bottom: 30px;
    position: relative;
    /* Sombras laterais para dar ideia de profundidade */
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-track {
    display: flex;
    gap: 20px;
    width: max-content;
    animation: scroll-left 50s linear infinite;
}

.marquee-track:hover {
    animation-play-state: paused;
}

@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 10px)); }
}

.call-img {
    width: 250px;
    height: 450px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transition: transform 0.4s ease;
}

.call-img:hover {
    transform: scale(1.05);
}

.calls-caption {
    font-family: var(--font-title);
    font-size: 2.2rem;
    color: var(--red-passion);
    text-align: center;
    max-width: 700px;
    line-height: 1.4;
    margin-top: 20px;
}

/* --- Seção 4: O Grande Final --- */
#finale {
    position: relative;
    /* Fundo escuro e elegante para dar destaque às alianças */
    background: linear-gradient(135deg, #3A000D, #7A0A21);
    color: var(--white);
    overflow: hidden;
}

.dark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0) 0%, rgba(0,0,0,0.5) 100%);
    pointer-events: none;
}

.finale-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
}

.ring-container {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    overflow: hidden;
    margin: 40px 0;
    border: 6px solid rgba(255, 255, 255, 0.4);
    position: relative;
}

.reveal-glow {
    /* Efeito de brilho que pulsa lentamente */
    box-shadow: 0 0 40px rgba(255, 182, 193, 0.6), 0 0 80px rgba(230, 57, 70, 0.4);
    animation: glow-pulse 3s infinite alternate;
}

@keyframes glow-pulse {
    0% { box-shadow: 0 0 30px rgba(255, 182, 193, 0.5), 0 0 60px rgba(230, 57, 70, 0.3); }
    100% { box-shadow: 0 0 60px rgba(255, 182, 193, 0.8), 0 0 100px rgba(230, 57, 70, 0.6); }
}

.ring-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.95;
    transition: transform 0.5s ease;
}

.ring-container:hover .ring-img {
    transform: scale(1.1);
}

.love-letter {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    font-family: var(--font-title);
    font-size: 1.8rem;
    line-height: 1.6;
    color: #FFF0F5;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    width: 100%;
}

.love-letter p {
    margin-bottom: 25px;
}

.love-letter strong {
    font-size: 2.2rem;
    color: var(--pink-light);
}

/* --- Responsividade (Smartphones) --- */
@media (max-width: 768px) {
    .romantic-title {
        font-size: 2.5rem;
    }
    
    .hero-image-container {
        width: 220px;
        height: 220px;
    }

    .time-counter {
        gap: 10px;
    }

    .time-box {
        min-width: 80px;
        padding: 12px;
    }
    
    .time-box span {
        font-size: 2rem;
    }

    .call-img {
        width: 200px;
        height: 350px;
    }
    
    .calls-caption {
        font-size: 1.8rem;
    }
    
    .love-letter {
        padding: 30px 20px;
        font-size: 1.5rem;
    }

    .love-letter strong {
        font-size: 1.8rem;
    }
    
    .ring-container {
        width: 250px;
        height: 250px;
    }
}
