/* CSS Design System for Birthday Web App - Optimized for Desktop, Tablet, and Smartphone */
:root {
    --primary: #e63946;
    --primary-gradient: linear-gradient(135deg, #ff4d6d 0%, #c9184a 50%, #800f2f 100%);
    --gold-gradient: linear-gradient(135deg, #ffe066 0%, #f7aef8 50%, #f72585 100%);
    --accent-gold: #ffb703;
    --bg-dark: #0f051d;
    --bg-card: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-light: #ffffff;
    --text-sub: #f8c8dc;
    --font-heading: 'Playfair Display', serif;
    --font-cursive: 'Dancing Script', cursive;
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --shadow-glow: 0 10px 30px rgba(255, 77, 109, 0.35);
}

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

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 10% 20%, rgba(201, 24, 74, 0.3) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(128, 15, 47, 0.4) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(15, 5, 29, 0.95) 0px, transparent 100%);
    background-attachment: fixed;
    color: var(--text-light);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Canvas background */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Floating Music Control */
.music-control-container {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 100;
}

.glass-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 10px 18px;
    border-radius: 50px;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.glass-btn.playing {
    background: rgba(255, 77, 109, 0.3);
    border-color: #ff4d6d;
    box-shadow: 0 0 20px rgba(255, 77, 109, 0.8);
}

.fa-spin-slow {
    animation: fa-spin 4s infinite linear;
}

.pulse-glow {
    animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px rgba(255, 77, 109, 0.4); }
    100% { box-shadow: 0 0 22px rgba(255, 77, 109, 0.9); }
}

/* Song Info Banner */
.song-info-banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 0, 0, 0.15);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: #ffd1dc;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.82rem;
    margin: 10px auto 0;
}

.youtube-icon {
    color: #ff0000;
    font-size: 1.1rem;
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px 60px;
    position: relative;
    z-index: 2;
    text-align: center;
}

/* Glass Card Common */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: clamp(20px, 4vw, 36px);
    margin-bottom: 35px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    transition: transform 0.3s ease, border-color 0.3s ease;
    text-align: left;
}

.glass-card:hover {
    border-color: rgba(255, 77, 109, 0.4);
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: clamp(20px, 5vw, 40px) 10px clamp(30px, 6vw, 50px);
}

.badge-container {
    margin-bottom: 20px;
}

.birthday-badge {
    background: rgba(255, 77, 109, 0.15);
    border: 1px solid rgba(255, 77, 109, 0.4);
    color: var(--text-sub);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: clamp(0.75rem, 2vw, 0.9rem);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.heart-icon {
    color: #ff4d6d;
    animation: heartBeat 1.2s infinite ease-in-out;
}

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

.main-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 5vw, 3rem);
    line-height: 1.2;
    margin-bottom: 15px;
    font-weight: 700;
}

.highlight-name {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: var(--font-cursive);
    font-size: clamp(2.5rem, 8vw, 4.2rem);
    font-weight: 700;
    display: block;
    margin-top: 8px;
    word-break: break-word;
    text-shadow: 0 0 20px rgba(247, 37, 133, 0.3);
}

.subtitle {
    font-size: clamp(0.95rem, 2.5vw, 1.2rem);
    color: var(--text-sub);
    max-width: 620px;
    margin: 0 auto 30px;
    font-weight: 300;
}

.hero-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: clamp(12px, 2.5vw, 15px) clamp(22px, 4vw, 30px);
    border-radius: 50px;
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    min-height: 48px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 35px rgba(255, 77, 109, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.btn-gold {
    background: linear-gradient(135deg, #ffb703 0%, #fb8500 100%);
    color: #000;
    font-weight: 700;
    box-shadow: 0 8px 25px rgba(255, 183, 3, 0.4);
}

.btn-gold:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(255, 183, 3, 0.6);
}

/* Envelope Modal */
.envelope-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.envelope-modal.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.envelope-wrapper {
    position: relative;
    z-index: 2;
    max-width: 650px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 24px;
    animation: zoomIn 0.4s ease forwards;
}

@keyframes zoomIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.letter-card {
    background: linear-gradient(145deg, rgba(30, 15, 45, 0.96), rgba(15, 5, 25, 0.98));
    border: 2px solid rgba(255, 77, 109, 0.4);
    margin-bottom: 0;
}

.letter-header {
    text-align: center;
    margin-bottom: 25px;
}

.crown-icon {
    font-size: 2rem;
    color: var(--accent-gold);
    margin-bottom: 10px;
}

.letter-header h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    color: #fff;
}

.decorative-line {
    height: 2px;
    width: 80px;
    background: var(--gold-gradient);
    margin: 12px auto 0;
    border-radius: 2px;
}

.letter-body {
    font-size: clamp(0.95rem, 2.5vw, 1.05rem);
    color: #e2d9f3;
    line-height: 1.8;
}

.letter-body p {
    margin-bottom: 15px;
}

.salutation {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    color: #fff;
}

.signature-quote {
    font-family: var(--font-cursive);
    font-size: clamp(1.1rem, 3.5vw, 1.4rem);
    color: #ff9ebb;
    background: rgba(255, 77, 109, 0.1);
    padding: 15px 20px;
    border-left: 3px solid #ff4d6d;
    border-radius: 8px;
    margin-top: 20px;
}

.letter-footer {
    text-align: right;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sender {
    font-weight: 600;
}

.heart-text {
    color: #ff4d6d;
}

/* Cake Section */
.section-title-wrap {
    text-align: center;
    margin-bottom: 25px;
}

.section-subtitle {
    color: #ff9ebb;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    font-weight: 700;
}

.section-title-wrap h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    color: #fff;
    margin-top: 5px;
}

.cake-display-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.cake-img-wrapper {
    position: relative;
    width: clamp(200px, 50vw, 290px);
    height: clamp(200px, 50vw, 290px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(255, 183, 3, 0.4);
}

.cake-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cake-img-wrapper:hover .cake-img {
    transform: scale(1.05);
}

.candles-overlay {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
}

.flame-particle {
    width: 12px;
    height: 20px;
    background: radial-gradient(circle, #ffbe0b 0%, #fb5607 60%, transparent 100%);
    border-radius: 50% 50% 20% 20%;
    animation: flicker 0.6s infinite alternate;
    box-shadow: 0 0 15px #ffbe0b, 0 0 25px #fb5607;
}

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

.flame-particle.extinguished {
    display: none;
}

.cake-controls {
    text-align: center;
    width: 100%;
}

.cake-hint {
    color: var(--text-sub);
    margin-bottom: 15px;
    font-size: clamp(0.85rem, 2.2vw, 0.95rem);
}

.wish-reveal {
    margin-top: 20px;
    animation: fadeIn 0.5s ease forwards;
}

.wish-box {
    background: rgba(255, 183, 3, 0.12);
    border: 1px dashed var(--accent-gold);
    border-radius: 16px;
    padding: 18px 22px;
    color: #fff;
    font-size: clamp(0.9rem, 2.5vw, 1.05rem);
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.spark-icon {
    font-size: 1.8rem;
    color: var(--accent-gold);
    flex-shrink: 0;
}

/* Romantic Single Message Card Section */
.romantic-card-box {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 20px;
    padding: clamp(20px, 4vw, 30px);
    border: 1px solid rgba(255, 183, 3, 0.25);
    position: relative;
    box-shadow: inset 0 0 20px rgba(255, 77, 109, 0.08);
}

.quote-decoration {
    font-size: 2rem;
    color: rgba(255, 183, 3, 0.3);
    margin-bottom: 10px;
}

.romantic-msg-content {
    font-size: clamp(0.95rem, 2.4vw, 1.08rem);
    color: #e2d9f3;
    line-height: 1.8;
}

.copy-action-bar {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
}

.copy-btn {
    width: auto;
}

/* Grid Cards (Reasons / Wishes) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.wish-card {
    text-align: center;
    padding: 25px 18px;
    margin-bottom: 0;
}

.card-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 77, 109, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.4rem;
    color: #ff4d6d;
}

.wish-card h3 {
    font-size: clamp(1rem, 2.2vw, 1.1rem);
    margin-bottom: 10px;
    color: #fff;
}

.wish-card p {
    font-size: clamp(0.85rem, 2vw, 0.9rem);
    color: var(--text-sub);
}

/* Accordion */
.accordion-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accordion-item {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}

.accordion-header {
    width: 100%;
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: clamp(0.9rem, 2.4vw, 1rem);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-align: left;
    transition: background 0.3s ease;
    min-height: 50px;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.accordion-header i.fa-gem, .accordion-header i.fa-sun, .accordion-header i.fa-ring {
    color: #ff4d6d;
    margin-right: 10px;
}

.accordion-header .arrow {
    transition: transform 0.3s ease;
    margin-left: 10px;
}

.accordion-item.active .arrow {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 20px;
    color: var(--text-sub);
    font-size: clamp(0.85rem, 2.2vw, 0.95rem);
}

.accordion-item.active .accordion-content {
    padding: 15px 20px 20px;
    max-height: 220px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4d6d;
    color: #fff;
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(255, 77, 109, 0.5);
    z-index: 2000;
    transition: opacity 0.3s ease;
    text-align: center;
    max-width: 90%;
    font-size: 0.9rem;
}

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

/* Footer */
.app-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    margin-top: 30px;
}

.song-credit {
    margin-top: 5px;
    font-size: 0.8rem;
}

.song-credit a {
    color: #ff9ebb;
    text-decoration: underline;
}

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

/* =============================================================
   RESPONSIVE BREAKPOINTS: Desktop, Tablet, Smartphone
   ============================================================= */

@media (min-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1023px) and (min-width: 768px) {
    .app-container {
        padding: 30px 24px 50px;
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .cake-display-container {
        flex-direction: row;
        justify-content: center;
        align-items: center;
    }

    .cake-controls {
        text-align: left;
        max-width: 380px;
    }

    .copy-action-bar {
        justify-content: center;
    }

    .copy-btn {
        width: 100%;
    }
}

@media (max-width: 767px) {
    .music-control-container {
        top: 12px;
        right: 12px;
    }

    .app-container {
        padding: 25px 15px 40px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .wish-box {
        flex-direction: column;
        text-align: center;
    }

    .copy-action-bar {
        justify-content: center;
    }

    .copy-btn {
        width: 100%;
    }

    .envelope-wrapper {
        margin: 10px;
        max-height: 85vh;
    }

    .letter-footer {
        text-align: center;
    }
}
