/* ====================================================================
   Romantic Proposal Website - High-End Luxury Editorial Styling
   ==================================================================== */

:root {
    --primary-rose: #e11d48;
    --rose-gold: #f3c5b8;
    --accent-gold: #e6b87d;
    --accent-champagne: #fae8df;
    --bg-dark: #07030a;
    --card-glass: rgba(18, 8, 22, 0.72);
    --card-border: rgba(244, 114, 182, 0.18);
    --glow-rose: rgba(225, 29, 72, 0.25);
    --glow-gold: rgba(230, 184, 125, 0.25);
}

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

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(76, 11, 35, 0.45) 0px, transparent 55%),
        radial-gradient(at 100% 10%, rgba(95, 15, 48, 0.35) 0px, transparent 55%),
        radial-gradient(at 50% 60%, rgba(136, 19, 55, 0.25) 0px, transparent 65%),
        radial-gradient(at 80% 100%, rgba(45, 6, 26, 0.6) 0px, transparent 60%);
    background-attachment: fixed;
    color: #fdfbf7;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Luxury Typography Classes */
.font-editorial {
    font-family: 'Cormorant Garamond', Garamond, Georgia, serif;
}

.font-display {
    font-family: 'Cinzel', 'Playfair Display', serif;
}

.font-calligraphy {
    font-family: 'Pinyon Script', 'Alex Brush', cursive;
}

.font-sans-ui {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* Background Particle & Fireworks Canvases */
#heartsCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

#fireworksCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Luxury Glassmorphism Panels */
.glass-panel {
    background: var(--card-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.glass-panel-glow {
    background: rgba(22, 9, 28, 0.78);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(244, 114, 182, 0.28);
    box-shadow: 0 0 50px var(--glow-rose), 0 30px 60px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Luxury Editorial Story Cards (Replacing generic polaroid) */
.editorial-story-card {
    background: rgba(18, 8, 23, 0.82);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(243, 197, 184, 0.22);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.65), 0 0 25px rgba(225, 29, 72, 0.08);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.editorial-story-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(230, 184, 125, 0.6), transparent);
}

.editorial-story-card:hover {
    transform: translateY(-8px);
    border-color: rgba(243, 197, 184, 0.5);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(225, 29, 72, 0.25);
}

.editorial-story-card img {
    border-radius: 14px;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.editorial-story-card:hover img {
    transform: scale(1.04);
}

/* Animations */
@keyframes floatGentle {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-8px) rotate(0.8deg);
    }
}

.animate-float {
    animation: floatGentle 6s ease-in-out infinite;
}

@keyframes heartPulse {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.12);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.08);
    }
    70% {
        transform: scale(1);
    }
}

.animate-pulse-heart {
    animation: heartPulse 1.8s ease-in-out infinite;
}

/* ====================================================================
   Envelope 3D Intro Styles (Bespoke Luxury Matte Velvet Finish)
   ==================================================================== */
.envelope-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #1b0616 0%, #070209 100%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 1.3s cubic-bezier(0.65, 0, 0.35, 1), visibility 1.3s;
}

.envelope-overlay.opened {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.envelope-wrapper {
    position: relative;
    cursor: pointer;
    perspective: 1200px;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 94vw;
}

@media (max-width: 360px) {
    .envelope-wrapper {
        transform: scale(0.86);
        transform-origin: center center;
    }
}

@media (max-width: 320px) {
    .envelope-wrapper {
        transform: scale(0.76);
        transform-origin: center center;
    }
}

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

.envelope {
    position: relative;
    width: 320px;
    height: 220px;
    background: #4a0d1e;
    border-radius: 12px;
    border: 1px solid rgba(230, 184, 125, 0.3);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.85), 0 0 35px rgba(225, 29, 72, 0.25);
}

@media (min-width: 640px) {
    .envelope {
        width: 440px;
        height: 290px;
    }
}

.envelope::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    border-top: 130px solid #631229;
    transform-origin: top;
    transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
}

@media (min-width: 640px) {
    .envelope::before {
        border-left-width: 220px;
        border-right-width: 220px;
        border-top-width: 165px;
    }
}

.envelope-opened .envelope::before {
    transform: rotateX(180deg);
    z-index: 1;
}

.envelope-pockets {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 12px;
    z-index: 4;
    pointer-events: none;
}

.envelope-pocket-left {
    position: absolute;
    bottom: 0;
    left: 0;
    border-left: 160px solid #3d0917;
    border-top: 110px solid transparent;
    border-bottom: 110px solid transparent;
}

@media (min-width: 640px) {
    .envelope-pocket-left {
        border-left-width: 220px;
        border-top-width: 145px;
        border-bottom-width: 145px;
    }
}

.envelope-pocket-right {
    position: absolute;
    bottom: 0;
    right: 0;
    border-right: 160px solid #3d0917;
    border-top: 110px solid transparent;
    border-bottom: 110px solid transparent;
}

@media (min-width: 640px) {
    .envelope-pocket-right {
        border-right-width: 220px;
        border-top-width: 145px;
        border-bottom-width: 145px;
    }
}

.envelope-pocket-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    border-bottom: 120px solid #340713;
}

@media (min-width: 640px) {
    .envelope-pocket-bottom {
        border-left-width: 220px;
        border-right-width: 220px;
        border-bottom-width: 160px;
    }
}

/* Metallic Gold Foil Wax Seal */
.wax-seal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 68px;
    background: radial-gradient(circle, #fde28a 0%, #d49a3b 70%, #8c5d14 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7), inset 0 2px 4px rgba(255, 255, 255, 0.6), inset 0 -3px 6px rgba(0, 0, 0, 0.5);
    z-index: 10;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

.wax-seal:hover {
    transform: translate(-50%, -50%) scale(1.12);
    filter: drop-shadow(0 0 16px rgba(253, 226, 138, 0.9));
}

.wax-seal::after {
    content: '❤';
    font-size: 26px;
    color: #451a03;
    filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.4));
}

/* ====================================================================
   Interactive 3D Cartier-Style Velvet Ring Box
   ==================================================================== */
.ring-box-container {
    perspective: 1200px;
    width: 200px;
    height: 190px;
    margin: 0 auto;
    cursor: pointer;
}

.ring-box {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.ring-box:hover {
    transform: translateY(-4px) scale(1.04);
}

.box-base {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    height: 75px;
    background: linear-gradient(145deg, #380715, #140207);
    border-radius: 16px;
    border: 1.5px solid #d49a3b;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85), inset 0 2px 6px rgba(253, 226, 138, 0.35);
}

.box-lid {
    position: absolute;
    bottom: 68px;
    left: 15px;
    right: 15px;
    height: 65px;
    background: linear-gradient(145deg, #4d0b1f, #22030d);
    border-radius: 16px 16px 4px 4px;
    border: 1.5px solid #d49a3b;
    transform-origin: bottom center;
    transition: transform 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.7);
    z-index: 5;
}

.ring-box.open .box-lid {
    transform: rotateX(115deg) translateY(-28px);
}

.diamond-ring {
    position: absolute;
    bottom: 45px;
    left: 50%;
    transform: translateX(-50%) scale(0.6);
    opacity: 0;
    transition: all 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s;
    font-size: 58px;
    filter: drop-shadow(0 0 16px rgba(253, 226, 138, 0.9));
}

.ring-box.open .diamond-ring {
    opacity: 1;
    transform: translateX(-50%) translateY(-28px) scale(1.15);
    animation: ringGlow 2.5s infinite alternate ease-in-out;
}

@keyframes ringGlow {
    0% {
        filter: drop-shadow(0 0 14px rgba(253, 226, 138, 0.85));
    }
    100% {
        filter: drop-shadow(0 0 32px rgba(255, 255, 255, 1)) drop-shadow(0 0 50px rgba(244, 114, 182, 0.8));
    }
}

/* ====================================================================
   The Decision Buttons ("YES" and Runaway "No")
   ==================================================================== */
#btnYes {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

#btnYes::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: rotate(30deg);
    transition: all 0.8s ease;
}

#btnYes:hover::after {
    left: 100%;
}

#btnNo {
    transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2), left 0.3s ease, top 0.3s ease;
    user-select: none;
    touch-action: none;
}

/* Bespoke Luxury Manuscript / Parchment Letter */
.parchment {
    background: #fdfaf5;
    color: #29151c;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(255, 250, 242, 0.6) 0%, rgba(243, 233, 220, 0.9) 100%);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), inset 0 0 80px rgba(200, 160, 120, 0.2);
    border: 1px solid #dfcfbc;
    position: relative;
}

.parchment::before, .parchment::after {
    content: '❦';
    position: absolute;
    font-size: 26px;
    color: #9f1239;
    opacity: 0.35;
}
.parchment::before { top: 16px; left: 20px; }
.parchment::after { bottom: 16px; right: 20px; }

/* Audio Player Floating Capsule */
.music-pill {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(22, 8, 26, 0.82);
    border: 1px solid rgba(243, 197, 184, 0.25);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6);
}

.spinning-vinyl {
    animation: spin 5s linear infinite;
}

.spinning-vinyl.paused {
    animation-play-state: paused;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #07030a;
}
::-webkit-scrollbar-thumb {
    background: #4c0d20;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #e11d48;
}

/* ====================================================================
   Top Reading Progress Bar
   ==================================================================== */
#scrollProgressBar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #e11d48, #f43f5e, #ffd166);
    z-index: 99999;
    width: 0%;
    transition: width 0.15s ease-out;
    box-shadow: 0 0 10px rgba(225, 29, 72, 0.8);
}

/* Equalizer Soundwave Bars */
.soundwave {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.soundwave-bar {
    width: 2.5px;
    background: #f43f5e;
    border-radius: 2px;
    animation: soundwaveAnim 1.2s ease-in-out infinite;
}

.soundwave-bar:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.soundwave-bar:nth-child(2) { height: 80%; animation-delay: 0.3s; }
.soundwave-bar:nth-child(3) { height: 60%; animation-delay: 0.2s; }
.soundwave-bar:nth-child(4) { height: 100%; animation-delay: 0.4s; }

.soundwave.paused .soundwave-bar {
    animation-play-state: paused;
    height: 25% !important;
}

@keyframes soundwaveAnim {
    0%, 100% { height: 25%; }
    50% { height: 100%; }
}

/* ====================================================================
   "Open When..." Virtual Love Envelopes
   ==================================================================== */
.open-when-card {
    background: rgba(22, 9, 28, 0.75);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(243, 197, 184, 0.22);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.open-when-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: rgba(243, 197, 184, 0.55);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(225, 29, 72, 0.2);
}

.open-when-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d49a3b, transparent);
}

.mini-wax-seal {
    width: 38px;
    height: 38px;
    background: radial-gradient(circle, #fde28a 0%, #d49a3b 70%, #8c5d14 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.5);
    color: #451a03;
    font-size: 14px;
}

/* ====================================================================
   Photo Lightbox Modal
   ==================================================================== */
#photoLightboxModal {
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

#photoLightboxModal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#photoLightboxModal:not(.hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ====================================================================
   Royal Certificate of Eternal Devotion
   ==================================================================== */
.certificate-frame {
    background: #fffefb;
    color: #1f0814;
    border: 3px double #d49a3b;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), inset 0 0 70px rgba(230, 184, 125, 0.18);
    position: relative;
    border-radius: 24px;
    padding: 24px 16px;
}

@media (min-width: 640px) {
    .certificate-frame {
        padding: 40px 32px;
    }
}

.certificate-inner-border {
    border: 1px dashed rgba(180, 120, 60, 0.45);
    padding: 20px 12px;
    border-radius: 16px;
    position: relative;
}

@media (min-width: 640px) {
    .certificate-inner-border {
        padding: 28px 24px;
    }
}

.cert-corner {
    position: absolute;
    width: 22px;
    height: 22px;
    font-size: 15px;
    color: #c98a2c;
    line-height: 1;
}
.cert-corner.top-left { top: 6px; left: 6px; }
.cert-corner.top-right { top: 6px; right: 6px; }
.cert-corner.bottom-left { bottom: 6px; left: 6px; }
.cert-corner.bottom-right { bottom: 6px; right: 6px; }

.gold-wax-seal-badge {
    width: 62px;
    height: 62px;
    background: radial-gradient(circle, #fde28a 0%, #d49a3b 70%, #8c5d14 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.6);
    position: relative;
    margin: 0 auto;
}

.gold-wax-seal-badge::before {
    content: 'FOREVER';
    font-size: 8px;
    font-family: 'Cinzel', serif;
    letter-spacing: 2px;
    color: #451a03;
    font-weight: 700;
}

/* ====================================================================
   High-Res Print Certificate Styling
   ==================================================================== */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    #heartsCanvas, #fireworksCanvas, #envelopeOverlay, #mainContent, 
    .music-pill, header, footer, #btnNo, #btnYes, .no-print,
    #photoLightboxModal, #openWhenModal, #closeCelebrationBtn,
    #floatingCertBtn, #loveNoteForm, #noteFeedback, #printCertBtn,
    a[href*="whatsapp"] {
        display: none !important;
    }
    #celebrationModal {
        position: static !important;
        display: block !important;
        background: white !important;
        opacity: 1 !important;
        padding: 0 !important;
    }
    #printableCertificate {
        border: 4px double #4a0d1e !important;
        box-shadow: none !important;
        background: #fffdf9 !important;
        color: #1a0510 !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 30px !important;
    }
}
