/* =================================================================
   Her Universe — styles.css
   Theme: Cute, Playful & Bubbly | Concept: Interactive Bento Dashboard
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&family=Pacifico&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

/* ─────────────────────────────────────────────
   DESIGN TOKENS
   ───────────────────────────────────────────── */
:root {
    --pink: #FF4DA6;
    --pink-light: #FFD6E8;
    --pink-pale: #FFF0F6;
    --lavender: #9254de;
    --lav-light: #EDD9FF;
    --lav-pale: #F5F0FF;
    --peach: #FF9A5C;
    --peach-light: #FFE8D0;
    --peach-pale: #fff6ee;

    --text-dark: #42264E;
    --text-med: #7A4F8A;
    --text-soft: #B07CC6;
    --text-accent: #FF4DA6;

    --grad-candy: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 50%, #C4AAFF 100%);
    --grad-title: linear-gradient(135deg, #FF4DA6 0%, #9254de 50%, #FF9A9E 100%);
    --grad-warm: linear-gradient(135deg, #FFD6E8 0%, #FFF0A0 100%);
    --grad-lav: linear-gradient(135deg, #C4AAFF 0%, #FFB5E8 100%);

    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.9);
    --glass-shadow: 0 8px 32px rgba(196, 110, 200, 0.12);
    --glass-hover: 0 20px 60px rgba(247, 89, 171, 0.22);

    --radius-card: 24px;
    --radius-pill: 999px;
}

/* ─────────────────────────────────────────────
   RESET & BASE
   ───────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    color: var(--text-dark);
    background: var(--pink-pale);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Fixed gradient base */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 10% 15%, rgba(255, 153, 200, 0.28) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 10%, rgba(161, 140, 209, 0.28) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 95%, rgba(252, 194, 235, 0.3) 0%, transparent 50%),
        linear-gradient(160deg, #fff0f6 0%, #f5f0ff 50%, #fff7ee 100%);
}

/* ─────────────────────────────────────────────
   BACKGROUND BUBBLES
   ───────────────────────────────────────────── */
#bubble-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-bubble {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: floatBubble linear infinite;
}

@keyframes floatBubble {
    0% {
        transform: translateY(110vh) scale(0.7);
        opacity: 0;
    }
    6% {
        opacity: 1;
    }
    88% {
        opacity: 0.55;
    }
    100% {
        transform: translateY(-10vh) scale(1.1);
        opacity: 0;
    }
}

/* ─────────────────────────────────────────────
   GLASS CARD UTILITY
   ───────────────────────────────────────────── */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--glass-shadow);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glass-hover);
}

/* ─────────────────────────────────────────────
   INTRO CURTAIN / LOCK SCREEN
   ───────────────────────────────────────────── */
.curtain-container {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.8s ease;
}

.curtain-container.fade-out {
    transform: translateY(-100vh);
    opacity: 0;
    pointer-events: none;
}

.curtain-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 154, 158, 0.2) 0%, rgba(250, 208, 196, 0.1) 70%);
    z-index: -1;
}

.curtain-card {
    max-width: 500px;
    width: 100%;
    padding: 3rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    border-radius: 32px;
}

.landing-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.4rem;
    background: rgba(255, 255, 255, 0.85);
    border: 1.5px solid var(--pink-light);
    border-radius: var(--radius-pill);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-accent);
    box-shadow: 0 4px 20px rgba(255, 77, 166, 0.12);
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.landing-photo-ring {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0.5rem auto;
}

.landing-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid white;
    box-shadow: 0 12px 40px rgba(255, 77, 166, 0.25);
}

.orbit-heart {
    position: absolute;
    font-size: 1.3rem;
    top: 50%;
    left: 50%;
    animation: orbit 8s linear infinite;
    transform-origin: 0 0;
}

.orbit-heart:nth-child(2) { animation-delay: -1.6s; }
.orbit-heart:nth-child(3) { animation-delay: -3.2s; }
.orbit-heart:nth-child(4) { animation-delay: -4.8s; }
.orbit-heart:nth-child(5) { animation-delay: -6.4s; }

@keyframes orbit {
    0% { transform: rotate(var(--angle)) translateX(95px) rotate(calc(-1 * var(--angle))); }
    100% { transform: rotate(calc(var(--angle) + 360deg)) translateX(95px) rotate(calc(-1 * (var(--angle) + 360deg))); }
}

.curtain-title {
    font-family: 'Pacifico', cursive;
    font-size: clamp(3rem, 10vw, 4.5rem);
    background: var(--grad-title);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    animation: gradShift 4s ease-in-out infinite alternate;
}

.curtain-subtitle {
    font-size: 1.05rem;
    color: var(--text-med);
    font-weight: 600;
}

.btn-unlock {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 2.5rem;
    background: var(--grad-candy);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    font-family: 'Quicksand', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(255, 77, 166, 0.3);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.btn-unlock:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 18px 45px rgba(255, 77, 166, 0.4);
}

/* ─────────────────────────────────────────────
   MAIN BENTO DASHBOARD CONTAINER
   ───────────────────────────────────────────── */
.dashboard-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    position: relative;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.dashboard-wrap.hidden {
    opacity: 0;
    pointer-events: none;
}

.db-header {
    text-align: center;
    margin-bottom: 3rem;
}

.db-title {
    font-family: 'Pacifico', cursive;
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    background: var(--grad-title);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.db-subtitle {
    font-size: 1.1rem;
    color: var(--text-soft);
    font-weight: 600;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: 1.5rem;
}

.bento-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.8rem;
    cursor: pointer;
}

.card-glow {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.bento-card:hover .card-glow {
    opacity: 1;
}

.card-body {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-icon {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    display: inline-block;
}

.card-title {
    font-family: 'Pacifico', cursive;
    font-size: 1.6rem;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
}

.card-desc {
    font-size: 0.92rem;
    color: var(--text-med);
    line-height: 1.5;
    margin-bottom: 1.2rem;
}

.action-hint {
    position: relative;
    z-index: 2;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: auto;
    display: inline-block;
    transition: transform 0.3s ease;
}

.bento-card:hover .action-hint {
    transform: translateX(4px);
}

/* Widget Specific Configurations */
.card-who {
    grid-column: span 4;
    grid-row: span 2;
}

.card-counter {
    grid-column: span 8;
    grid-row: span 1;
    cursor: default;
}

.card-journey {
    grid-column: span 8;
    grid-row: span 1;
}

.card-moment {
    grid-column: span 5;
    grid-row: span 1;
}

.card-polaroids {
    grid-column: span 7;
    grid-row: span 1;
}

.card-envelope-widget {
    grid-column: span 6;
    grid-row: span 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.card-love-jar {
    grid-column: span 6;
    grid-row: span 1;
}

.card-chat {
    grid-column: span 12;
    grid-row: span 1;
    align-items: center;
    text-align: center;
}
.card-chat .card-icon {
    margin: 0 auto 0.8rem;
}

/* ─────────────────────────────────────────────
   WIDGET GRAPHICS & DESIGNS
   ───────────────────────────────────────────── */

/* Booklet Mockup */
.mini-book-graphic {
    width: 130px;
    height: 90px;
    margin: auto;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1.5px solid var(--pink-light);
    position: relative;
    display: flex;
    overflow: hidden;
}

.mini-book-graphic::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(0, 0, 0, 0.08);
    z-index: 2;
}

.mini-page-left, .mini-page-right {
    flex: 1;
    padding: 0.8rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Counter Grid */
.counter-grid {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-start;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.counter-label {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-soft);
    margin-bottom: 0.5rem;
}

.c-pill {
    background: white;
    border-radius: 14px;
    padding: 0.8rem 1.2rem;
    min-width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    box-shadow: 0 4px 12px rgba(196, 110, 200, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    transition: transform 0.3s ease;
}

.c-pill:hover {
    transform: translateY(-3px);
}

.c-pill.highlight {
    background: var(--grad-candy);
    border-color: transparent;
}

.c-pill.highlight .c-val,
.c-pill.highlight .c-lbl {
    color: white;
}

.c-val {
    font-family: 'Pacifico', cursive;
    font-size: 1.8rem;
    color: var(--text-dark);
    line-height: 1;
}

.c-lbl {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-soft);
}

/* Journey Strip Preview */
.film-strip-preview {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin: auto 0;
}

.preview-frame {
    background: #2b2b2b;
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    border-left: 2px dashed rgba(255, 255, 255, 0.4);
    border-right: 2px dashed rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Polaroid Stack */
.polaroid-preview-stack {
    height: 110px;
    position: relative;
    margin: auto;
    width: 140px;
}

.mini-polaroid {
    position: absolute;
    width: 80px;
    height: 90px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), z-index 0.1s;
}

.mini-polaroid.p1 { transform: rotate(-12deg) translate(-15px, 0); z-index: 1; }
.mini-polaroid.p2 { transform: rotate(4deg) translate(5px, 5px); z-index: 2; }
.mini-polaroid.p3 { transform: rotate(15deg) translate(25px, -5px); z-index: 3; }

.card-polaroids:hover .mini-polaroid.p1 { transform: rotate(-25deg) translate(-40px, -5px); }
.card-polaroids:hover .mini-polaroid.p2 { transform: rotate(0deg) translate(0, -10px); }
.card-polaroids:hover .mini-polaroid.p3 { transform: rotate(25deg) translate(40px, -5px); }

/* The Moment Peek */
.moment-peek-wrap {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.moment-peek-badge {
    background: rgba(255, 255, 255, 0.9);
    border: 1.5px dashed var(--pink);
    padding: 0.5rem 1.2rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--pink);
    box-shadow: 0 4px 12px rgba(255, 77, 166, 0.08);
}

/* Love Jar */
.jar-graphic-wrap {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.love-jar-graphic {
    width: 80px;
    height: 110px;
    position: relative;
    transition: transform 0.15s ease-in-out;
}

.love-jar-graphic.shake {
    animation: jarShake 0.4s ease-in-out;
}

@keyframes jarShake {
    0%, 100% { transform: rotate(0); }
    20%, 60% { transform: rotate(-10deg); }
    40%, 80% { transform: rotate(10deg); }
}

.jar-lid {
    width: 48px;
    height: 10px;
    background: #b07cc6;
    border-radius: 4px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.jar-neck {
    width: 40px;
    height: 8px;
    background: rgba(255, 255, 255, 0.65);
    border: 2px solid #b07cc6;
    border-top: none;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.jar-body {
    width: 76px;
    height: 85px;
    background: rgba(255, 255, 255, 0.45);
    border: 3px solid #b07cc6;
    border-radius: 16px 16px 24px 24px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    backdrop-filter: blur(2px);
    box-shadow: inset 0 8px 10px rgba(255, 255, 255, 0.6), 0 4px 10px rgba(0,0,0,0.05);
}

.jar-tag {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%) rotate(-4deg);
    background: #FFF4EA;
    border: 1.5px solid #FF9A5C;
    border-radius: 4px;
    font-size: 0.5rem;
    font-weight: 800;
    color: #42264E;
    padding: 0.15rem 0.4rem;
    white-space: nowrap;
    z-index: 3;
}

.jar-hearts {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.j-heart {
    position: absolute;
    font-size: 0.9rem;
    animation: jarHeartFloat 4s ease-in-out infinite alternate;
}

.j-heart.h1 { top: 45px; left: 15px; animation-delay: 0s; }
.j-heart.h2 { top: 22px; right: 12px; animation-delay: -1s; }
.j-heart.h3 { bottom: 15px; left: 35px; animation-delay: -2s; }
.j-heart.h4 { bottom: 30px; right: 15px; animation-delay: -3s; }

@keyframes jarHeartFloat {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-8px) scale(1.1) rotate(5deg); }
}

.compliment-bubble {
    background: white;
    border: 2px solid var(--pink-light);
    border-radius: 16px;
    padding: 0.8rem 1.2rem;
    box-shadow: 0 8px 24px rgba(255, 77, 166, 0.12);
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    text-align: center;
    z-index: 10;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: scale(0.9);
    animation: bubblePop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes bubblePop {
    100% { transform: scale(1); }
}

.compliment-bubble.hidden {
    display: none;
}

#compliment-text {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
}

/* Wax-Seal Envelope Widget */
.envelope-outer-wrap {
    width: 180px;
    height: 110px;
    margin: 0.5rem auto 1rem;
    position: relative;
    perspective: 800px;
}

.envelope-back {
    position: absolute;
    inset: 0;
    background: #FFD6E8;
    border-radius: 8px;
    border: 1.5px solid #FF9A9E;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.envelope-paper-preview {
    position: absolute;
    bottom: 5px;
    left: 10px;
    right: 10px;
    height: 90px;
    background: #fffdf8;
    border: 1px dashed rgba(255, 77, 166, 0.3);
    border-radius: 4px;
    z-index: 2;
    padding: 0.6rem;
    transition: transform 0.4s ease;
}

.preview-writing {
    font-size: 0.52rem;
    color: var(--text-soft);
    line-height: 1.6;
}

.envelope-front {
    position: absolute;
    inset: 0;
    background: #FFE8D0;
    clip-path: polygon(0% 40%, 50% 100%, 100% 40%, 100% 100%, 0% 100%);
    border-radius: 0 0 8px 8px;
    z-index: 3;
    border-bottom: 1px solid #FF9A5C;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #FFE8D0;
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    border-radius: 8px 8px 0 0;
    transform-origin: top center;
    transition: transform 0.4s ease;
    z-index: 4;
}

.card-envelope-widget:hover .envelope-flap {
    transform: rotateX(15deg);
}

.wax-seal {
    position: absolute;
    top: 45px;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 32px;
    height: 32px;
    background: radial-gradient(circle, #ff1a8c 0%, #cc0066 100%);
    border-radius: 50%;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(204, 0, 102, 0.4);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.seal-inner {
    color: white;
    font-size: 0.75rem;
}

/* Broken Wax Seal Animation */
.wax-seal.broken {
    animation: breakSeal 0.6s ease forwards;
}

@keyframes breakSeal {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.2) rotate(15deg); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(0) rotate(-45deg); opacity: 0; pointer-events: none; }
}

.envelope-card-title {
    font-family: 'Pacifico', cursive;
    font-size: 1.3rem;
    color: var(--text-dark);
    text-align: center;
    margin-top: 0.5rem;
}

/* ─────────────────────────────────────────────
   OVERLAY MODALS STYLING
   ───────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(66, 38, 78, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.btn-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: white;
    border: 2px solid var(--pink-light);
    color: var(--text-dark);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, background-color 0.25s;
    z-index: 6000;
}

.btn-close:hover {
    transform: rotate(90deg) scale(1.1);
    background-color: var(--pink-pale);
    color: var(--pink);
}

/* ── MODAL 1: TWO-PAGE BOOK SPREAD ── */
.book-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* The perspective wrapper that makes 3D depth work */
.book-spread-wrapper {
    width: 100%;
    height: 460px;
    position: relative;
    display: flex;
    perspective: 2200px;
    filter: drop-shadow(0 24px 48px rgba(66, 38, 78, 0.12));
}

/* Shared panel styles */
.book-panel {
    flex: 1;
    background: #fffdfc;
    position: relative;
    overflow: hidden;
}

.book-panel-left {
    border-radius: 18px 0 0 18px;
    box-shadow: inset -6px 0 18px rgba(0,0,0,0.04);
    background: linear-gradient(to right, #fffdf8, #fffdfc);
}

.book-panel-right {
    border-radius: 0 18px 18px 0;
    box-shadow: inset 4px 0 12px rgba(0,0,0,0.03);
}

/* Book spine */
.book-spine-bar {
    width: 14px;
    flex-shrink: 0;
    background: linear-gradient(90deg,
        rgba(0,0,0,0.07) 0%,
        rgba(255,255,255,0.35) 30%,
        rgba(0,0,0,0.13) 65%,
        rgba(0,0,0,0.05) 100%);
    position: relative;
    z-index: 5;
    box-shadow: 0 0 14px rgba(0,0,0,0.08);
}

/* Page inner content area */
.page-inner {
    position: absolute;
    inset: 0;
    padding: 2.2rem 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.page-num-label {
    position: absolute;
    bottom: 1rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-soft);
    opacity: 0.6;
}

.left-label  { left: 1.5rem; }
.right-label { right: 1.5rem; }

/* Blank left page */
.page-blank {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fffdf8 0%, #fdf5ff 100%);
}

.page-blank-emoji {
    font-size: 4rem;
    opacity: 0.08;
}

/* ── BOOK LEFT PANEL: HER PHOTO ── */
.page-photo-panel {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
    background: linear-gradient(160deg, #fdf0ff 0%, #ffe8f4 100%);
    border-radius: 18px 0 0 18px;
    overflow: hidden;
    padding: 1rem 0.8rem 1.4rem;
    flex-direction: column;
}

.book-photo-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    min-height: 0;
}

.book-hero-photo {
    flex: 1;
    width: 100%;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, rgba(255,200,230,0.3), rgba(220,180,255,0.3));
    border: 2px dashed rgba(255, 100, 180, 0.25);
    min-height: 0;
    overflow: hidden;
}

/* When real img is placed inside, let it fill the frame */
.book-hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.book-hero-photo .ph-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

.book-hero-photo .ph-label {
    font-size: 0.75rem;
    color: var(--text-soft);
    font-weight: 600;
}

.book-photo-caption {
    font-family: 'Pacifico', cursive;
    font-size: 0.88rem;
    color: var(--pink);
    text-align: center;
    padding-top: 0.2rem;
}



/* Cover page */
.page-cover {
    width: 100%;
    height: 100%;
    background: var(--grad-candy);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.9rem;
    border-radius: 0 18px 18px 0;
    padding: 2rem;
}

.page-cover-emoji {
    font-size: 3.2rem;
    animation: coverHeart 2s ease-in-out infinite;
}

@keyframes coverHeart {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.18) rotate(5deg); }
}

.page-cover h2 {
    font-family: 'Pacifico', cursive;
    font-size: 2rem;
    color: white;
    text-shadow: 0 4px 14px rgba(0,0,0,0.1);
}

.page-cover p {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.92);
    font-weight: 600;
    line-height: 1.4;
}

.flip-hint {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.82);
    margin-top: 0.5rem;
}

/* Back / final page */
.page-back-cover {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
    background: linear-gradient(135deg, #fdf5ff, #fff0f6);
}

/* Book sticky notes (rendered by JS) */
.book-sticky {
    padding: 1.4rem 1.4rem 1.6rem;
    border-radius: 14px;
    position: relative;
}

.book-sticky.pink     { background: #FFF0F6; border-top: 4px solid var(--pink); }
.book-sticky.lavender { background: #F3EEFF; border-top: 4px solid var(--lavender); }
.book-sticky.peach    { background: #FFF4EA; border-top: 4px solid var(--peach); }

.book-sticky-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.book-sticky h3 {
    font-family: 'Pacifico', cursive;
    font-size: 1.15rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.book-sticky p {
    font-size: 0.86rem;
    line-height: 1.65;
    color: var(--text-med);
}

/* ── 3D PAGE FLIPPER OVERLAY ── */
/* This element sits over the spread and animates the page turn.
   It is hidden (display:none) by default and only shown during animation. */
.page-flipper {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    transform-style: preserve-3d;
    transform-origin: left center;
    z-index: 20;
    pointer-events: none;
    display: none; /* JS shows it during the flip animation */
}

.page-flipper.is-flipping {
    display: block;
}

/* The two faces of the turning page */
.flipper-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: #fffdfc;
    padding: 2.2rem 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    border-radius: 0 18px 18px 0;
}

/* The back face is the reverse (rotated 180deg) */
.flipper-back {
    transform: rotateY(180deg);
    border-radius: 18px 0 0 18px;
    background: linear-gradient(135deg, #fffdf8, #fdf5ff);
}

/* Progress dots under the book */
.book-progress-dots {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.book-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pink-light);
    transition: background 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.book-dot.active {
    background: var(--pink);
    transform: scale(1.4);
}

/* Controls row */
.book-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 10;
}

.btn-page {
    padding: 0.6rem 1.4rem;
    border-radius: 20px;
    border: 2px solid var(--pink-light);
    background: white;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--pink);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    transition: background-color 0.2s, transform 0.2s, opacity 0.2s;
}

.btn-page:hover {
    background: var(--pink-pale);
    transform: translateY(-2px);
}

.btn-page:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

/* Responsive adjustments for book */
@media (max-width: 800px) {
    .book-spread-wrapper {
        height: 420px;
    }
    .page-inner {
        padding: 1.5rem 1rem;
    }
}

/* Mobile — scaled side-by-side mode */
@media (max-width: 680px) {
    .book-spread-wrapper {
        height: 380px;
        flex-direction: row;
    }

    .book-panel-left, .book-panel-right {
        display: block;
        min-height: unset;
        box-shadow: inset -3px 0 8px rgba(0,0,0,0.04);
    }

    .book-panel-left {
        border-radius: 12px 0 0 12px;
    }

    .book-panel-right {
        border-radius: 0 12px 12px 0;
        box-shadow: inset 2px 0 6px rgba(0,0,0,0.03);
    }

    .page-cover {
        border-radius: 0 12px 12px 0;
    }

    .book-spine-bar {
        display: block;
        width: 8px;
    }

    .page-inner {
        padding: 1.2rem 0.8rem;
    }

    .book-hero-photo {
        height: 180px;
    }

    .book-photo-caption {
        font-size: 0.8rem;
        margin-top: 0.5rem;
    }

    .book-sticky h3 {
        font-size: 1.1rem;
        margin-bottom: 0.3rem;
    }

    .book-sticky p {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .page-flipper {
        display: block !important;
    }
}

/* ── MODAL 2: JOURNEY FILMS ── */
.journey-modal-content {
    max-width: 900px;
    width: 100%;
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.chapter-num {
    font-family: 'Pacifico', cursive;
    font-size: 3rem;
    background: var(--grad-candy);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.22;
    line-height: 1;
}

.ch-title {
    font-family: 'Pacifico', cursive;
    font-size: 2.2rem;
    background: var(--grad-title);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
}

.ch-sub {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-soft);
}

.swipe-hint {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin: 1rem 0;
    opacity: 0.7;
}

.film-strip-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1.5rem 0;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
}

.film-strip-wrap:active {
    cursor: grabbing;
}

.film-strip-wrap::-webkit-scrollbar {
    height: 6px;
}

.film-strip-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.film-strip-wrap::-webkit-scrollbar-thumb {
    background: rgba(255, 77, 166, 0.3);
    border-radius: 99px;
}

.film-strip {
    display: flex;
    gap: 1.8rem;
    padding: 0.5rem 2rem 1rem;
    width: max-content;
}

.film-card {
    width: 280px;
    background: white;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-card);
    padding: 1.4rem;
    box-shadow: 0 10px 30px rgba(196, 110, 200, 0.08);
    flex-shrink: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.film-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--glass-hover);
}

.film-year {
    font-family: 'Pacifico', cursive;
    font-size: 2rem;
    background: var(--grad-candy);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.8rem;
    line-height: 1;
}

.film-title {
    font-family: 'Pacifico', cursive;
    font-size: 1.05rem;
    color: var(--text-dark);
    margin: 0.8rem 0 0.4rem;
}

.film-body {
    font-size: 0.84rem;
    color: var(--text-med);
    line-height: 1.6;
}

/* Image Placeholder Styling */
.img-placeholder {
    background: linear-gradient(135deg, rgba(255, 173, 210, 0.15), rgba(161, 140, 209, 0.15));
    border: 2px dashed rgba(255, 77, 166, 0.25);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: var(--text-accent);
    font-weight: 700;
    font-size: 0.78rem;
    text-align: center;
    overflow: hidden;
    position: relative;
    transition: border-color 0.3s, background 0.3s;
}

.img-placeholder:hover {
    border-color: rgba(255, 77, 166, 0.45);
    background: linear-gradient(135deg, rgba(255, 173, 210, 0.25), rgba(161, 140, 209, 0.25));
}

.ph-icon {
    font-size: 1.8rem;
    display: block;
}

/* ── MODAL 3: THE MOMENT ── */
.moment-modal-content {
    max-width: 660px;
    width: 100%;
    padding: 3rem 2.2rem;
    overflow-y: auto;
    max-height: 90vh;
}

.moment-glow {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 77, 166, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.moment-quote {
    max-width: 540px;
    margin: 0 auto 2rem;
    text-align: center;
    font-family: 'Pacifico', cursive;
    font-size: clamp(1rem, 3.5vw, 1.4rem);
    color: var(--text-med);
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.moment-quote::before {
    content: '❝';
    display: block;
    font-size: 3rem;
    color: rgba(255, 77, 166, 0.15);
    margin-bottom: -0.5rem;
    line-height: 1;
}

.moment-photo {
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.moment-journal {
    background: rgba(255, 255, 255, 0.85) !important;
    padding: 2rem;
    border-radius: 18px;
    border: 2px solid var(--glass-border);
}

.journal-date {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-accent);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.journal-date::before {
    content: '✒️';
}

.moment-journal p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-dark);
}

/* ── MODAL 4: POLAROIDS ── */
.polaroids-modal-content {
    max-width: 900px;
    width: 100%;
}

.polaroid-board {
    display: flex;
    flex-wrap: wrap;
    gap: 1.8rem;
    justify-content: center;
    padding: 1.5rem 0;
}

.polaroid {
    background: white;
    padding: 0.8rem 0.8rem 2.8rem;
    border-radius: 4px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
    transform: rotate(var(--r, 0deg));
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    flex: 0 0 auto;
    width: 170px;
    cursor: pointer;
    position: relative;
}

.polaroid:hover {
    transform: rotate(0deg) scale(1.08) translateY(-6px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);
    z-index: 5;
}

.polaroid-caption {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-med);
    text-align: center;
    position: absolute;
    bottom: 0.7rem;
    left: 0;
    right: 0;
    padding: 0 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── MODAL 5: LOVE LETTER ── */
.letter-modal-content {
    max-width: 660px;
    width: 100%;
}

.letter-wrap {
    margin: 0 auto;
}

.letter-chip {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    background: var(--grad-candy);
    color: white;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    box-shadow: 0 4px 16px rgba(255, 77, 166, 0.25);
}

.letter-paper {
    padding: 3rem 2.2rem;
    background: #fffdf8 !important;
    border: 2.5px dashed rgba(255, 77, 166, 0.3) !important;
    position: relative;
    box-shadow: 0 10px 35px rgba(0,0,0,0.06);
}

.letter-paper::before {
    content: '';
    position: absolute;
    inset: 3rem 2.2rem 3rem 3rem;
    background: repeating-linear-gradient(transparent, transparent 31px,
            rgba(255, 173, 210, 0.18) 31px, rgba(255, 173, 210, 0.18) 32px);
    pointer-events: none;
    z-index: 0;
}

.letter-body {
    outline: none;
    font-size: 1.05rem;
    font-family: 'Quicksand', sans-serif;
    color: var(--text-dark);
    line-height: 2;
    min-height: 220px;
    position: relative;
    z-index: 1;
    caret-color: var(--text-accent);
}

.letter-body:empty::before {
    content: 'Write your heart out here... ✨';
    color: var(--text-soft);
    pointer-events: none;
}

/* ── PHOTO PREVIEWER OVERLAY ── */
.photo-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(42, 24, 49, 0.9);
    z-index: 8000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.photo-preview-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.btn-preview-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-preview-close:hover {
    transform: scale(1.1);
}

.btn-chat-camera {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 5px;
    transition: transform 0.2s;
}

.btn-chat-camera:active {
    transform: scale(0.9);
}

.chat-bubble img {
    max-width: 150px;
    border-radius: 8px;
    display: block;
    margin-top: 0.5rem;
}

.preview-box {
    background: white;
    padding: 1rem 1rem 4rem;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.photo-preview-overlay.visible .preview-box {
    transform: scale(1);
}

.preview-img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.preview-placeholder {
    height: 320px;
    width: 100%;
    border-radius: 4px;
}

.preview-caption {
    position: absolute;
    bottom: 1.2rem;
    left: 0;
    right: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    font-family: 'Quicksand', sans-serif;
}

/* ─────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────── */
.db-footer {
    text-align: center;
    padding: 4rem 1rem 1rem;
    max-width: 520px;
    margin: 0 auto;
}

.footer-note {
    font-size: 1rem;
    color: var(--text-med);
    line-height: 1.85;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.footer-hearts {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.4rem;
}

.footer-hearts span {
    animation: heartBeat 1.5s ease-in-out infinite;
}

.footer-hearts span:nth-child(2) { animation-delay: 0.2s; }
.footer-hearts span:nth-child(3) { animation-delay: 0.4s; }
.footer-hearts span:nth-child(4) { animation-delay: 0.6s; }
.footer-hearts span:nth-child(5) { animation-delay: 0.8s; }

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.35); }
}

/* ─────────────────────────────────────────────
   SPAWNED CLICK HEARTS
   ───────────────────────────────────────────── */
.heart-deco {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    animation: floatUp 1.2s ease-out forwards;
    user-select: none;
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    15% { opacity: 1; }
    80% { opacity: 0.8; }
    100% { transform: translateY(-80px) scale(1.1) rotate(12deg); opacity: 0; }
}

/* ─────────────────────────────────────────────
   RESPONSIVE DESIGN
   ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: auto;
    }

    .card-who, .card-counter, .card-journey, .card-moment, .card-polaroids, .card-envelope-widget, .card-love-jar {
        grid-column: span 1;
        grid-row: span 1;
        min-height: 240px;
    }
    
    .card-chat {
        grid-column: span 2;
        grid-row: span 1;
    }
    
    .card-who {
        grid-row: span 2;
    }
    
    .book-container {
        height: 480px;
    }
    
    .book {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .dashboard-wrap {
        padding: 2rem 1rem;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .card-who, .card-counter, .card-journey, .card-moment, .card-polaroids, .card-envelope-widget, .card-love-jar, .card-chat {
        grid-column: span 1;
        grid-row: span 1;
        min-height: auto;
    }

    /* Booklet Mobile View: Stack pages rather than side-by-side */
    .book-container {
        max-width: 420px;
        height: 480px;
    }

    .book {
        height: 400px;
    }

    .book-page {
        width: 100%;
        left: 0;
        transform-origin: left center;
    }

    .book::after {
        display: none;
    }

    .page-content {
        border-radius: 16px !important;
        padding: 1.5rem;
    }
    
    .film-card {
        width: 240px;
    }
    
    .letter-paper {
        padding: 2rem 1.2rem;
    }
    
    .letter-paper::before {
        inset: 2rem 1.2rem 2rem 2rem;
    }
}

/* ── LOVE LETTER: SAVE BUTTON & TOAST ── */
.letter-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.2rem;
    justify-content: flex-end;
}

.btn-save-letter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.6rem;
    border-radius: 24px;
    border: none;
    background: var(--grad-candy);
    color: white;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(255, 77, 166, 0.28);
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-save-letter:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 10px 24px rgba(255, 77, 166, 0.38);
}

.btn-save-letter:active {
    transform: scale(0.97);
}

/* Toast confirmation */
.save-toast {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--pink);
    background: var(--pink-pale);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1.5px solid var(--pink-light);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(4px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.save-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Override hidden from .hidden utility — toast uses .show instead */
.save-toast.hidden {
    display: inline-block;
    visibility: visible;
}



@media (max-width: 480px) {
    .c-pill {
        min-width: 70px;
        padding: 0.6rem 0.8rem;
    }
    
    .c-val {
        font-size: 1.4rem;
    }
    
    .c-lbl {
        font-size: 0.58rem;
    }
    
    .polaroid-board {
        flex-direction: column;
        align-items: center;
    }
}

/* ─────────────────────────────────────────────
   SECRET CHAT MODAL UI
   ───────────────────────────────────────────── */
#secret-chat-modal .chat-container {
    width: 90%;
    max-width: 450px;
    height: 80vh;
    max-height: 600px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
}

.chat-header {
    background: var(--grad-title);
    color: white;
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-title {
    font-size: 1.3rem;
    font-weight: 700;
}

.sender-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Toggle Switch UI */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.4);
    transition: .4s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--pink); }
input:checked + .slider:before { transform: translateX(20px); }

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #fdfafb;
}

.chat-bubble {
    max-width: 75%;
    padding: 0.8rem 1.2rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
    animation: bubblePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bubblePop {
    0% { transform: scale(0.8) translateY(10px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.chat-bubble.sent {
    align-self: flex-end;
    background: var(--pink);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-bubble.received {
    align-self: flex-start;
    background: white;
    color: var(--text-dark);
    border: 1px solid var(--pink-pale);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.chat-time {
    font-size: 0.65rem;
    margin-top: 0.3rem;
    opacity: 0.7;
    text-align: right;
}

.chat-bubble img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 5px;
    display: block;
}

.chat-input-area {
    padding: 1rem;
    background: white;
    border-top: 1px solid var(--pink-pale);
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

#chat-input {
    flex: 1;
    border: none;
    background: var(--pink-pale);
    padding: 0.8rem 1.2rem;
    border-radius: 24px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-dark);
    outline: none;
}
#chat-input::placeholder { color: var(--text-soft); }

.btn-send-chat {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--pink);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 77, 166, 0.3);
    transition: transform 0.2s;
}
.btn-send-chat:active { transform: scale(0.9); }