/* ============================================
   Wedding Invitation — Ibrahim & Dewi
   Modern Minimalis Theme
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    --color-bg: #0a0a1a;
    --color-bg-section: #0d0d24;
    --color-bg-card: rgba(255, 255, 255, 0.04);
    --color-card-border: rgba(255, 255, 255, 0.08);
    --color-text: #e8e6e3;
    --color-text-muted: #8a8a9a;
    --color-text-accent: #c9a96e;
    --color-gold: #c9a96e;
    --color-gold-light: #dfc08a;
    --color-gold-dark: #a07d3f;
    --color-white: #ffffff;
    --color-success: #4ade80;
    --color-error: #f87171;

    --font-serif: 'Cormorant Garamond', 'Georgia', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --container-max: 680px;
    --section-padding: 80px 20px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.preloading {
    overflow: hidden;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--color-gold-dark);
    border-radius: 4px;
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }

/* ---------- Preloader ---------- */
.preloader {
    position: fixed;
    inset: 0;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.6s ease;
}

.preloader-hide {
    opacity: 0;
    pointer-events: none;
}

.preloader-inner {
    text-align: center;
    animation: preloaderPulse 1.5s ease-in-out infinite;
}

.preloader-title {
    display: block;
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 5vw, 2.4rem);
    color: var(--color-gold);
    letter-spacing: 0.08em;
}

.preloader-sub {
    display: block;
    margin-top: 10px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--color-text-muted);
}

@keyframes preloaderPulse {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-4px); }
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 10;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1040 50%, #0a0a1a 100%);
}

#heroCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;
}

.hero-bismillah {
    font-size: clamp(1rem, 3vw, 1.4rem);
    color: var(--color-gold-light);
    margin-bottom: 24px;
    letter-spacing: 0.05em;
    direction: rtl;
}

.hero-subtitle {
    font-family: var(--font-sans);
    font-size: clamp(0.75rem, 2vw, 0.9rem);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.hero-names {
    font-family: var(--font-serif);
    font-size: clamp(2.2rem, 8vw, 4rem);
    font-weight: 300;
    color: var(--color-white);
    line-height: 1.2;
    margin-bottom: 16px;
}

.hero-names .amp {
    display: inline-block;
    color: var(--color-gold);
    font-style: italic;
    margin: 0 8px;
    font-weight: 300;
}

.hero-date {
    font-family: var(--font-sans);
    font-size: clamp(0.8rem, 2.5vw, 1rem);
    font-weight: 300;
    letter-spacing: 0.5em;
    color: var(--color-text-muted);
    margin-bottom: 40px;
}

/* Buka Undangan Button */
.btn-open {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    background: transparent;
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-open::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(201, 169, 110, 0.15), transparent);
    transition: left 0.5s ease;
}

.btn-open:hover::before,
.btn-open:active::before {
    left: 100%;
}

.btn-open:hover,
.btn-open:active {
    background: rgba(201, 169, 110, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(201, 169, 110, 0.2);
}

.btn-icon {
    width: 16px;
    height: 16px;
    animation: bounceDown 2s ease-in-out infinite;
}

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

/* Hero Fade Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease-out forwards;
}

.delay-1 { animation-delay: 0.3s; }
.delay-2 { animation-delay: 0.6s; }
.delay-3 { animation-delay: 0.9s; }
.delay-4 { animation-delay: 1.2s; }

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

/* Hero Exit Animation */
.hero-section.hero-exit {
    animation: heroFadeOut 0.8s ease forwards;
    pointer-events: none;
}

@keyframes heroFadeOut {
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    display: none;
    opacity: 0;
}

.main-content.visible {
    display: block;
    animation: contentFadeIn 0.8s ease 0.3s forwards;
}

@keyframes contentFadeIn {
    to { opacity: 1; }
}

/* ============================================
   SECTIONS — General
   ============================================ */
.section {
    padding: var(--section-padding);
    position: relative;
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    font-weight: 400;
    text-align: center;
    color: var(--color-white);
    margin-bottom: 8px;
}

.section-divider {
    width: 60px;
    height: 1px;
    background: var(--color-gold);
    margin: 0 auto 32px auto;
}

.section-desc {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    max-width: 480px;
    margin: 0 auto 40px auto;
    line-height: 1.7;
}

/* ---------- Glass Card ---------- */
.glass-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform var(--transition), box-shadow var(--transition);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(201, 169, 110, 0.08);
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.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);
}

.animate-on-scroll.slide-left {
    transform: translateX(-30px);
}

.animate-on-scroll.slide-right {
    transform: translateX(30px);
}

.animate-on-scroll.slide-left.visible,
.animate-on-scroll.slide-right.visible {
    transform: translateX(0);
}

/* Stagger delay for children */
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }

/* ============================================
   COUPLE SECTION
   ============================================ */
.couple-section {
    background: var(--color-bg-section);
}

.couple-cards {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.couple-card {
    padding: 32px 24px;
    text-align: center;
    width: 100%;
    max-width: 320px;
}

.couple-photo-wrapper {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--color-gold);
    padding: 3px;
}

.couple-photo-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(201, 169, 110, 0.1), rgba(201, 169, 110, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
}

.couple-photo-placeholder svg {
    width: 40px;
    height: 40px;
    color: var(--color-gold);
}

.couple-photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.couple-name {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--color-white);
    margin-bottom: 8px;
}

.couple-info {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.couple-parents {
    font-size: 0.85rem;
    color: var(--color-text);
}

.couple-separator {
    display: flex;
    align-items: center;
    justify-content: center;
}

.couple-amp {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    color: var(--color-gold);
    font-style: italic;
    font-weight: 300;
}

/* ============================================
   EVENTS SECTION
   ============================================ */
.event-cards {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

.event-card {
    padding: 32px 24px;
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.event-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--color-gold);
}

.event-icon svg {
    width: 100%;
    height: 100%;
}

.event-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--color-white);
    margin-bottom: 16px;
}

.event-detail {
    margin-bottom: 20px;
}

.event-date {
    font-weight: 500;
    color: var(--color-gold-light);
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.event-time {
    color: var(--color-text);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

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

.btn-map {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid var(--color-card-border);
    border-radius: 50px;
    color: var(--color-text);
    font-size: 0.8rem;
    text-decoration: none;
    transition: all var(--transition);
}

.btn-map:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
    background: rgba(201, 169, 110, 0.05);
}

/* ============================================
   COUNTDOWN SECTION
   ============================================ */
.countdown-section {
    background: var(--color-bg-section);
}

.countdown-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
    padding: 16px 12px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-sm);
}

.countdown-number {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 6vw, 2.4rem);
    font-weight: 600;
    color: var(--color-gold);
    line-height: 1;
    transition: transform 0.3s ease;
}

.countdown-number.flip {
    animation: numberFlip 0.3s ease;
}

@keyframes numberFlip {
    0% { transform: scaleY(1); }
    50% { transform: scaleY(0); }
    100% { transform: scaleY(1); }
}

.countdown-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 8px;
}

.countdown-separator {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--color-gold-dark);
    padding-bottom: 20px;
}

/* ============================================
   GIFT SECTION
   ============================================ */
.gift-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.gift-card {
    padding: 28px 24px;
    text-align: center;
    width: 100%;
    max-width: 380px;
}

.gift-bank-logo {
    margin-bottom: 16px;
}

.bank-name {
    display: inline-block;
    padding: 6px 20px;
    border: 1px solid var(--color-gold);
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--color-gold);
}

.gift-account-number {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--color-white);
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.gift-account-name {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 1px solid var(--color-card-border);
    border-radius: 50px;
    background: transparent;
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-copy:hover,
.btn-copy:active {
    border-color: var(--color-gold);
    color: var(--color-gold);
    background: rgba(201, 169, 110, 0.05);
}

.btn-copy.copied {
    border-color: var(--color-success);
    color: var(--color-success);
}

/* ============================================
   RSVP SECTION
   ============================================ */
.rsvp-section {
    background: var(--color-bg-section);
}

.rsvp-form {
    max-width: 440px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.required {
    color: var(--color-gold);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* Radio Buttons */
.radio-group {
    display: flex;
    gap: 20px;
}

.radio-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    color: var(--color-text) !important;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-card-border);
    border-radius: 50%;
    position: relative;
    transition: all var(--transition);
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--color-gold);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--color-gold);
    border-radius: 50%;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--color-gold-dark), var(--color-gold));
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-bg);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(201, 169, 110, 0.3);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
}

.spinner {
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   GUESTBOOK SECTION
   ============================================ */
.guestbook-list {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guestbook-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.guest-entry {
    padding: 20px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-sm);
    animation: guestFadeIn 0.4s ease forwards;
}

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

.guest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.guest-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-white);
}

.guest-status {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.guest-status.hadir {
    background: rgba(74, 222, 128, 0.15);
    color: var(--color-success);
}

.guest-status.tidak {
    background: rgba(248, 113, 113, 0.15);
    color: var(--color-error);
}

.guest-message {
    font-size: 0.85rem;
    color: var(--color-text);
    line-height: 1.6;
    margin-bottom: 8px;
}

.guest-date {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

/* ============================================
   MUSIC TOGGLE
   ============================================ */
.music-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--color-card-border);
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--color-gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.music-toggle:hover {
    border-color: var(--color-gold);
    transform: scale(1.05);
}

.music-icon {
    width: 20px;
    height: 20px;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(10, 10, 26, 0.95);
    border: 1px solid var(--color-gold);
    color: var(--color-text);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 200;
    text-align: center;
    max-width: 90vw;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   FOOTER
   ============================================ */
.footer-section {
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid var(--color-card-border);
}

.footer-text {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.footer-sub {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    color: var(--color-gold);
}

/* ============================================
   RESPONSIVE — Tablet+
   ============================================ */
@media (min-width: 600px) {
    .couple-cards {
        flex-direction: row;
        justify-content: center;
    }

    .event-cards {
        flex-direction: row;
        justify-content: center;
    }

    .gift-cards {
        flex-direction: row;
        justify-content: center;
    }

    .countdown-item {
        min-width: 80px;
        padding: 20px 16px;
    }
}

/* ============================================
   PREFERS REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
