/* ============================================
   Premium Birthday Card - Elegant & Respectful
   No emojis - Professional SVG & Icons only
   ============================================ */

:root {
    /* Elegant Rose Palette */
    --rose-50: #fdf8f9;
    --rose-100: #fceef0;
    --rose-200: #f8d7dc;
    --rose-300: #f2b5be;
    --rose-400: #e88a99;
    --rose-500: #d9657a;
    --rose-600: #c24560;
    --rose-700: #a3374d;
    --rose-800: #883143;
    --rose-900: #742c3c;
    
    /* Gold Accent */
    --gold-100: #fefbeb;
    --gold-200: #fdf4c7;
    --gold-300: #f9e68a;
    --gold-400: #f5d14d;
    --gold-500: #e8b916;
    --gold-600: #c99a0d;
    
    /* Neutral */
    --cream: #fefcf9;
    --ivory: #fffdf7;
    --charcoal: #3a3a3a;
    --text-primary: #4a3f4a;
    --text-secondary: #6b5e6b;
    
    /* Shadows */
    --shadow-soft: 0 4px 20px rgba(200, 150, 160, 0.1);
    --shadow-medium: 0 8px 40px rgba(200, 150, 160, 0.15);
    --shadow-strong: 0 16px 60px rgba(200, 150, 160, 0.2);
    
    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Sarabun', 'Prompt', sans-serif;
    background: var(--cream);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.7;
}

/* ============================================
   Background Elements
   ============================================ */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 20%, var(--rose-100) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, var(--rose-100) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, var(--gold-100) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, 
        var(--ivory) 0%, 
        var(--rose-50) 30%, 
        var(--cream) 70%,
        var(--rose-100) 100%);
    opacity: 0.8;
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   Floating Petals (CSS only, elegant)
   ============================================ */
.floating-petals {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.petal {
    position: absolute;
    width: 12px;
    height: 16px;
    background: linear-gradient(135deg, var(--rose-200) 0%, var(--rose-300) 100%);
    border-radius: 50% 0 50% 50%;
    opacity: 0;
    animation: floatDown 12s ease-in-out infinite;
}

@keyframes floatDown {
    0% {
        transform: translateY(-50px) rotate(0deg) scale(0.8);
        opacity: 0;
    }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% {
        transform: translateY(calc(100vh + 50px)) rotate(720deg) scale(1);
        opacity: 0;
    }
}

/* ============================================
   Lucide Icons Base Styling
   ============================================ */
[data-lucide] {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
    display: inline-block;
    vertical-align: middle;
}

/* ============================================
   Scene Containers
   ============================================ */
.scene {
    display: none;
    min-height: 100vh;
    position: relative;
    z-index: 2;
}

.scene.active {
    display: flex;
    flex-direction: column;
}

/* ============================================
   OPENING SCENE
   ============================================ */
.opening-scene {
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.opening-content {
    text-align: center;
    max-width: 400px;
}

/* Elegant Envelope */
.envelope-container {
    position: relative;
    display: inline-block;
    margin-bottom: 40px;
    cursor: pointer;
}

/* Envelope Layering */
.elegant-envelope {
    position: relative;
    width: 280px;
    height: 200px;
}

.elegant-envelope:hover {
    transform: translateY(-5px);
    transition: transform 0.3s ease;
}

/* Letter inside */
.letter {
    position: absolute;
    top: 80px;
    left: 20px;
    width: 240px;
    height: 150px;
    background: linear-gradient(180deg, #fff 0%, #fef7f8 100%);
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(200, 150, 160, 0.2);
}

.letter-content {
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease 0.3s;
}

.letter-icon {
    color: var(--rose-500);
    width: 36px;
    height: 36px;
    margin-bottom: 12px;
}

.letter p {
    font-family: 'Sarabun', sans-serif;
    font-size: 1.1rem;
    color: var(--rose-700);
    font-weight: 600;
    margin: 0;
}

/* Envelope body (front pocket) */
.envelope-body {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* Envelope flap */
.envelope-flap-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    transform-origin: 50% 70px; /* Hinge at y=70 in 280x200 viewBox */
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.envelope-flap-svg {
    width: 100%;
    height: 100%;
}

/* Open State */
.envelope-container.opening .envelope-flap-wrapper {
    transform: rotateX(180deg);
    z-index: 0;
}

/* Hide Lottie */
.envelope-container lottie-player {
    display: none;
}

.opening-title {
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--rose-700);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.opening-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 35px;
}

.open-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-family: inherit;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, var(--rose-500) 0%, var(--rose-600) 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: var(--shadow-medium), 0 4px 20px rgba(200, 100, 130, 0.3);
    transition: var(--transition-spring);
}

.open-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-strong), 0 8px 30px rgba(200, 100, 130, 0.4);
}

.open-btn [data-lucide] {
    width: 24px;
    height: 24px;
}

/* ============================================
   BIRTHDAY SCENE
   ============================================ */
.birthday-scene {
    padding: 0;
}

/* Hero Section */
.hero {
    padding: 60px 20px 50px;
    text-align: center;
    background: linear-gradient(180deg, var(--ivory) 0%, var(--rose-50) 100%);
}

.hero-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.deco-line {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--rose-300), transparent);
}

.deco-icon {
    color: var(--gold-500);
    animation: pulse-soft 2s ease-in-out infinite;
}

.deco-icon [data-lucide] {
    width: 28px;
    height: 28px;
}

@keyframes pulse-soft {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
}

.hero-content {
    max-width: 500px;
    margin: 0 auto;
}

.hero-label {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero-title {
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--rose-600);
    margin-bottom: 10px;
    line-height: 1.3;
}

.hero-name {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--rose-600) 0%, var(--gold-500) 50%, var(--rose-600) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: text-shimmer 4s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes text-shimmer {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 200% center; }
}

.hero-date {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    color: var(--text-secondary);
    padding: 10px 24px;
    background: white;
    border-radius: 30px;
    box-shadow: var(--shadow-soft);
}

.hero-date [data-lucide] {
    width: 18px;
    height: 18px;
    color: var(--rose-500);
}

.hero-animation {
    display: none; /* Hide until Lottie loads successfully */
}

/* ============================================
   Section Styling
   ============================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 35px;
    color: var(--rose-600);
}

.section-header [data-lucide] {
    width: 26px;
    height: 26px;
}

.section-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* ============================================
   CAKE SECTION
   ============================================ */
.cake-section {
    padding: 60px 20px;
    text-align: center;
    background: white;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.cake-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.cake-wrapper {
    max-width: 400px;
    margin: 0 auto;
}

/* Hide Lottie, show SVG */
.cake-animation {
    display: none;
}

.elegant-cake {
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-bottom: 30px;
}

.elegant-cake:hover {
    transform: scale(1.03);
}

.cake-svg {
    width: 100%;
    max-width: 320px;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(200, 150, 160, 0.2));
}

.flame {
    animation: flicker 0.4s ease-in-out infinite alternate;
    transition: all 0.6s ease;
}

.flame.blown {
    opacity: 0;
    transform: scale(0);
}

@keyframes flicker {
    from { transform: scaleY(0.9) translateY(1px); opacity: 0.9; }
    to { transform: scaleY(1.1) translateY(-1px); opacity: 1; }
}

.cake-hint, .cake-wish {
    font-size: 1.1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.cake-hint [data-lucide], .cake-wish [data-lucide] {
    width: 20px;
    height: 20px;
}

.cake-wish {
    color: var(--rose-600);
    font-weight: 500;
    animation: fadeUpIn 0.6s ease-out;
}

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

.hidden {
    display: none !important;
}

/* ============================================
   GRATITUDE SECTION
   ============================================ */
.gratitude-section {
    padding: 60px 20px;
    background: var(--rose-50);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.gratitude-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.gratitude-card {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 24px;
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    position: relative;
}

.card-accent {
    height: 5px;
    background: linear-gradient(90deg, var(--rose-400), var(--gold-400), var(--rose-400));
}

.card-content {
    padding: 50px 35px;
    text-align: center;
}

.quote-icon {
    color: var(--rose-300);
    margin-bottom: 25px;
}

.quote-icon [data-lucide] {
    width: 36px;
    height: 36px;
}

.message-lines {
    margin-bottom: 30px;
}

.message-line {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 2;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.6s ease-out;
}

.message-line.visible {
    opacity: 1;
    transform: translateY(0);
}

.message-highlight {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--rose-100) 0%, var(--rose-200) 100%);
    border-radius: 50px;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--rose-700);
}

.message-highlight [data-lucide] {
    width: 22px;
    height: 22px;
    color: var(--rose-500);
}

/* ============================================
   WISHES SECTION
   ============================================ */
.wishes-section {
    padding: 60px 20px;
    background: white;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.wishes-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.wishes-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 500px;
    margin: 0 auto;
}

.wish-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 24px;
    background: var(--rose-50);
    border-radius: 16px;
    transition: var(--transition-smooth);
    opacity: 0;
    transform: translateY(15px);
}

.wish-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.wish-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-soft);
    background: white;
}

.wish-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 12px;
    color: var(--rose-500);
    box-shadow: var(--shadow-soft);
}

.wish-icon [data-lucide] {
    width: 24px;
    height: 24px;
}

.wish-item p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ============================================
   QUALITIES SECTION
   ============================================ */
.qualities-section {
    padding: 60px 20px;
    background: linear-gradient(180deg, var(--rose-100) 0%, var(--rose-50) 100%);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.qualities-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.qualities-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 500px;
    margin: 0 auto;
}

.quality-card {
    background: white;
    border-radius: 20px;
    padding: 30px 24px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

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

.quality-card [data-lucide] {
    width: 36px;
    height: 36px;
    color: var(--rose-500);
    margin-bottom: 15px;
}

.quality-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--rose-700);
    margin-bottom: 8px;
}

.quality-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* ============================================
   CELEBRATION SECTION
   ============================================ */
.celebration-section {
    padding: 50px 20px;
    text-align: center;
    background: white;
}

.celebration-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 48px;
    font-size: 1.25rem;
    font-family: inherit;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--rose-500) 0%, var(--rose-600) 50%, var(--gold-500) 100%);
    background-size: 200% auto;
    border: 2px solid white;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 
        0 8px 25px rgba(217, 101, 122, 0.4),
        0 0 0 4px rgba(255, 255, 255, 0.3);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.celebration-btn:hover {
    background-position: right center;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 15px 35px rgba(217, 101, 122, 0.5),
        0 0 0 6px rgba(255, 255, 255, 0.4);
}

.celebration-btn:active {
    transform: scale(0.96);
}

.celebration-btn [data-lucide] {
    width: 28px;
    height: 28px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    padding: 60px 20px;
    background: linear-gradient(180deg, var(--rose-50) 0%, var(--rose-100) 100%);
    text-align: center;
}

.footer-content {
    max-width: 400px;
    margin: 0 auto;
}

.footer-icon {
    color: var(--rose-400);
    margin-bottom: 20px;
}

.footer-icon [data-lucide] {
    width: 32px;
    height: 32px;
}

.footer-from {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.footer-signature {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--rose-600);
    margin-bottom: 8px;
}

.footer-role {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.footer-divider {
    width: 60px;
    height: 2px;
    background: var(--rose-300);
    margin: 0 auto 25px;
}

.footer-date {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--rose-500);
}

.footer-date [data-lucide] {
    width: 18px;
    height: 18px;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-name {
        font-size: 2.6rem;
    }
    
    .cake-svg {
        max-width: 280px;
    }
    
    .section-header h3 {
        font-size: 1.3rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    /* Opening Scene */
    .opening-scene {
        padding: 30px 15px;
    }
    
    .elegant-envelope {
        width: 240px;
        height: 170px;
    }
    
    .letter {
        top: 70px;
        left: 15px;
        width: 210px;
        height: 130px;
    }
    
    .letter-icon {
        width: 28px;
        height: 28px;
    }
    
    .letter p {
        font-size: 0.95rem;
    }
    
    .opening-title {
        font-size: 1.5rem;
    }
    
    .opening-subtitle {
        font-size: 1rem;
        margin-bottom: 25px;
    }
    
    .open-btn {
        padding: 14px 32px;
        font-size: 1rem;
    }
    
    /* Hero Section */
    .hero {
        padding: 40px 15px 35px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-name {
        font-size: 2.2rem;
    }
    
    .hero-date {
        font-size: 0.9rem;
        padding: 8px 18px;
    }
    
    /* Cake Section */
    .cake-section {
        padding: 40px 15px;
    }
    
    .cake-svg {
        max-width: 240px;
    }
    
    .cake-hint, .cake-wish {
        font-size: 0.95rem;
    }
    
    /* Sections */
    .section-header {
        margin-bottom: 25px;
    }
    
    .section-header h3 {
        font-size: 1.2rem;
    }
    
    .section-header [data-lucide] {
        width: 22px;
        height: 22px;
    }
    
    /* Gratitude Card */
    .gratitude-section {
        padding: 40px 15px;
    }
    
    .gratitude-card {
        border-radius: 18px;
    }
    
    .card-content {
        padding: 35px 20px;
    }
    
    .quote-icon [data-lucide] {
        width: 28px;
        height: 28px;
    }
    
    .message-line {
        font-size: 1.05rem;
        line-height: 1.8;
    }
    
    .message-highlight {
        padding: 12px 20px;
        font-size: 1rem;
        gap: 8px;
    }
    
    .message-highlight [data-lucide] {
        width: 18px;
        height: 18px;
    }
    
    /* Wishes Grid */
    .wishes-section {
        padding: 40px 15px;
    }
    
    .wishes-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .wish-item {
        padding: 16px 18px;
        gap: 12px;
    }
    
    .wish-icon {
        width: 42px;
        height: 42px;
    }
    
    .wish-icon [data-lucide] {
        width: 20px;
        height: 20px;
    }
    
    .wish-item p {
        font-size: 0.95rem;
    }
    
    /* Qualities Grid */
    .qualities-section {
        padding: 40px 15px;
    }
    
    .qualities-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .quality-card {
        padding: 24px 20px;
        border-radius: 16px;
    }
    
    .quality-card [data-lucide] {
        width: 30px;
        height: 30px;
        margin-bottom: 12px;
    }
    
    .quality-card h4 {
        font-size: 1rem;
    }
    
    .quality-card p {
        font-size: 0.9rem;
    }
    
    /* Celebration Button */
    .celebration-section {
        padding: 35px 15px;
    }
    
    .celebration-btn {
        padding: 15px 35px;
        font-size: 1.1rem;
        gap: 10px;
    }
    
    .celebration-btn [data-lucide] {
        width: 24px;
        height: 24px;
    }
    
    /* Footer */
    .footer {
        padding: 45px 15px;
    }
    
    .footer-from {
        font-size: 1rem;
    }
    
    .footer-signature {
        font-size: 1.4rem;
    }
    
    .footer-date {
        font-size: 0.85rem;
    }
}

/* ============================================
   Accessibility: Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
