/* ─────────────────────────────────────────────────────────
   CustomWishCards — Letter Styles & Premium Animations
   ───────────────────────────────────────────────────────── */

:root {
    --rose:        #f43f6e;
    --rose-light:  #fb7fa5;
    --rose-pale:   #fce8ef;
    --rose-glow:   rgba(244, 63, 110, 0.14);
    --gold:        #c9964a;
    --gold-pale:   #f9f3ea;
    --ink:         #2d1a24;
    --ink-mid:     #5a3d49;
    --ink-soft:    #9b7889;
    --parchment:   #faf6f0;
    --surface:     #ffffff;
    --border:      rgba(244, 63, 110, 0.12);
    --border-gold: rgba(201, 150, 74, 0.20);
    --shadow-sm:   0 2px 12px rgba(45, 26, 36, 0.06);
    --shadow-md:   0 8px 32px rgba(45, 26, 36, 0.10);
    --shadow-lg:   0 24px 64px rgba(45, 26, 36, 0.14);
    --shadow-rose: 0 12px 40px rgba(244, 63, 110, 0.22);
}

@media (prefers-color-scheme: dark) {
    :root {
        --surface:     #1a0f14;
        --parchment:   #13090e;
        --border:      rgba(244, 63, 110, 0.18);
        --border-gold: rgba(201, 150, 74, 0.14);
        --ink:         #f5e8ed;
        --ink-mid:     #c4a0af;
        --ink-soft:    #8a6070;
        --gold-pale:   #1f1510;
        --rose-pale:   rgba(244, 63, 110, 0.10);
    }
}

* { box-sizing: border-box; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--parchment);
    color: var(--ink);
    line-height: 1.6;
}

/* ── Letter Container ─────────────────────────────────── */
.letter-container {
    background: var(--surface);
    border-radius: 28px;
    padding: 52px 56px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-gold);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Colour-ribbon top edge */
.letter-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--rose), var(--rose-light), var(--gold), var(--rose-light), var(--rose));
}

/* ── Letter Typography ────────────────────────────────── */
.letter-content { line-height: 1.8; color: var(--ink); }

.letter-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.9rem;
    font-weight: 700;
    font-style: italic;
    margin-bottom: 24px;
    color: var(--rose);
    text-align: center;
    line-height: 1.3;
}

.letter-message {
    font-size: 1.05rem;
    white-space: pre-wrap;
    margin: 28px 0;
    line-height: 1.9;
}

.letter-signature {
    text-align: right;
    font-style: italic;
    color: var(--ink-mid);
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-gold);
    font-size: 1rem;
}

.letter-date {
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.82rem;
    margin-top: 20px;
    letter-spacing: 0.04em;
}

/* ── Action Buttons ───────────────────────────────────── */
.action-btn {
    padding: 11px 22px;
    border-radius: 50px;
    border: 1.5px solid var(--border-gold);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.25s ease;
    background: var(--parchment);
    color: var(--ink-mid);
    font-family: 'DM Sans', sans-serif;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-rose);
    border-color: var(--rose-light);
    color: var(--rose);
}

.like-btn {
    background: var(--rose);
    color: white;
    border-color: var(--rose);
    box-shadow: 0 4px 14px var(--rose-glow);
}

.like-btn:hover { background: #e02355; color: white; }

.download-pdf {
    background: linear-gradient(135deg, var(--rose), var(--rose-light));
    color: white;
    border: none;
}

.download-pdf:hover { color: white; }

/* ── Payment Modal ────────────────────────────────────── */
.payment-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(20, 10, 16, 0.88);
    backdrop-filter: blur(16px);
    z-index: 10000; display: none; align-items: center; justify-content: center;
}

.payment-modal.active { display: flex; }

.payment-card {
    background: var(--surface);
    border-radius: 28px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-gold);
    box-shadow: 0 40px 80px rgba(0,0,0,0.4);
}

.payment-header {
    background: linear-gradient(135deg, var(--rose), var(--rose-light));
    padding: 28px;
    text-align: center;
    color: white;
    border-radius: 28px 28px 0 0;
}

.payment-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.payment-body { padding: 28px; }

.premium-features-list .feature {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--ink-mid);
    display: flex;
    align-items: center;
    gap: 10px;
}

.premium-features-list .feature:last-child { border-bottom: none; }

.music-selector label,
.animation-selector label,
.stickers-selector label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
    margin-bottom: 8px;
}

.music-selector select,
.animation-selector select {
    width: 100%;
    padding: 11px 16px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--parchment);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--ink);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239b7889' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.music-selector, .animation-selector, .stickers-selector { margin: 18px 0; }

.stickers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.sticker {
    font-size: 1.8rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.sticker:hover { transform: scale(1.2); background: var(--rose-pale); }
.sticker.selected { border-color: var(--rose); background: var(--rose-pale); }

.price {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--rose);
    text-align: center;
    margin: 24px 0;
}

.price small {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--ink-soft);
    display: block;
    margin-top: 4px;
}

.btn-pay {
    width: 100%;
    background: linear-gradient(135deg, var(--rose), var(--rose-light));
    color: white;
    padding: 15px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px var(--rose-glow);
}

.btn-pay:hover { transform: translateY(-2px); box-shadow: var(--shadow-rose); }

.btn-skip {
    width: 100%;
    background: transparent;
    border: 1.5px solid var(--border);
    padding: 12px;
    border-radius: 50px;
    margin-top: 10px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--ink-soft);
    transition: all 0.25s ease;
}

.btn-skip:hover { border-color: var(--ink-soft); color: var(--ink); }

.payment-status {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    display: none;
}

.payment-status.loading { background: #fef3c7; color: #d97706; display: block; }
.payment-status.success { background: #d1fae5; color: #065f46; display: block; }
.payment-status.error   { background: #fee2e2; color: #dc2626; display: block; }

/* ── Premium Background Themes ───────────────────────── */
.bg-premium-vintage {
    background: linear-gradient(135deg, #f5e6d3, #e8d5b7) !important;
}

.bg-premium-handwritten {
    background: repeating-linear-gradient(#f5f0e8 0px, #f5f0e8 28px, #e8e0d0 29px) !important;
}

.bg-premium-cinematic {
    background: linear-gradient(135deg, #2c1810, #3d2b1f) !important;
    color: #f5e6d3 !important;
}

.bg-premium-rosepetal {
    background: linear-gradient(135deg, #fff0f5, #ffe4e8) !important;
}

/* ── Premium Font Classes ─────────────────────────────── */
.font-premium-handwriting {
    font-family: 'Dancing Script', cursive !important;
    font-size: 1.2rem !important;
}

.font-premium-calligraphy {
    font-family: 'Playfair Display', Georgia, serif !important;
    letter-spacing: 0.02em;
}

/* ── Premium Glow ─────────────────────────────────────── */
.letter-premium-glow {
    box-shadow: 0 0 0 1px var(--border-gold), 0 0 32px rgba(244, 63, 110, 0.18) !important;
}

/* ── Sticker Animation ────────────────────────────────── */
@keyframes stickerPop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

.sticker-premium { animation: stickerPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ── Floating Particles ───────────────────────────────── */
@keyframes floatHeart {
    0%   { transform: translateY(0) rotate(0deg);    opacity: 1; }
    100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* ── Music Button ─────────────────────────────────────── */
@keyframes musicPulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.10); }
}

.music-playing { animation: musicPulse 2s ease-in-out infinite; }

/* ── Page Entry Animations ────────────────────────────── */
@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
    .letter-container { padding: 28px 24px; }
    .letter-title     { font-size: 1.45rem; }
    .action-btn       { padding: 10px 16px; font-size: 0.82rem; }
}

@media print {
    .site-nav, .action-buttons, .share-section { display: none !important; }
    .letter-container { padding: 20px; box-shadow: none; border: none; }
    .letter-container::before { display: none; }
}

/* ── Reduced Motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}