/* --- 1. Import Google Fonts --- */
/* (Sudah diimpor di HTML) */

/* --- 2. Variabel CSS & Reset --- */
:root {
    --color-primary: #8D6E63; /* Coklat Kopi */
    --color-secondary: #5D4037; /* Coklat Tua */
    --color-bg-light: #FBFBFB;
    --color-bg-header: #EFEBE9;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Lato', sans-serif;
    --font-script: 'Dancing Script', cursive;
}

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

body {
    font-family: var(--font-sans);
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    color: var(--color-secondary);
}

.font-playfair { font-family: var(--font-serif); }
.font-lato { font-family: var(--font-sans); }
.font-dancing { font-family: var(--font-script); }

/* --- 3. Halaman Cover --- */
#cover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 100;
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
    overflow: hidden;
}

#cover-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 101;
    animation: kenburns 30s ease-in-out infinite;
    transform: scale(1.05);
}

@keyframes kenburns {
    0% { transform: scale(1.05); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1.05); }
}

#cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0.2) 60%, rgba(0,0,0,0.5));
    z-index: 102;
}

.cover-content {
    position: relative;
    z-index: 103;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.cover-content h1 {
    color: white;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.6);
}

.nama-tamu-cover {
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 1rem 1.5rem;
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border-radius: 8px;
}
.nama-tamu-cover h2 { color: white; }

#bukaUndangan {
    animation: fadeInUp 1s ease-out 2s forwards;
    opacity: 0;
}

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

/* Animasi saat cover dibuka */
#cover.opened {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

/* --- 4. Konten Utama (Disembunyikan Awal) --- */
#content {
    opacity: 0; 
    transform: translateY(20px); 
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
    visibility: hidden; 
    background-color: var(--color-bg-light);
    overflow: hidden; /* Mencegah AOS bocor */
}
#content.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

/* --- 5. Header & Countdown --- */
.header {
    padding: 5rem 1rem;
    background-size: cover;
    background-position: center;
    position: relative;
    color: white;
}
.header-overlay {
    background-color: rgba(0,0,0,0.6);
    position: relative;
    z-index: 2;
    padding: 3rem 0;
}
.header h1, .header h2 {
    color: white;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.5);
}

#countdown {
    gap: 1rem;
}
.unit {
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    min-width: 75px;
    color: var(--color-secondary);
}
.unit span {
    font-size: 2rem;
    font-weight: bold;
    display: block;
}
.unit label {
    font-size: 0.8rem;
    color: #777;
}

/* --- 6. Styling Section --- */
section {
    padding: 4rem 1rem;
}
section.bg-light {
    background-color: #f8f9fa;
}

.section-title {
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    display: inline-block;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--color-primary);
    border-radius: 2px;
}

/* --- 7. Override Bootstrap --- */
.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    transition: all 0.3s ease;
}
.btn-primary:hover {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.btn-outline-primary {
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn-outline-primary:hover {
    background-color: var(--color-primary);
    color: white;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.25rem rgba(141, 110, 99, 0.25);
}

.text-primary {
    color: var(--color-primary) !important;
}

.card {
    border: none;
    border-radius: 0.75rem;
}

/* --- 8. Pesan Form --- */
.pesan-sukses {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 0.75rem 1.25rem;
    border-radius: 0.25rem;
    text-align: center;
}
.pesan-gagal {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem 1.25rem;
    border-radius: 0.25rem;
    text-align: center;
}

/* --- 9. Daftar Ucapan --- */
#daftarUcapan {
    margin-top: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: white;
}
.item-ucapan {
    border-bottom: 1px dashed #ccc;
    padding: 1.25rem;
}
.item-ucapan:last-child {
    border-bottom: none;
}
.item-ucapan strong {
    color: var(--color-secondary);
    display: block;
    font-size: 1.1rem;
}

/* --- 10. Tombol Musik --- */
#musicToggleButton {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: none; /* Awalnya disembunyikan */
    animation: spin 3s linear infinite; /* Animasi berputar */
}

#musicToggleButton.playing {
    animation-play-state: running;
}

#musicToggleButton.paused {
    animation-play-state: paused;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- 11. Responsive --- */
@media (max-width: 768px) {
    .header { padding: 3rem 1rem; }
    .header-overlay { padding: 2rem 0; }
    .display-1, .display-2 { font-size: 3rem; }
    
    #countdown {
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    .unit {
        padding: 0.5rem;
        min-width: 65px;
    }
    .unit span {
        font-size: 1.5rem;
    }
    
    section { padding: 3rem 1rem; }
    .mempelai .col-md-2 { display: none; }
}