/* Plantilla «Cumpleaños - Regalo sorpresa» · estilo azul (hombre). Lo elige el cliente (event_details.style). */
/* Custom Properties - Paleta de Azules Profundos, Plateados y Blancos */
:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e3a8a 40%, #1e40af 100%);
    --font-handwritten: 'Great Vibes', cursive;
    --font-sans: 'Montserrat', sans-serif;
    --gold: #38bdf8; /* Reemplazado por un tono Azul Cielo Brillante / Neón */
    --gold-glow: rgba(56, 189, 248, 0.35);
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.18);
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-gradient);
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #f8fafc;
}

/* Overlays y Contenedores */
.overlay {
    position: fixed;
    inset: 0;
    background: #07122e;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.8s ease, transform 0.8s ease;
    padding: 1rem;
}

.overlay.fade-out {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.05);
}

.picture_g {
    position: fixed;
    width: 100%;
}
.picture_g picture {
    display: flex;
    width: 7rem;
    height: 7rem;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 3px solid var(--gold);
    position: absolute;
    top: -15rem;
    right: calc(50% - 3.5rem);
}
.picture_g picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.welcome-box {
    text-align: center;
    padding: 5rem 2.5rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.welcome-box h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 300;
    color: #ffffff;
}

.welcome-box p {
    color: #93c5fd;
    margin-bottom: 2rem;
    font-weight: 300;
}

/* Tarjeta Principal (Glassmorphism) */
#main-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
    width: 90%;
    max-width: 480px;
    z-index: 10;
}

#main-content.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.hidden {
    display: none !important;
}

.card-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px); /* Fix para iOS Safari */
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 
                0 0 40px var(--gold-glow);
    position: relative;
}

/* Tipografías */
.title-main {
    font-family: var(--font-handwritten);
    font-size: clamp(3rem, 5.3vw, 4.5rem);
    color: var(--gold);
    text-shadow: 0 2px 10px rgba(56, 189, 248, 0.4);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.title-name {
    font-size: clamp(2rem, 5vw, 2.5rem);
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #ffffff, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.message,
.message-cm {
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 300;
}
.message {
    color: #e0f2fe;
}
.message-cm {
    margin-top: 1rem;
}
.message-cm.sign {
    margin-top: .5rem;
    text-align: right;
    font-size: .8rem;
    color: #93c5fd;
}

/* Botones */
.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-family: var(--font-sans);
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
}

.btn-audio {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    border: 1px solid var(--glass-border);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    transition: background 0.3s;
}

.btn-audio:hover {
    background: #1e293b;
}

.icon-audio {
    font-size: 1.2rem;
}

/* Globos Dinámicos */
#balloon-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.balloon {
    position: absolute;
    bottom: -150px;
    width: 60px;
    height: 75px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    cursor: pointer;
    pointer-events: auto;
    animation: floatUp 10s linear infinite;
}

/* El hilo del globo */
.balloon::after {
    content: "";
    position: absolute;
    bottom: -12px;
    left: 29px;
    width: 2px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.4);
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        transform: translateY(-120vh) rotate(10deg);
        opacity: 0;
    }
}

/* Galería de fotos (extra) */
.images {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 92px;
    gap: 0.65rem;
    width: min(100%, 720px);
    margin-top: 15rem;
    margin-right: auto;
    margin-left: auto;
}

.memory-photo {
    display: block;
    position: relative;
    overflow: hidden;
    min-width: 0;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.25);
    cursor: zoom-in;
    opacity: 0;
    transform: translateY(24px);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.memory-photo.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease, box-shadow 0.25s ease;
}

.memory-photo:hover,
.memory-photo:focus-visible {
    z-index: 1;
    transform: translateY(-4px) rotate(1deg);
    box-shadow: 0 14px 24px rgba(2, 6, 23, 0.35);
    outline: none;
}

.memory-photo:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

.memory-photo:nth-child(6n + 2),
.memory-photo:nth-child(6n + 5) {
    grid-row: span 2;
}

.memory-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.memory-photo:hover img,
.memory-photo:focus-visible img {
    transform: scale(1.08);
}

.photo-viewer {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(7, 18, 46, 0.9);
    cursor: zoom-out;
}

.photo-viewer[hidden] {
    display: none;
}

.photo-viewer img {
    max-width: min(920px, 92vw);
    max-height: 88vh;
    border: 3px solid rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    object-fit: contain;
}

.photo-viewer__button {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 50%;
    background: rgba(30, 64, 175, 0.78);
    color: #ffffff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.2s ease, transform 0.2s ease;
}

.photo-viewer__button:hover,
.photo-viewer__button:focus-visible {
    background: #1d4ed8;
    outline: none;
    transform: translateY(-50%) scale(1.08);
}

.photo-viewer__button--previous {
    left: max(1rem, calc(50% - 470px));
}

.photo-viewer__button--next {
    right: max(1rem, calc(50% - 470px));
}

@media (max-width: 560px) {
    #main-content {
        margin-top: 13vh;
    }

    .images {
        grid-auto-rows: 72px;
        gap: 0.45rem;
    }

    .photo-viewer {
        padding: 1rem 3.75rem;
    }

    .photo-viewer__button {
        width: 2.6rem;
        height: 2.6rem;
    }

    .photo-viewer__button--previous {
        left: 0.65rem;
    }

    .photo-viewer__button--next {
        right: 0.65rem;
    }

    .memory-photo {
        border-radius: 10px;
    }
}

