/* RESET & BASE VARIABLES */
:root {
    --primary-pink: #ff7ebb;
    --deep-pink: #d81b60;
    --soft-rose: #fff0f5;
    --gold-accent: #ffd700;
    --gold-glow: rgba(255, 215, 0, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.88);
    --glass-border: rgba(255, 255, 255, 0.95);
    --glass-shadow: 0 15px 35px rgba(216, 27, 96, 0.18);
    --font-heading: 'Playfair Display', serif;
    --font-script: 'Great Vibes', cursive;
    --font-body: 'Montserrat', sans-serif;
}

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

body {
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: background 0.6s ease;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}

/* DYNAMIC PAGE BACKGROUNDS MATCHING THEME IMAGE */
body.theme-fairytale {
    background: linear-gradient(rgba(74, 20, 140, 0.35), rgba(136, 14, 79, 0.45)), url('bg_fairytale.jpg');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    color: #3e1b30;
}

body.theme-rosegold {
    background: linear-gradient(rgba(140, 40, 80, 0.35), rgba(70, 15, 40, 0.5)), url('bg_rosegold.jpg');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    color: #2b0e1d;
}

body.theme-pastel {
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 30%, #fbc2eb 70%, #ff80ab 100%);
    background-attachment: fixed;
    color: #2d1838;
}

/* SPARKLES CANVAS */
#sparklesCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
}

/* TOP ANNOUNCEMENT BAR */
.samatva-top-bar {
    background: linear-gradient(90deg, #7b1fa2, #ad1457, #880e4f);
    color: white;
    padding: 10px 20px;
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-bottom: 2px solid #ffd700;
}

/* MUSIC BUTTON (Top Right) */
.music-btn {
    position: fixed;
    top: 60px;
    right: 20px;
    z-index: 100;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid white;
    background: linear-gradient(135deg, #ff7ebb, #ff5252);
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 5px 15px rgba(255, 82, 82, 0.4);
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
}

.music-btn.playing {
    background: linear-gradient(135deg, #00e676, #00b0ff);
    animation: pulse-music 1.5s infinite;
}

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

.music-btn:hover {
    transform: scale(1.15) rotate(15deg);
}

/* FLOATING ROUND SIGN UP BUTTON (Top Left) */
.signup-btn-float {
    position: fixed;
    top: 60px;
    left: 20px;
    z-index: 100;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid white;
    background: linear-gradient(135deg, #ffd700, #ff9800);
    color: #4a148c;
    font-size: 1.2rem;
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s, background 0.3s;
}

.signup-btn-float:hover {
    transform: scale(1.15) rotate(-15deg);
    background: linear-gradient(135deg, #ffffff, #ffd700);
}

/* ENVELOPE OPENING SCREEN */
.envelope-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: radial-gradient(circle, #fff5f8 0%, #f7d1e0 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s;
}

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

.envelope-wrapper {
    text-align: center;
    max-width: 450px;
    padding: 20px;
}

.envelope {
    width: 320px;
    height: 220px;
    background: #ffd6e7;
    margin: 0 auto 30px;
    position: relative;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(180, 50, 90, 0.25);
    cursor: pointer;
    transition: transform 0.4s ease;
}

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

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    border-top: 130px solid #fca6c8;
    transform-origin: top;
    transition: transform 0.6s ease;
    z-index: 3;
}

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

.envelope-body {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 160px solid #ffa3c5;
    border-right: 160px solid #ffa3c5;
    border-bottom: 120px solid #ff92ba;
    border-radius: 0 0 12px 12px;
    z-index: 2;
}

.wax-seal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #e91e63, #880e4f);
    border-radius: 50%;
    border: 3px solid #ffd700;
    box-shadow: 0 5px 15px rgba(136, 14, 79, 0.5), inset 0 0 10px rgba(255, 215, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #ffd700;
    z-index: 4;
    transition: transform 0.4s;
}

.wax-seal span {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: bold;
    line-height: 1;
}

.wax-seal small {
    font-size: 0.55rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.envelope:hover .wax-seal {
    transform: translate(-50%, -50%) scale(1.1);
}

.envelope-card-preview {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.8s ease;
    z-index: 2;
}

.envelope.open .envelope-card-preview {
    transform: translateY(-80px) scale(1.05);
}

.opening-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: #880e4f;
    margin-bottom: 8px;
}

.opening-subtitle {
    color: #703350;
    font-size: 0.95rem;
}

/* MAIN APP */
.main-app {
    position: relative;
    z-index: 2;
    padding-bottom: 40px;
}

.main-app.hidden {
    display: none;
}

/* HEADER */
.app-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 215, 0, 0.6);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 14px 30px;
}

.header-content {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: #7b1fa2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-picker {
    display: flex;
    gap: 8px;
}

.theme-btn {
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #6a1b4d;
    padding: 7px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(255, 126, 187, 0.4);
}

.theme-btn:hover, .theme-btn.active {
    background: linear-gradient(135deg, #ff7ebb, #d81b60);
    color: white;
    box-shadow: 0 4px 12px rgba(216, 27, 96, 0.3);
}

/* LAYOUT CONTAINER */
.container {
    max-width: 1300px;
    margin: 30px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 540px 1fr;
    gap: 35px;

    @media (max-width: 1024px) {
        grid-template-columns: 1fr;
    }
}

/* CARD SECTION */
.card-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-container {
    width: 100%;
    max-width: 520px;
    height: 720px;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(100, 20, 60, 0.35);
    border: 4px solid rgba(255, 255, 255, 0.85);
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: background-image 0.5s ease;
}

/* Theme Backgrounds */
.theme-fairytale .card-container {
    background-image: url('bg_fairytale.jpg');
}

.theme-rosegold .card-container {
    background-image: url('bg_rosegold.jpg');
}

.theme-pastel .card-container {
    background: linear-gradient(135deg, #ffc3a0 0%, #ffafbd 100%);
}

/* CARD GLASS HEADER */
.card-header-glass {
    margin: 18px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 18px;
    text-align: center;
    border: 2px solid rgba(255, 215, 0, 0.85);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

.sub-invitation {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #ad1457;
    display: block;
    margin-bottom: 4px;
}

.girl-name {
    font-family: var(--font-script);
    font-size: 3.5rem;
    color: #7b1fa2;
    line-height: 1.1;
    margin: 4px 0;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
}

.event-type {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: #4a148c;
    margin-bottom: 10px;
}

.event-badge {
    background: rgba(255, 240, 245, 0.95);
    border: 1px solid #f48fb1;
    padding: 7px 14px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #880e4f;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.event-badge i {
    color: #d81b60;
}

.divider {
    color: #ad1457;
}

/* PHOTO CUTOUT CONTAINER */
.photo-cutout-container {
    position: relative;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 5px;
}

.photo-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 235, 245, 0.9) 0%, rgba(255, 255, 255, 0) 70%);
    bottom: 20px;
    z-index: 1;
}

.cutout-img {
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 10px 15px rgba(60, 10, 30, 0.25));
}

/* CARD FOOTER BADGE */
.card-footer-badge {
    margin: 0 18px 18px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    border-radius: 14px;
    padding: 10px 15px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #6a1b4d;
    border: 1px solid rgba(255, 126, 187, 0.6);
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.samatva-watermark {
    font-size: 0.65rem;
    color: #ad1457;
    font-weight: 600;
}

/* CARD ACTIONS */
.card-actions {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.action-btn {
    flex: 1;
    min-width: 150px;
    padding: 12px 18px;
    border-radius: 14px;
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.action-btn.primary {
    background: linear-gradient(135deg, #d81b60, #880e4f);
    color: white;
    box-shadow: 0 6px 15px rgba(216, 27, 96, 0.35);
}

.action-btn.whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.35);
}

.action-btn.secondary {
    background: #ffffff;
    color: #880e4f;
    border: 2px solid #f48fb1;
}

.action-btn:hover {
    transform: translateY(-3px);
}

/* DETAILS SECTION */
.details-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* GLASS CARDS */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(18px);
    border-radius: 24px;
    padding: 25px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.glass-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: #7b1fa2;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* VENUE HIGHLIGHT CARD */
.venue-highlight-card .event-info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.94);
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid #f48fb1;
}

.info-item i {
    font-size: 1.4rem;
    color: #d81b60;
}

.info-item strong {
    font-size: 0.75rem;
    color: #7b1fa2;
    text-transform: uppercase;
    display: block;
}

.info-item p {
    font-size: 0.95rem;
    font-weight: 700;
    color: #4a148c;
}

/* COUNTDOWN CARD */
.target-time-label {
    font-size: 0.85rem;
    color: #880e4f;
    margin-bottom: 15px;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.time-box {
    background: linear-gradient(135deg, #ffffff, #fff0f5);
    border-radius: 16px;
    padding: 15px;
    text-align: center;
    border: 2px solid #f8bbd0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.time-box span {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: #ad1457;
    display: block;
}

.time-box small {
    font-size: 0.75rem;
    color: #7b1fa2;
    text-transform: uppercase;
    font-weight: 600;
}

/* VIRTUAL CAKE */
.cake-card {
    text-align: center;
}

.virtual-cake {
    width: 140px;
    margin: 20px auto;
    position: relative;
}

.candle {
    width: 12px;
    height: 40px;
    background: repeating-linear-gradient(45deg, #ff80ab, #ff80ab 5px, #ffffff 5px, #ffffff 10px);
    margin: 0 auto;
    border-radius: 3px 3px 0 0;
    position: relative;
}

.flame {
    width: 14px;
    height: 22px;
    background: radial-gradient(ellipse at bottom, #ffeb3b 0%, #ff9800 60%, transparent 100%);
    border-radius: 50% 50% 35% 35%;
    position: absolute;
    top: -20px;
    left: -1px;
    animation: flicker 0.8s infinite alternate;
    filter: drop-shadow(0 0 8px #ffeb3b);
}

.flame.off {
    display: none;
}

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

.cake-top {
    height: 45px;
    background: #ffffff;
    border-radius: 12px 12px 0 0;
    border: 3px solid #f8bbd0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sprinkles {
    font-size: 0.8rem;
}

.cake-bottom {
    height: 55px;
    background: #f48fb1;
    border-radius: 0 0 12px 12px;
    border: 3px solid #ec407a;
}

.cake-btn {
    width: 100%;
    padding: 14px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, #ff4081, #c2185b);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(194, 24, 91, 0.35);
    transition: transform 0.2s;
}

.cake-btn:hover {
    transform: scale(1.02);
}

/* DEDICATED BOTTOM TIME-BOUND FOOTER BADGE */
.app-bottom-footer {
    max-width: 1300px;
    margin: 40px auto 10px;
    padding: 0 20px;
}

.time-bound-bottom-badge {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    border: 2px solid #f48fb1;
    border-radius: 20px;
    padding: 20px 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(136, 14, 79, 0.15);
}

.time-bound-bottom-badge h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: #7b1fa2;
    margin-bottom: 6px;
}

.time-bound-bottom-badge p {
    font-size: 1.05rem;
    font-weight: 800;
    color: #2e7d32;
    letter-spacing: 0.5px;
}

/* PRINT STYLES */
@media print {
    body {
        background: white;
    }
    #envelopeScreen, .app-header, .details-section, .card-actions, .music-btn, .signup-btn-float, #sparklesCanvas, .samatva-top-bar, .app-bottom-footer {
        display: none !important;
    }
    .container {
        display: block;
        margin: 0;
        padding: 0;
    }
    .card-container {
        max-width: 100%;
        height: 100vh;
        border: none;
        box-shadow: none;
    }
}
