/* ==========================================================================
   STYLE.CSS - VISUAL LOVE SPACE (ULTRA MOBILE-FRIENDLY & ANY ASPECT RATIO)
   Theme: Soft Light Cream Vanilla & Pastel Yellow, Red, Orange
   ========================================================================== */

:root {
    /* Pastel Accents */
    --pastel-yellow: #f59e0b;      /* Warm Golden Yellow Accent */
    --pastel-yellow-light: #fff8db;
    --pastel-orange: #ff8c52;      /* Soft Sunset Orange Accent */
    --pastel-orange-light: #ffede0;
    --pastel-red: #ff5e6c;         /* Soft Pastel Red/Coral Accent */
    --pastel-red-light: #ffe5e8;

    /* Light Theme Backgrounds & Surfaces */
    --bg-primary: #fffaf5;         /* Soft Cream Vanilla */
    --bg-card: rgba(255, 255, 255, 0.88);
    --border-card: rgba(255, 140, 82, 0.25);
    --border-hover: rgba(255, 94, 108, 0.5);
    
    /* Text Colors for Light Background */
    --text-primary: #331e36;       /* Deep Warm Velvet Brown */
    --text-secondary: #6e4c73;     /* Muted Warm Purple-Gray */
    --text-muted: #9e7f9f;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --font-romantic: 'Dancing Script', cursive;
    --transition-smooth: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    background: linear-gradient(135deg, #fffaf5 0%, #fff0f3 50%, #fff7e6 100%);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    position: relative;
}

/* Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* Top Controls (Mobile Responsive) */
.top-controls {
    position: fixed;
    top: 16px;
    right: 16px;
    left: 16px;
    z-index: 50;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    pointer-events: none;
}

.control-btn {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--border-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 6px 20px rgba(255, 140, 82, 0.15);
}

.control-btn:hover, .control-btn:active {
    background: #ffffff;
    border-color: var(--pastel-red);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 94, 108, 0.25);
}

.control-btn.accent-btn {
    background: linear-gradient(135deg, #ffe5e8 0%, #ffede0 100%);
    border-color: rgba(255, 94, 108, 0.4);
    color: var(--pastel-red);
}

.spin-icon {
    font-size: 1rem;
    color: var(--pastel-orange);
    animation: spin 3s linear infinite;
}

.spin-icon.muted {
    animation-play-state: paused;
    color: var(--text-muted);
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* App Container */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 76px 20px 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* Hero Header */
.hero-header {
    text-align: center;
    margin-bottom: 36px;
    animation: fadeInDown 0.8s ease-out;
    width: 100%;
}

.heart-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 94, 108, 0.1);
    border: 1px solid rgba(255, 94, 108, 0.3);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--pastel-red);
    margin-bottom: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pulse-fast {
    animation: pulse 1.2s ease-in-out infinite;
}

.main-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 6vw, 3.5rem);
    font-weight: 800;
    background: linear-gradient(135deg, #ff5e6c 0%, #ff8c52 50%, #e69d00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
    line-height: 1.25;
}

.subtitle {
    font-size: clamp(0.88rem, 3.2vw, 1.05rem);
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 4 Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    width: 100%;
    margin-bottom: 48px;
}

.love-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 26px 20px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 260px;
    box-shadow: 0 10px 30px rgba(255, 140, 82, 0.1);
}

.love-card:hover, .love-card:active {
    transform: translateY(-6px) scale(1.015);
    border-color: var(--border-hover);
    box-shadow: 0 18px 36px rgba(255, 94, 108, 0.2);
    background: #ffffff;
}

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

.card-badge {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--pastel-orange);
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.card-icon-wrapper {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
    transition: var(--transition-smooth);
}

.lock-glow { background: var(--pastel-red-light); color: var(--pastel-red); }
.envelope-glow { background: var(--pastel-orange-light); color: var(--pastel-orange); }
.music-glow { background: var(--pastel-yellow-light); color: var(--pastel-yellow); }
.photo-glow { background: var(--pastel-red-light); color: var(--pastel-red); }

.card-icon {
    font-size: 1.6rem;
    z-index: 2;
    transition: var(--transition-smooth);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

.card-action {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--pastel-red);
    transition: var(--transition-smooth);
}

/* Footer */
.footer {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

.heart-beat {
    color: var(--pastel-red);
    animation: heartBeat 1.3s infinite;
    display: inline-block;
    margin: 0 4px;
}

/* MODAL OVERLAY */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(51, 30, 54, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

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

.modal-card-box {
    background: #ffffff;
    border: 1px solid rgba(255, 140, 82, 0.3);
    box-shadow: 0 25px 60px rgba(51, 30, 54, 0.25), 0 0 30px rgba(255, 94, 108, 0.15);
    border-radius: 24px;
    width: 100%;
    max-width: 600px;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    padding: 28px 20px;
    color: var(--text-primary);
    animation: zoomIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-card-box.edit-box {
    max-width: 720px;
}

.close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    z-index: 10;
}

.close-btn:hover, .close-btn:active {
    background: var(--pastel-red);
    color: #ffffff;
}

/* CARD 1: BLOOMING FLOWER CANVAS */
.flower-stage {
    position: relative;
    width: 100%;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fffbf7 0%, #ffede0 100%);
    border-radius: 18px;
}

#flower-canvas {
    width: 100%;
    height: 100%;
    pointer-events: auto;
    cursor: pointer;
}

.bloom-trigger-btn {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    border: 1px solid var(--pastel-orange);
    color: var(--pastel-red);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(255, 140, 82, 0.2);
    white-space: nowrap;
}

/* LDR MAP BOX */
.ldr-map-box {
    background: #fffaf5;
    border: 1px solid rgba(255, 140, 82, 0.3);
    border-radius: 18px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 14px 0;
    gap: 8px;
}

.city-node {
    text-align: center;
    flex: 1;
}

.city-icon {
    font-size: 1.5rem;
    color: var(--pastel-red);
    margin-bottom: 2px;
}

.city-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.distance-connector {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.plane-line {
    width: 100%;
    height: 2px;
    border-top: 2px dashed var(--pastel-orange);
    margin: 8px 0;
    position: relative;
}

.flying-plane {
    position: absolute;
    top: -10px;
    left: 45%;
    color: var(--pastel-orange);
    font-size: 1rem;
    animation: flyFlight 3s ease-in-out infinite alternate;
}

.distance-badge {
    background: var(--pastel-yellow-light);
    border: 1px solid var(--pastel-yellow);
    color: var(--text-primary);
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

/* CARD 2: ENVELOPE */
.envelope-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.envelope-3d {
    width: 100%;
    background: #fffaf5;
    border: 1px solid rgba(255, 140, 82, 0.3);
    border-radius: 18px;
    padding: 20px 16px;
    box-shadow: 0 12px 30px rgba(255, 94, 108, 0.1);
}

.letter-paper {
    background: #ffffff;
    border-radius: 12px;
    padding: 18px 16px;
    border-left: 4px solid var(--pastel-orange);
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-line;
}

/* CARD 3: MUSIC & VINYL */
.vinyl-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.vinyl-disc {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, #3d273a 30%, #1e121d 70%);
    border: 4px solid #fff3e6;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.vinyl-disc.playing {
    animation: spin 4s linear infinite;
}

.vinyl-center {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pastel-red), var(--pastel-orange));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.music-play-btn {
    background: linear-gradient(135deg, #ff5e6c 0%, #ff8c52 100%);
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    border-radius: 35px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(255, 94, 108, 0.35);
    transition: var(--transition-smooth);
    margin-bottom: 20px;
    width: 100%;
    max-width: 260px;
}

/* CARD 4: 3D FLIP BOOK WITH ALL ASPECT RATIOS SUPPORT (PORTRAIT & LANDSCAPE) */
.flipbook-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    perspective: 1000px;
}

.flipbook-spine {
    background: linear-gradient(135deg, #fffbf7 0%, #fff5eb 100%);
    border: 2px solid rgba(255, 140, 82, 0.3);
    border-radius: 18px;
    padding: 16px 12px;
    width: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.polaroid-book-frame {
    background: #ffffff;
    padding: 14px 14px 20px 14px;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(51, 30, 54, 0.1);
    width: 100%;
    position: relative;
    margin-bottom: 12px;
}

.book-tape-sticker {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    background: rgba(255, 231, 143, 0.85);
    color: var(--text-primary);
    padding: 3px 16px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    z-index: 5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* PHOTO BOX SUPPORTING BOTH PORTRAIT & LANDSCAPE PERFECTLY */
.polaroid-img-box {
    width: 100%;
    height: 320px;
    max-height: 60vh;
    background: radial-gradient(circle, #fffbf7 0%, #ffede0 100%);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    padding: 8px;
    border: 1px solid rgba(255, 140, 82, 0.15);
}

.polaroid-img-box img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(51, 30, 54, 0.12);
}

.book-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
    margin-top: 12px;
}

.book-nav-btn {
    background: linear-gradient(135deg, var(--pastel-red), var(--pastel-orange));
    color: #ffffff;
    border: none;
    padding: 8px 14px;
    border-radius: 18px;
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 15px rgba(255, 94, 108, 0.3);
}

.page-indicator {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--pastel-orange);
    background: var(--pastel-orange-light);
    padding: 4px 10px;
    border-radius: 14px;
    white-space: nowrap;
}

/* EDIT CUSTOMIZER FORM MOBILE */
.modal-header h2 {
    font-size: 1.1rem;
}

.customizer-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    padding: 6px 12px;
    font-size: 0.78rem;
    border-radius: 10px;
}

.form-group label {
    font-size: 0.78rem;
}

.form-group input,
.form-group textarea {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.form-actions {
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 10px;
    font-size: 0.85rem;
}

/* MEDIA QUERIES FOR EXTRA SMALL MOBILE SCREENS (< 480px) */
@media (max-width: 480px) {
    .top-controls {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .control-btn span {
        font-size: 0.72rem;
    }

    .app-container {
        padding: 70px 14px 30px 14px;
    }

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

    .love-card {
        padding: 20px 16px;
        min-height: auto;
    }

    .polaroid-img-box {
        height: 260px;
    }
}

@keyframes flyFlight {
    0% { left: 5%; transform: rotate(0deg); }
    100% { left: 85%; transform: rotate(5deg); }
}

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

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

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

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