/* ===== CSS Variables ===== */
:root {
    --color-primary: #e8a0b5;
    --color-primary-light: #f5d0dc;
    --color-primary-dark: #c77d94;
    --color-secondary: #f7e8e8;
    --color-accent: #d4a5a5;
    --color-background: #fdf8f8;
    --color-surface: #ffffff;
    --color-text: #5a4a4a;
    --color-text-light: #8b7b7b;
    --color-text-muted: #b8a8a8;
    
    --font-display: 'Cormorant Garamond', serif;
    --font-body: 'Quicksand', sans-serif;
    
    --shadow-soft: 0 4px 20px rgba(232, 160, 181, 0.15);
    --shadow-medium: 0 8px 30px rgba(232, 160, 181, 0.2);
    --shadow-large: 0 15px 50px rgba(232, 160, 181, 0.25);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== Floating Hearts Background ===== */
.floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.heart {
    position: absolute;
    color: var(--color-primary-light);
    opacity: 0.5;
    animation: float 10s linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-10vh) rotate(360deg);
        opacity: 0;
    }
}

/* ===== Loading Screen ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-background) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.loading-heart {
    width: 80px;
    height: 80px;
    color: var(--color-primary);
    margin: 0 auto 24px;
    animation: heartbeat 1.2s ease-in-out infinite;
}

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

.loading-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-style: italic;
    color: var(--color-text);
    margin-bottom: 20px;
    animation: fadeInUp 1s ease;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background-color: var(--color-primary);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
}

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

/* ===== Main Content ===== */
.main-content {
    opacity: 0;
    transition: opacity 0.8s ease;
    position: relative;
    z-index: 0;
}

.main-content.visible {
    opacity: 1;
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(180deg, var(--color-secondary) 0%, var(--color-background) 100%);
}

.hero-content {
    max-width: 600px;
    animation: fadeInUp 1s ease 0.3s both;
}

.hero-badge {
    display: inline-block;
    padding: 8px 20px;
    background-color: var(--color-surface);
    color: var(--color-primary-dark);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.1;
    margin-bottom: 24px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-light);
    line-height: 1.8;
    max-width: 480px;
    margin: 0 auto 48px;
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ===== Section Common Styles ===== */
.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-tag {
    display: inline-block;
    padding: 6px 16px;
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: var(--radius-full);
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--color-text-light);
    max-width: 500px;
    margin: 0 auto;
}

/* ===== Open When Section ===== */
.open-when {
    padding: 80px 20px;
    background-color: var(--color-background);
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.open-card {
    background-color: var(--color-surface);
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    border: 1px solid rgba(232, 160, 181, 0.1);
}

.open-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-large);
}

.card-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    color: var(--color-primary);
    transition: transform var(--transition-normal);
}

.open-card:hover .card-icon {
    transform: scale(1.1);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 8px;
}

.card-hint {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(90, 74, 74, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-large);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background-color: var(--color-secondary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.modal-close:hover {
    background-color: var(--color-primary-light);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-content {
    padding: 48px 32px 40px;
    text-align: center;
}

.modal-icon {
    width: 64px;
    height: 64px;
    color: var(--color-primary);
    margin: 0 auto 24px;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 20px;
}

.modal-message {
    font-size: 1.05rem;
    color: var(--color-text-light);
    line-height: 1.8;
}

/* ===== Memory Album Section ===== */
.memories {
    padding: 80px 20px;
    background: linear-gradient(180deg, var(--color-background) 0%, var(--color-secondary) 100%);
}

.slideshow-container {
    max-width: 700px;
    margin: 0 auto;
}

.slideshow {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-large);
    background-color: var(--color-surface);
}

.slide {
    display: none;
    animation: fadeIn 0.5s ease;
}

.slide.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-image {
    width: 100%;
    height: 600px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

.slide-image img{
    width: 400px;
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.placeholder-content svg {
    width: 48px;
    height: 48px;
}

.placeholder-content span {
    font-size: 0.9rem;
    font-weight: 500;
}

.slide-caption {
    padding: 20px 24px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--color-text);
    text-align: center;
    background-color: var(--color-surface);
}

.slideshow-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 24px;
}

.slide-btn {
    width: 48px;
    height: 48px;
    background-color: var(--color-surface);
    border: 1px solid rgba(232, 160, 181, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-soft);
}

.slide-btn:hover {
    background-color: var(--color-primary);
    color: white;
    transform: scale(1.05);
}

.slide-btn svg {
    width: 20px;
    height: 20px;
}

.slide-dots {
    display: flex;
    gap: 10px;
}

.slide-dot {
    width: 10px;
    height: 10px;
    background-color: var(--color-accent);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    opacity: 0.4;
}

.slide-dot.active {
    opacity: 1;
    background-color: var(--color-primary);
    transform: scale(1.2);
}

/* ===== Final Message Section ===== */
.final-message {
    padding: 100px 20px;
    background: linear-gradient(180deg, var(--color-secondary) 0%, var(--color-primary-light) 100%);
    text-align: center;
}

.final-content {
    max-width: 600px;
    margin: 0 auto;
}

.final-heart {
    width: 60px;
    height: 60px;
    color: var(--color-primary-dark);
    margin: 0 auto 24px;
    animation: heartbeat 1.5s ease-in-out infinite;
}

.final-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 24px;
}

.final-text {
    font-size: 1.15rem;
    color: var(--color-text-light);
    line-height: 1.9;
    margin-bottom: 40px;
}

.final-signature {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--color-text);
    line-height: 1.8;
}

.signature {
    font-size: 1.5rem;
    font-style: italic;
}

/* ===== Secret Button ===== */
.secret-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 50px;
    height: 50px;
    background-color: var(--color-surface);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    box-shadow: var(--shadow-medium);
    transition: all var(--transition-normal);
    z-index: 100;
    opacity: 0.7;
}

.secret-btn:hover {
    opacity: 1;
    transform: scale(1.1) rotate(20deg);
    color: var(--color-primary-dark);
}

.secret-btn svg {
    width: 24px;
    height: 24px;
}

/* ===== Music Button ===== */
.music-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 50px;
    height: 50px;
    background-color: var(--color-surface);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    box-shadow: var(--shadow-medium);
    transition: all var(--transition-normal);
    z-index: 100;
}

.music-btn:hover {
    transform: scale(1.1);
    color: var(--color-primary-dark);
}

.music-btn svg {
    width: 24px;
    height: 24px;
}

.music-btn .music-off {
    display: none;
}

.music-btn.muted .music-on {
    display: none;
}

.music-btn.muted .music-off {
    display: block;
}

/* ===== Surprise Overlay ===== */
.surprise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-slow);
}

.surprise-overlay.active {
    opacity: 1;
    visibility: visible;
}

.surprise-content {
    text-align: center;
    color: white;
    padding: 40px;
    transform: scale(0.8);
    transition: transform var(--transition-slow);
}

.surprise-overlay.active .surprise-content {
    transform: scale(1);
}

.surprise-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 8vw, 4rem);
    margin-bottom: 20px;
}

.surprise-text {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 32px;
}

.surprise-close {
    padding: 12px 32px;
    background-color: white;
    color: var(--color-primary-dark);
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.surprise-close:hover {
    transform: scale(1.05);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .hero {
        padding: 60px 20px;
    }
    
    .cards-container {
        grid-template-columns: 1fr;
        max-width: 320px;
    }
    
    .open-card {
        padding: 32px 24px;
    }
    
    .modal-content {
        padding: 40px 24px 32px;
    }
    
    .slideshow-controls {
        gap: 16px;
    }
    
    .slide-btn {
        width: 42px;
        height: 42px;
    }
    
    .final-message {
        padding: 60px 20px;
    }
    
    .secret-btn,
    .music-btn {
        width: 44px;
        height: 44px;
    }
    
    .secret-btn {
        bottom: 16px;
        left: 16px;
    }
    
    .music-btn {
        bottom: 16px;
        right: 16px;
    }
}

@media (max-width: 480px) {
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
    
    .slide-caption {
        font-size: 1rem;
        padding: 16px 20px;
    }
}

/* ===== Animations on Scroll ===== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}
