/* ==========================================================================
   HOJA DE ESTILOS: CARTA DE CUMPLEAÑOS DE KATHERIN
   Estética: Rich Rose Gold, Velvet Red, Glassmorphism, Micro-animaciones
   ========================================================================== */

:root {
    --primary: #e07a8c;
    --primary-dark: #8b263e;
    --rose-gold: #e8a598;
    --gold: #f3c77c;
    --gold-glow: rgba(243, 199, 124, 0.4);
    --bg-dark: #160a18;
    --bg-gradient: linear-gradient(135deg, #1b0a1d 0%, #2b102c 50%, #160a18 100%);
    --glass-card-bg: rgba(255, 245, 247, 0.92);
    --glass-border: rgba(255, 215, 225, 0.5);
    --text-color: #38222b;
    --text-muted: #6b4d59;
    --shadow-soft: 0 15px 35px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 30px rgba(224, 122, 140, 0.3);
    
    --font-script: 'Dancing Script', cursive;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Outfit', sans-serif;
}

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-dark);
    background-image: var(--bg-gradient);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Canvas de estrellas/corazones */
#sparkles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* Utility classes */
.hidden {
    display: none !important;
}

.center-text {
    text-align: center;
}

.badge-tag {
    display: inline-block;
    background: rgba(224, 122, 140, 0.15);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(224, 122, 140, 0.3);
    margin-bottom: 12px;
}

/* ==========================================================================
   BOTÓN FLOTANTE MÚSICA
   ========================================================================== */
.audio-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

#music-toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 10px 18px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

#music-toggle-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

#music-toggle-btn.playing {
    background: var(--primary-dark);
    border-color: var(--gold);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 10px rgba(224, 122, 140, 0.4); }
    50% { box-shadow: 0 0 22px rgba(224, 122, 140, 0.8); }
    100% { box-shadow: 0 0 10px rgba(224, 122, 140, 0.4); }
}

/* ==========================================================================
   SECCIÓN HERO: SOBRE 3D INTERACTIVO
   ========================================================================== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-block;
    color: var(--gold);
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    color: #ffffff;
    margin-bottom: 10px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #e2c2d4;
    margin-bottom: 40px;
}

/* SOBRE 3D */
.envelope-wrapper {
    perspective: 1000px;
    margin: 30px auto 40px;
    width: 300px;
    height: 200px;
    cursor: pointer;
}

.envelope {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: #8b263e;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    transition: transform 0.5s ease;
}

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

.envelope-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #6a1a2e;
    border-radius: 8px;
}

.envelope-top {
    position: absolute;
    top: 0;
    width: 0;
    height: 0;
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-top: 110px solid #a8324e;
    transform-origin: top;
    transition: transform 0.6s ease 0.2s, z-index 0.2s ease 0.4s;
    z-index: 4;
}

.envelope-front {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 150px solid #7d2037;
    border-right: 150px solid #7d2037;
    border-bottom: 100px solid #912741;
    top: 100px;
    border-radius: 0 0 8px 8px;
    z-index: 3;
}

.letter-preview {
    position: absolute;
    top: 10px;
    left: 15px;
    right: 15px;
    height: 170px;
    background: #fffdf9;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.6s ease 0.4s;
    z-index: 2;
}

.preview-text {
    font-family: var(--font-script);
    font-size: 1.6rem;
    color: var(--primary-dark);
    margin-top: 35px;
    font-weight: 700;
}

.wax-seal {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, #e8b158 0%, #b88228 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a3004;
    font-family: var(--font-serif);
    font-weight: 800;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4), inset 0 2px 4px rgba(255,255,255,0.4);
    z-index: 5;
    transition: all 0.4s ease;
}

/* Animación de apertura del sobre */
.envelope.open .envelope-top {
    transform: rotateX(180deg);
    z-index: 1;
}

.envelope.open .letter-preview {
    transform: translateY(-80px);
    z-index: 3;
}

.envelope.open .wax-seal {
    opacity: 0;
    transform: translateX(-50%) scale(0.5);
}

/* BOTONES */
.btn-primary {
    background: linear-gradient(135deg, #e07a8c 0%, #8b263e 100%);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 40px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(224, 122, 140, 0.4);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 15px 35px rgba(224, 122, 140, 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--gold) 0%, #c4943a 100%);
    color: #3d2804;
    border: none;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 25px;
    box-shadow: 0 8px 20px rgba(223, 177, 91, 0.4);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(223, 177, 91, 0.6);
}

.click-hint {
    margin-top: 15px;
    color: #bfa3b5;
    font-size: 0.9rem;
}

/* ==========================================================================
   SECCIONES Y TARJETA GLASSMORPHISM
   ========================================================================== */
.main-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.main-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.section {
    padding: 60px 0;
}

.glass-card {
    background: var(--glass-card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 45px;
    box-shadow: var(--shadow-soft), var(--shadow-glow);
}

.section-header {
    margin-bottom: 40px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 2.3rem;
    color: #ffffff;
    margin-bottom: 10px;
}

.section-desc {
    color: #d1b5c6;
    font-size: 1.05rem;
}

/* CARTA DE CUMPLEAÑOS */
.card-letter-container {
    max-width: 800px;
    margin: 0 auto;
    background: linear-gradient(180deg, #fffcf9 0%, #fff4f6 100%);
    position: relative;
    overflow: hidden;
}

.card-letter-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--gold), var(--primary), var(--gold));
}

.letter-header {
    text-align: center;
    border-bottom: 1px stroke rgba(224, 122, 140, 0.2);
    padding-bottom: 25px;
    margin-bottom: 30px;
}

.sparkle-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.letter-title {
    font-family: var(--font-serif);
    font-size: 2.4rem;
    color: var(--primary-dark);
}

.date-badge {
    display: inline-block;
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.letter-body {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-color);
}

.letter-greeting {
    font-family: var(--font-script);
    font-size: 2.2rem;
    color: var(--primary-dark);
    margin-bottom: 15px;
    font-weight: 700;
}

.letter-paragraph {
    margin-bottom: 20px;
}

.highlight-box {
    background: rgba(224, 122, 140, 0.08);
    border-left: 4px solid var(--primary);
    padding: 20px;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    font-family: var(--font-serif);
    color: #591b2c;
    position: relative;
}

.quote-icon {
    color: var(--primary);
    font-size: 0.9rem;
    margin: 0 5px;
    opacity: 0.6;
}

.letter-signature {
    margin-top: 40px;
    text-align: right;
}

.sig-title {
    font-size: 1rem;
    color: var(--text-muted);
}

.sig-name {
    font-family: var(--font-script);
    font-size: 2.5rem;
    color: var(--primary-dark);
    font-weight: 700;
}

/* ==========================================================================
   GALERÍA DE FOTOS POLAROID
   ========================================================================== */
.info-photo-banner {
    background: rgba(243, 199, 124, 0.15);
    border: 1px dashed var(--gold);
    color: #fce8c3;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 35px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

.info-photo-banner code {
    background: rgba(0,0,0,0.3);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--gold);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    padding: 10px;
}

.polaroid-card {
    background: #ffffff;
    padding: 15px 15px 20px 15px;
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.tilt-left {
    transform: rotate(-3deg);
}

.tilt-right {
    transform: rotate(3deg);
}

.polaroid-card:hover {
    transform: translateY(-12px) rotate(0deg) scale(1.05);
    box-shadow: 0 20px 35px rgba(224, 122, 140, 0.5);
    z-index: 10;
}

.polaroid-img-wrapper {
    width: 100%;
    height: 230px;
    overflow: hidden;
    border-radius: 2px;
    background: #f0e6eb;
    position: relative;
}

.polaroid-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.polaroid-card:hover .polaroid-img-wrapper img {
    transform: scale(1.1);
}

.polaroid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(139, 38, 62, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.polaroid-card:hover .polaroid-overlay {
    opacity: 1;
}

.polaroid-caption {
    margin-top: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.caption-text {
    font-family: var(--font-script);
    font-size: 1.4rem;
    color: #333;
    font-weight: 700;
}

.caption-date {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==========================================================================
   PASTEL INTERACTIVO
   ========================================================================== */
.cake-box {
    max-width: 700px;
    margin: 0 auto;
    background: rgba(30, 12, 33, 0.85);
}

.interactive-cake {
    width: 200px;
    height: 180px;
    margin: 40px auto 20px;
    position: relative;
    cursor: pointer;
}

.cake-candles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 0 40px;
    z-index: 10;
}

.candle {
    width: 12px;
    height: 45px;
    background: linear-gradient(to right, #ffd1dc, #ff9bb2);
    border-radius: 4px;
    position: relative;
}

.flame {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 20px;
    background: radial-gradient(ellipse at bottom, #ffee55 0%, #ff8800 60%, transparent 100%);
    border-radius: 50% 50% 35% 35%;
    box-shadow: 0 0 15px #ffaa00;
    animation: flicker 0.8s infinite alternate;
    transition: opacity 0.5s ease;
}

.flame.off {
    opacity: 0;
    animation: none;
}

.smoke {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 20px;
    background: rgba(200, 200, 200, 0.6);
    border-radius: 50%;
    filter: blur(4px);
    animation: rise-smoke 1.5s ease-out forwards;
}

@keyframes flicker {
    0% { transform: translateX(-50%) scale(1) rotate(-2deg); }
    100% { transform: translateX(-50%) scale(1.15) rotate(2deg); }
}

@keyframes rise-smoke {
    0% { opacity: 0.8; transform: translateX(-50%) translateY(0) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(2); }
}

.cake-top-frosting {
    position: absolute;
    top: 40px;
    width: 100%;
    height: 30px;
    background: #fff0f3;
    border-radius: 15px 15px 0 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 5;
}

.cake-layer {
    width: 100%;
    background: linear-gradient(135deg, #e07a8c 0%, #9e3650 100%);
    border-radius: 10px;
}

.layer-1 {
    position: absolute;
    top: 65px;
    height: 45px;
}

.layer-2 {
    position: absolute;
    top: 105px;
    height: 55px;
    background: linear-gradient(135deg, #8b263e 0%, #5e1526 100%);
}

.cake-plate {
    position: absolute;
    bottom: 0;
    left: -20px;
    width: 240px;
    height: 18px;
    background: #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.4);
}

.wish-outcome {
    margin-top: 25px;
    padding: 20px;
    background: rgba(223, 177, 91, 0.15);
    border: 1px solid var(--gold);
    border-radius: 16px;
    color: #fff;
    animation: fadeIn 1s ease;
}

.wish-outcome h3 {
    color: var(--gold);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

/* ==========================================================================
   TARJETAS CON DESEOS (FLIP CARDS)
   ========================================================================== */
.flip-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}

.flip-card {
    background-color: transparent;
    height: 220px;
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 20px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.flip-card-front {
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.03) 100%);
    border: 1px solid var(--glass-border);
    color: #fff;
}

.front-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.tap-hint {
    margin-top: 15px;
    font-size: 0.8rem;
    color: var(--gold);
}

.flip-card-back {
    background: linear-gradient(135deg, #8b263e 0%, #4a1120 100%);
    border: 1px solid var(--gold);
    color: #fff;
    transform: rotateY(180deg);
}

.flip-card-back h4 {
    font-family: var(--font-serif);
    color: var(--gold);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.flip-card-back p {
    font-size: 0.92rem;
    line-height: 1.5;
    color: #f7e1eb;
}

/* ==========================================================================
   LIGHTBOX MODAL
   ========================================================================== */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: var(--primary);
}

.lightbox-content {
    max-width: 750px;
    width: 100%;
    background: #fff;
    padding: 15px 15px 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 6px;
}

.lightbox-caption {
    margin-top: 15px;
    font-family: var(--font-script);
    font-size: 1.8rem;
    color: var(--primary-dark);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
    padding: 40px 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 40px;
}

.footer-heart {
    color: #e2c2d4;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.footer-sub {
    color: var(--gold);
    font-family: var(--font-script);
    font-size: 1.6rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.1rem;
    }
    .glass-card {
        padding: 25px;
    }
    .letter-title {
        font-size: 1.8rem;
    }
    .letter-greeting {
        font-size: 1.8rem;
    }
    .envelope-wrapper {
        width: 260px;
        height: 170px;
    }
    .envelope-top {
        border-left-width: 130px;
        border-right-width: 130px;
        border-top-width: 95px;
    }
    .envelope-front {
        border-left-width: 130px;
        border-right-width: 130px;
        border-bottom-width: 85px;
        top: 85px;
    }
}
