/* --- Google Fonts & CSS Variables --- */
:root {
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Be Vietnam Pro', sans-serif;
    --font-handwriting: 'Caveat', cursive;
    --primary-color: #d19a9a; 
    --secondary-color: #f5e9e9; 
    --text-color: #5d5d5d;
    --dark-color: #4a4a4a;
    --bg-color: #fffdfd;
    --white-color: #ffffff;
}

/* --- Global Styles & Resets --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--dark-color);
    font-weight: 700;
}

h2 {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 50px;
    position: relative;
}

h2::after {
    content: '❤';
    font-family: var(--font-body);
    display: block;
    color: var(--primary-color);
    font-size: 1rem;
    margin-top: 10px;
}

section {
    padding: 80px 0;
    position: relative;
}

/* --- Section Colors --- */
.invitation, .schedule, .gifting {
    background-color: var(--bg-color);
}
.story, .location-map, .wishes {
    background-color: var(--secondary-color);
}


/* --- Sakura Petal Effect --- */
.sakura-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.sakura-petal {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50% 0;
    opacity: 0.7;
    animation: fall linear infinite;
}

@keyframes fall {
    0% { transform: translateY(-10vh) translateX(0) rotate(0deg); }
    100% { transform: translateY(110vh) translateX(5vw) rotate(360deg); }
}

/* --- Music Toggle Button --- */
.music-button {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--secondary-color);
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, background-color 0.3s;
}
.music-button:hover {
    transform: scale(1.1);
}

/* --- Cover Page --- */
.cover {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: url('https://placehold.co/1200x800/f5e9e9/a07a7a?text=Thuc+Nhu+%26+Phan+Cao') no-repeat center center/cover;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
    color: var(--white-color);
}
.cover.fade-out {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}
.cover-content {
    background: rgba(0,0,0,0.35);
    padding: 40px 60px;
    border-radius: 10px;
    animation: fadeIn 2s ease-in-out;
}
.cover-intro { font-size: 1.5rem; letter-spacing: 2px; }
.cover h1 { font-size: 5rem; color: var(--white-color); margin: 0; }
.cover .cover-and { font-family: var(--font-heading); font-size: 3rem; color: var(--primary-color); margin: -15px 0; }

#open-invitation {
    margin-top: 30px;
    padding: 15px 35px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.3s, background-color 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
#open-invitation:hover {
    transform: translateY(-3px);
    background-color: #c48787;
}

/* --- Main Content --- */
#main-content {
    display: none;
    animation: fadeInContent 1.5s ease-in-out;
}

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

/* THÊM MỚI: Hiệu ứng xuất hiện khi cuộn trang */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform;
}
.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}


/* --- Hero & Countdown --- */
.hero { 
    text-align: center; 
    padding: 100px 0;
    background-image: url('https://placehold.co/1920x1080/f5e9e9/a07a7a?text=Background');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative; 
}
.hero-content {
    position: relative;
    z-index: 2;
}
.hero-content h1 { font-size: 4.5rem; color: var(--dark-color); }
.hero-content p { color: var(--dark-color); }
.countdown { margin-top: 40px; position: relative; z-index: 2; transition: all 0.5s ease-in-out;}
.countdown h2 { font-size: 1.8rem; font-weight: 400; color: var(--dark-color); }
.countdown h2::after { display: none; }
.timer { display: flex; justify-content: center; gap: 20px; margin-top: 20px; }
.time-box { background: var(--white-color); padding: 20px; border-radius: 8px; box-shadow: 0 5px 20px rgba(0,0,0,0.06); min-width: 90px; }
.time-box span { display: block; font-size: 3rem; font-weight: bold; color: var(--primary-color); line-height: 1; }
.time-box p { font-size: 0.9rem; margin-top: 5px; color: var(--text-color); }

#countdown-wrapper {
    position: relative;
    z-index: 2;
}

/* --- Sticky Countdown Header --- */
.countdown.sticky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    margin-top: 0;
    padding: 10px 0;
    background-color: rgba(255, 253, 253, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    z-index: 999;
    animation: slideDown 0.5s ease-out;
}
.countdown.sticky h2 {
    display: none;
}
.countdown.sticky .timer {
    margin-top: 0;
}
.countdown.sticky .time-box {
    padding: 8px;
    min-width: 70px;
    box-shadow: none;
}
.countdown.sticky .time-box span {
    font-size: 1.8rem;
}
.countdown.sticky .time-box p {
    font-size: 0.7rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- Invitation Section --- */
.invitation .intro-text { text-align: center; max-width: 700px; margin: -30px auto 50px; font-size: 1.15rem; }
.event-details { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }
.event-card { background: var(--white-color); padding: 40px; border-radius: 8px; text-align: center; width: 350px; box-shadow: 0 5px 25px rgba(0,0,0,0.08); transition: transform 0.3s; }
.event-card:hover { transform: translateY(-5px); }
.event-card h3 { font-size: 2rem; color: var(--primary-color); }
.event-card.main-event { border-top: 5px solid var(--primary-color); }
.event-card .time, .event-card .location { font-weight: 500; font-size: 1.1rem; margin-top: 10px; }

/* --- Story Timeline --- */
.timeline { position: relative; max-width: 700px; margin: 0 auto; }
.timeline::after { content: ''; position: absolute; width: 3px; background-color: #e3c1c1; top: 0; bottom: 0; left: 50%; margin-left: -1.5px; }
.timeline-item { padding: 10px 40px; position: relative; width: 50%; }
.timeline-item:nth-child(odd) { left: 0; }
.timeline-item:nth-child(even) { left: 50%; }
.timeline-icon { position: absolute; width: 40px; height: 40px; right: -20px; background-color: var(--primary-color); top: 30px; border-radius: 50%; z-index: 1; font-size: 20px; color: white; display: flex; justify-content: center; align-items: center; }
.timeline-item:nth-child(even) .timeline-icon { left: -20px; }
.timeline-content { padding: 25px; background-color: var(--white-color); border-radius: 6px; box-shadow: 0 3px 15px rgba(0,0,0,0.07); }
.timeline-content h3 { color: var(--primary-color); margin-bottom: 5px; }

/* --- Schedule Section --- */
.schedule-list { max-width: 600px; margin: 0 auto; }
.schedule-item { display: flex; align-items: center; background-color: var(--white-color); padding: 18px 30px; border-radius: 50px; margin-bottom: 18px; box-shadow: 0 3px 15px rgba(0,0,0,0.06); border-left: 4px solid var(--primary-color); }
.schedule-item .time { font-weight: bold; color: var(--primary-color); margin-right: 25px; min-width: 130px; }
.schedule-item p { margin: 0; font-size: 1.1rem; }

/* --- Polaroid Gallery Styles --- */
.gallery {
    background-color: #d8c4a9; /* Corkboard color */
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%20100%22%20width%3D%22100%22%20height%3D%22100%22%3E%3Cfilter%20id%3D%22n%22%3E%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%220.7%22%20numOctaves%3D%2210%22%20stitchTiles%3D%22stitch%22/%3E%3C/filter%3E%3Crect%20width%3D%22100%22%20height%3D%22100%22%20filter%3D%22url(%23n)%22%20opacity%3D%220.1%22/%3E%3C/svg%3E');
}
.polaroid-container {
    position: relative;
    max-width: 90%;
    margin: 0 auto;
}
.polaroid-scroll-wrapper {
    overflow-x: hidden;
    position: relative;
    padding: 20px 0;
}
.polaroid-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 30px;
    padding: 0 20px;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.polaroid-grid::-webkit-scrollbar {
    display: none;
}
.polaroid-item {
    flex-shrink: 0;
    width: 250px;
    background: var(--white-color);
    padding: 15px 15px 25px 15px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.15);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s;
    cursor: pointer;
}
.polaroid-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}
.polaroid-item p {
    font-family: var(--font-handwriting);
    text-align: center;
    margin-top: 15px;
    font-size: 1.5rem;
    color: var(--text-color);
}
.polaroid-item:hover {
    transform: scale(1.05) rotate(0deg) !important;
    box-shadow: 10px 10px 25px rgba(0,0,0,0.2);
    z-index: 10;
}
.polaroid-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
}
.polaroid-nav:hover {
    background: rgba(255, 255, 255, 1);
}
.polaroid-nav.prev {
    left: -25px;
}
.polaroid-nav.next {
    right: -25px;
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s;
}
.lightbox.active {
    display: flex;
}
.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    animation: zoomIn 0.5s;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}
.lightbox-close:hover {
    color: #bbb;
}
.lightbox-prev, .lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 2rem;
    transition: 0.3s;
    user-select: none;
}
.lightbox-next {
    right: 10px;
    border-radius: 3px 0 0 3px;
}
.lightbox-prev {
    left: 10px;
    border-radius: 0 3px 3px 0;
}
.lightbox-prev:hover, .lightbox-next:hover {
    background-color: rgba(255, 255, 255, 0.2);
}
@keyframes zoomIn {
    from {transform: scale(0.8);}
    to {transform: scale(1);}
}


/* --- Map & Wishes Section --- */
.location-map, .gifting {
    text-align: center;
}
.map-container { margin-top: 30px; border-radius: 10px; overflow: hidden; box-shadow: 0 5px 20px rgba(0,0,0,0.1); }
.map-link { display: inline-block; margin-top: 30px; padding: 12px 30px; background-color: var(--primary-color); color: white; text-decoration: none; border-radius: 25px; transition: background-color 0.3s, transform 0.3s; }
.map-link:hover { background-color: #c48787; transform: translateY(-2px); }

#wish-form { max-width: 700px; margin: 0 auto 40px; display: flex; flex-direction: column; gap: 15px; }
#wish-form button { padding: 15px; background-color: var(--primary-color); color: white; border: none; border-radius: 5px; font-size: 1.1rem; cursor: pointer; transition: background-color 0.3s; }
#wish-form input, #wish-form textarea { width: 100%; padding: 15px; border: 1px solid #ddd; border-radius: 5px; font-family: var(--font-body); font-size: 1rem; }
#wish-form textarea { resize: vertical; min-height: 120px; }
.wishes-list { max-width: 700px; margin: 0 auto; }
.wish-item { background-color: var(--white-color); padding: 20px; border-radius: 5px; margin-bottom: 15px; border-left: 5px solid var(--primary-color); box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.wish-item strong { color: var(--dark-color); display: block; margin-bottom: 8px; font-size: 1.1rem; }

#qr-toggle { padding: 12px 30px; background-color: transparent; color: var(--primary-color); border: 2px solid var(--primary-color); border-radius: 25px; font-size: 1.1rem; cursor: pointer; transition: all 0.3s; }
#qr-toggle:hover { background-color: var(--primary-color); color: white; }
.qr-code-container { margin-top: 30px; transition: all 0.5s ease; max-height: 500px; overflow: hidden; opacity: 1; }
.qr-code-container.hidden { max-height: 0; margin-top: 0; opacity: 0; }
.qr-code-container img { border: 1px solid #eee; padding: 5px; background: white; }

/* --- Footer --- */
footer { padding: 80px 20px; text-align: center; background-color: var(--primary-color); color: white; }
footer h2, footer h3 { color: white; }
footer h2::after { color: white; }
.chibi-couple { width: 150px; height: 150px; border-radius: 50%; margin-bottom: 20px; background-color: white; object-fit: cover; border: 3px solid white; box-shadow: 0 0 15px rgba(0,0,0,0.2); }
footer p { font-size: 1.1rem; margin-bottom: 20px; }
footer h3 { font-family: var(--font-body); font-weight: 400; font-size: 1.5rem; }
.copyright {
    margin-top: 30px;
    margin-bottom: 0;
    font-size: 0.8rem;
    opacity: 0.7;
    letter-spacing: 1px;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    html { font-size: 14px; }
    h2 { font-size: 2.2rem; }
    
    .cover h1 { font-size: 3.5rem; }
    .hero-content h1 { font-size: 3.5rem; }
    .timer { gap: 10px; }
    .time-box { padding: 15px 10px; min-width: 70px; }
    .time-box span { font-size: 2rem; }

    .timeline::after { left: 20px; }
    .timeline-item, .timeline-item:nth-child(even) { width: 100%; left: 0; padding-left: 60px; padding-right: 15px; }
    .timeline-icon, .timeline-item:nth-child(even) .timeline-icon { left: 0; }
    
    .schedule-item { flex-direction: column; align-items: flex-start; border-radius: 10px; }
    .schedule-item .time { margin-bottom: 5px; }
    
    .polaroid-nav { width: 40px; height: 40px; }
    .polaroid-nav.prev { left: 0; }
    .polaroid-nav.next { right: 0; }
}

@media (max-width: 480px) {
    .cover-content { padding: 30px; }
    .cover h1 { font-size: 2.8rem; }
    .hero-content h1 { font-size: 2.8rem; }
    .event-card { width: 100%; }
    .timer { flex-wrap: wrap; }
    .time-box { width: calc(50% - 10px); }

    .countdown.sticky .timer {
        gap: 8px;
    }
    .countdown.sticky .time-box {
        padding: 5px;
        min-width: 60px;
    }
    .countdown.sticky .time-box span {
        font-size: 1.5rem;
    }
    .countdown.sticky .time-box p {
        font-size: 0.65rem;
        margin-top: 3px;
    }
}
