/* ======================================= */
/* === 0. FONT & KONFIGURASI DASAR === */
/* ======================================= */

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Poppins:wght@300;400;600&display=swap');

/* Variabel Warna Tema Gorontalo (Merah Gelap & Emas) */
:root {
    --color-primary: #DAA520; /* Emas (Goldenrod) - Warna utama */
    --color-secondary: #A00000; /* Merah Marun - Warna Aksen (untuk footer, dll) */
    --color-text: #F5F5F5; /* Teks Putih Gading */
    --color-bg: #2a0000; /* Latar Belakang Merah Sangat Gelap */
    --font-sans: 'Poppins', sans-serif;
    --font-serif-adat: 'Cormorant Garamond', serif; 
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif-adat); 
    color: var(--color-primary); /* Emas */
    margin-bottom: 1rem;
    font-weight: 700;
}

p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

a {
    color: var(--color-primary);
}

.font-adat {
    font-family: var(--font-serif-adat);
}

.section-padding {
    padding: 60px 20px;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

/* Latar belakang motif Karawo (Gorontalo) */
.batik-background {
    /* Ganti 'motif-gorontalo.png' dengan file gambar Anda */
    /* Overlay sekarang menggunakan warna merah gelap */
    background-image: linear-gradient(rgba(42,0,0,0.8), rgba(42,0,0,0.8)), url('/images/motif-gorontalo.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Efek parallax */
}

/* ======================================= */
/* === 1. SAMPUL (COVER) === */
/* ======================================= */
.cover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg); /* Latar merah gelap */
    background-image: url('/images/foto-sampul.png');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 1000;
    transition: opacity 1.5s ease-out, visibility 1.5s;
    opacity: 1;
    visibility: visible;
}

.cover-content {
    background: rgba(42, 0, 0, 0.8); /* Latar Merah Gelap Pekat (dari --color-bg) */
    padding: 40px;
    border-radius: 10px;
    border: 1px solid var(--color-primary);
}

/* Teks paragraf di sampul jadi putih bersih agar kontras */
.cover-content p {
    color: #FFFFFF;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.cover.hidden {
    opacity: 0;
    visibility: hidden;
}

.main-content {
    display: none;
}

.main-content.visible {
    display: block;
}

#open-invitation {
    background: var(--color-primary);
    color: var(--color-bg); /* Teks jadi Merah Gelap */
    font-weight: 600;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

#open-invitation:hover {
    background: #FFD700;
}

/* ======================================= */
/* === 2. HERO (NAMA PASANGAN) === */
/* ======================================= */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('/images/background.png') no-repeat center center/cover;
    color: white;
}

.hero h1 {
    font-size: 4rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.hero p {
    font-size: 1.2rem;
    color: white;
}
.divider-img {
    width: 100px;
    margin-top: 20px;
    filter: brightness(0) invert(1);
}

/* ======================================= */
/* === 3. KISAH KAMI (TIMELINE) === */
/* ======================================= */
.timeline-container {
    position: relative;
    max-width: 900px;
    margin: 40px auto 0;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background-color: var(--color-primary); /* Emas */
    opacity: 0.3;
    transform: translateX(-50%);
}

.story-item {
    padding: 10px 0;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}

.story-item-content {
    padding: 20px 30px;
    background-color: rgba(255, 255, 255, 0.05); /* Latar netral semi-transparan */
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    position: relative;
}

.story-item-content i {
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 10px;
}

.story-item:nth-child(odd) {
    float: left;
    clear: both;
    text-align: right;
    padding-right: 40px;
}

.story-item:nth-child(even) {
    float: right;
    clear: both;
    text-align: left;
    padding-left: 40px;
}

.story-item::after {
    content: '';
    position: absolute;
    top: 25px;
    width: 16px;
    height: 16px;
    background: var(--color-primary);
    border: 2px solid var(--color-bg);
    border-radius: 50%;
    z-index: 1;
}

.story-item:nth-child(odd)::after {
    right: -8px;
}

.story-item:nth-child(even)::after {
    left: -8px;
}

.story-item-content::before {
    content: '';
    position: absolute;
    top: 25px;
    width: 0;
    height: 0;
    border-style: solid;
}

.story-item:nth-child(odd) .story-item-content::before {
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.05);
}

.story-item:nth-child(even) .story-item-content::before {
    left: -10px;
    border-width: 10px 10px 10px 0;
    border-color: transparent rgba(255, 255, 255, 0.05) transparent transparent;
}

.timeline-container::after {
    content: "";
    display: table;
    clear: both;
}

/* ======================================= */
/* === 4. COUNTDOWN === */
/* ======================================= */
#countdown-timer {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.timer-box {
    background: var(--color-primary);
    color: var(--color-bg); /* Teks Merah Gelap */
    padding: 15px;
    border-radius: 10px;
    min-width: 80px;
    text-align: center;
}

.timer-box span {
    display: block;
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-bg);
}

/* ======================================= */
/* === 5. LOKASI === */
/* ======================================= */
.location-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
}

.location-card {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    padding: 25px;
    border-radius: 10px;
    flex: 1;
    min-width: 280px;
}
.location-card i {
    color: var(--color-primary);
    margin-right: 10px;
}

.map-embed {
    margin-top: 30px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--color-primary);
}

/* Tombol */
.btn-primary {
    display: inline-block;
    background: var(--color-primary);
    color: var(--color-bg);
    font-weight: 600;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 25px;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}
.btn-primary:hover {
    background: #FFD700;
    color: var(--color-bg);
}

.btn-secondary {
    display: inline-block;
    background: var(--color-secondary); /* Merah Marun */
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 25px;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

/* ======================================= */
/* === 7. MODAL AMPLOP === */
/* ======================================= */
.modal {
    /* display: none; <-- KITA GANTI INI */
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Memperbolehkan modal di-scroll jika isinya panjang */
    background-color: rgba(0,0,0,0.8);

    /* === BARU: Pusatkan dengan Flexbox === */
    display: flex;
    align-items: center;
    justify-content: center;

    /* === BARU: Sembunyikan dengan Opacity untuk Transisi === */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* === BARU: Kelas untuk Menampilkan Modal === */
.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--color-bg);
    /* margin: 15% auto; <-- DIHAPUS */
    margin: 20px; /* Beri jarak aman dari tepi layar */
    padding: 30px;
    border: 1px solid var(--color-primary);
    width: 90%; /* Buat 90% agar pas di HP */
    max-width: 500px; /* Batas di desktop */
    border-radius: 10px;
    text-align: center;
    position: relative;
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.account {
    margin-top: 20px;
}

/* ======================================= */
/* === 8. RSVP FORM === */
/* ======================================= */
#rsvp-form {
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-family: var(--font-sans);
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-primary);
    color: var(--color-text);
}

/* ======================================= */
/* === 9. BUKU TAMU === */
/* ======================================= */
#guestbook-messages {
    max-height: 400px;
    overflow-y: auto;
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    padding: 20px;
    background: rgba(0,0,0,0.2);
}

.guestbook-entry {
    background: rgba(255, 255, 255, 0.1); /* Sedikit lebih pekat */
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: left;
}
.guestbook-entry h4 {
    color: var(--color-primary);
    margin-bottom: 5px;
}
/* Teks ucapan jadi putih bersih */
.guestbook-entry p {
    color: #FFFFFF;
    opacity: 0.95;
}

/* ======================================= */
/* === 10. GALERI === */
/* ======================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.gallery-grid img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    transition: transform 0.3s, border-color 0.3s;
}
.gallery-grid img:hover {
    transform: scale(1.05);
    border-color: var(--color-primary);
}

/* ======================================= */
/* === 11. FOOTER === */
/* ======================================= */
.footer {
    background: var(--color-secondary); /* Latar Merah Marun */
    color: var(--color-primary); /* Teks Emas */
    text-align: center;
    padding: 40px 20px;
}
.footer p, .footer h1, .footer h2, .footer strong {
    color: var(--color-primary);
}

/* ======================================= */
/* === TOMBOL MUSIK === */
/* ======================================= */
#music-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    color: var(--color-bg);
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 99;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* ======================================= */
/* === RESPONSIVE (MEDIA QUERIES) === */
/* ======================================= */

/* Terapkan gaya ini jika layar 768px atau lebih kecil */
@media (max-width: 768px) {

    /* Hero */
    .hero h1 {
        font-size: 2.5rem;
    }

    /* Countdown */
    .timer-box {
        padding: 10px;
        min-width: 65px;
        font-size: 0.8rem;
    }
    .timer-box span {
        font-size: 1.8rem;
    }

    /* Galeri */
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }

    /* --- Penyesuaian Timeline di Mobile --- */
    .timeline-container::before {
        left: 20px;
        transform: translateX(0);
    }
    .story-item,
    .story-item:nth-child(even),
    .story-item:nth-child(odd) {
        width: 100%;
        float: none;
        clear: none;
        text-align: left;
        padding-left: 60px;
        padding-right: 15px;
    }
    .story-item::after,
    .story-item:nth-child(odd)::after,
    .story-item:nth-child(even)::after {
        left: 20px;
        transform: translateX(-50%);
    }
    .story-item-content::before,
    .story-item:nth-child(odd) .story-item-content::before,
    .story-item:nth-child(even) .story-item-content::before {
        left: -10px;
        border-width: 10px 10px 10px 0;
        border-color: transparent rgba(255, 255, 255, 0.05) transparent transparent;
    }
}

/* Terapkan gaya tambahan ini jika layar SANGAT kecil (HP) 480px */
@media (max-width: 480px) {

    /* Hero */
    .hero h1 {
        font-size: 2.2rem;
    }

    /* Countdown */
    #countdown-timer {
        gap: 8px;
    }
    .timer-box {
        padding: 8px;
        min-width: 55px;
        font-size: 0.7rem;
    }
    .timer-box span {
        font-size: 1.5rem;
    }

    /* Lokasi */
    .location-card {
        padding: 20px;
    }
    .location-card h3 {
        font-size: 1.2rem;
    }
}