body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: #333;
    overflow: hidden;
    position: relative;
}

#backgroundVideo {
    position: fixed;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -100;
    background-size: contain;
    filter: brightness(0.7);

    /* Novas propriedades para centralizar o vídeo */
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    object-fit: cover; /* Garante que o vídeo cubra toda a área e se ajuste */
}

.container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

/* --- Página Inicial (com a imagem do envelope) --- */
.initial-page {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 1s ease-out;
}

.initial-page.fade-out {
    opacity: 0;
    pointer-events: none;
}

.clickable-image-container {
    position: relative;
    width: 350px;
    height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.0);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease-in-out;
    -webkit-tap-highlight-color: transparent;
}

.clickable-image-container:hover {
    transform: translateY(-10px);
}

.clickable-image-container:active {
    outline: none;
    background-color: transparent;
}

@keyframes float {
    0% { transform: translate(0, 0px); }
    50% { transform: translate(0, 15px); }
    100% { transform: translate(0, 0px); }
}

.initial-envelope-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    animation: float 3s ease-in-out infinite;
    transition: transform 1s ease-out, opacity 1s ease-out;
}

.initial-envelope-image.zoom-fade-out {
    transform: scale(3);
    opacity: 0;
}

.click-text {
    position: relative;
    z-index: 2;
    font-size: 1.5em;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    background-color: rgba(0, 0, 0, 0.4);
    padding: 10px 20px;
    border-radius: 5px;
}

/* --- Página de Detalhes do Convite --- */
.invite-details-page {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #fff;
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.invite-details-page.hidden {
    display: none;
}

.invite-details-page.visible {
    opacity: 1;
    transform: scale(1);
}

.invite-details-page .content {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.09);
    max-width: 800px;
    animation: fadeInScale 1s ease-out forwards;
    z-index: 1;
}

.invite-details-page h1 {
    font-size: 3em;
    color: #ffffff;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-family: "Fraunces", serif;
}

.invite-details-page .message {
    font-size: 1.4em;
    margin-bottom: 10px;
    font-family: "Papyrus", fantasy;
}

.invite-details-page .message2 {
    font-size: 1.4em;
    margin-bottom: 15px;
    font-family: "Papyrus", fantasy;
}

.invite-details-page .name {
    font-size: 1.8em;
    font-weight: bold;
    color: #ffffff;
    margin-top: 20px;
    font-family: "Fraunces", serif;
}

.invite-details-page .save {
    font-size: 20.0em;
    font-weight: normal;
    color: #ffffff;
    margin-top: 20px;
    font-family: "COPPERPLATE Gothic Light", fantasy;
}

.invite-details-page .save2 {
    font-size: 2.0em;
    font-weight: normal;
    color: #ffffff;
    margin-top: 20px;
    font-family: "COPPERPLATE Gothic Light", fantasy;
}

.invite-details-page .buttons {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.invite-details-page button {
    background-color: #081534;
    color: white;
    font-family: "Papyrus", fantasy;
    border: none;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    -webkit-tap-highlight-color: transparent;
}

.invite-details-page button:hover {
    background-color: #081534;
    transform: translateY(-3px);
}

/* --- Popups --- */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    text-align: center;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;

    max-height: 80vh; /* Define uma altura máxima para o popup */
    overflow-y: auto; /* Permite rolagem dentro do popup se o conteúdo exceder max-height */
}

.popup-overlay.visible .popup-content {
    transform: scale(1);
}

.popup-content .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2em;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s ease;
}

.popup-content .close-btn:hover {
    color: #555;
}

.popup-content h2 {
    color: #081534;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.popup-content p {
    color: #333;
    line-height: 1.2;
    font-size: 1.1em;
}

.invite-details-page .content .logo-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 3px solid #081534;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Classes utilitárias */
.hidden {
    display: none;
}

/* Animações */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Media Queries para responsividade */
@media (max-width: 768px) {
    .clickable-image-container {
        width: 280px;
        height: 200px;
    }
    .click-text {
        font-size: 1.2em;
    }
    .invite-details-page .content {
        padding: 20px;
        max-width: 90%;
    }
    .invite-details-page h1 {
        font-size: 2.2em;
    }
    .invite-details-page .message {
        font-size: 1.2em;
    }
    .invite-details-page .name {
        font-size: 1.5em;
    }
    .invite-details-page button {
        padding: 12px 20px;
        font-size: 1em;
    }
    .popup-content {
        max-width: 90%;
        padding: 15px;
    }
}

@media (max-width: 330px) { /* Exemplo: Para telas abaixo de 330px, pode voltar para 1 coluna */
    #photoGallery {
        grid-template-columns: 1fr; /* Força 1 coluna em telas muito pequenas */
        gap: 5px;
    }
    .gallery-item {
        padding: 5px;
    }
    .gallery-item img {
        max-height: 120px; /* Pode aumentar a altura da imagem em 1 coluna */
    }
}


#photoGallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); /* Force 2 colunas */
    gap: 10px; /* Ajuste o gap para algo um pouco menor em telas menores, se necessário */
    margin-top: 20px;
    justify-content: center;
}


.gallery-item {
    background-color: white;
    padding: 5px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0; /* Certifique-se que o gap é zero */
}


.gallery-item img {
    width: 100%; /* Define a largura da imagem para 60% do contêiner (.gallery-item) */
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    max-height: 160px; /* Mantém uma altura máxima para as imagens */
    margin-bottom: 8px; /* Adiciona um pequeno espaço entre a imagem e o nome */
}

.gallery-item strong {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 0.9em;
    margin: 0; /* Remove todas as margens (top, right, bottom, left) */
    padding: 0; /* Remove todo o padding */
    line-height: 0; /* Definir line-height para 1 (semelhante ao font-size) */
}

.gallery-item small {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 0.75em;
    color: #777;
    margin: 0; /* Remove todas as margens */
    padding: 0; /* Remove todo o padding */
    line-height: 0; /* Definir line-height para 1 */
}

.gallery-tabs {
    display: flex;
    margin-bottom: 10px;
    border-bottom: 1px solid #ccc;
}

.gallery-tabs .tab {
    padding: 10px 15px;
    border: none;
    background-color: #f9f9f9;
    cursor: pointer;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    border-bottom: none;
    margin-right: 5px;
}

.gallery-tabs .tab.active {
    background-color: #fff;
    border-bottom: 2px solid #081534; /* Cor da borda ativa */
}

.tab-content {
    padding: 15px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-top: none;
}

.tab-content.hidden {
    display: none;
}

.tab-content.visible {
    display: block;
}

