/**
 * JemputLah - Base Stylesheet v1.1
 * Reka bentuk responsif mesra mudah alih (mobile-first), ringan, kontras tinggi & meriah.
 */

:root {
    --font-display: 'Georgia', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --color-bg: #1c1c1c;
    --color-card: #ffffff;
    --color-text: #222222;
    --color-text-muted: #555555;
    --color-primary: #8b5a2b;
    --color-primary-hover: #704720;
    --color-accent: #d4af37;
    --color-accent-light: #fef7e6;
    --color-border: #e2e8f0;
    --color-cover-bg: #1a1a1a;
    --color-cover-text: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 6px 16px rgba(0,0,0,0.08);
    --radius: 12px;
}

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

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

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

/* Container Wrapper (Format E-Kad Mobile First) */
.kad-wrapper {
    width: 100%;
    max-width: 480px;
    background-color: var(--color-card);
    min-height: 100vh;
    box-shadow: 0 0 35px rgba(0,0,0,0.3);
    position: relative;
    padding-bottom: 80px;
    margin: 0 auto;
    overflow: hidden;
}

/* ==========================================================================
   1. COVER OVERLAY (Buka Kad) - Dijamin 100% Legap (Opaque)
   ========================================================================== */
.cover-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background-color: var(--color-cover-bg);
    color: var(--color-cover-text);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2.5rem 1.5rem;
    opacity: 1;
    visibility: visible;
    transition: transform 0.85s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.85s ease, visibility 0.85s;
    box-sizing: border-box;
}

.cover-overlay.opened {
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.cover-content {
    max-width: 420px;
    width: 100%;
    position: relative;
    z-index: 2;
    animation: coverContentIn 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.cover-frame {
    border: 2px solid var(--color-accent);
    padding: 2.25rem 1.25rem;
    border-radius: 16px;
    position: relative;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.cover-frame::before {
    content: '';
    position: absolute;
    inset: 5px;
    border: 1px dashed var(--color-accent);
    border-radius: 12px;
    pointer-events: none;
    opacity: 0.7;
}

.cover-badge {
    display: inline-block;
    font-size: 0.9rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 1rem;
    font-weight: 700;
}

.cover-names {
    font-family: var(--font-display);
    font-size: 2.35rem;
    line-height: 1.2;
    margin-bottom: 0.85rem;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.cover-date {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    font-weight: 500;
}

.btn-open-card {
    background: var(--color-accent);
    color: #1a1a1a;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    padding: 14px 34px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-open-card:hover, .btn-open-card:focus {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.45);
}

/* Floating Controllers (Music & Lang Toggle) */
.floating-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fab-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-card);
    color: var(--color-text);
    border: 1.5px solid var(--color-accent);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: transform 0.2s;
}

.fab-btn:hover {
    transform: scale(1.1);
}

.fab-btn.playing {
    animation: rotateDisc 5s linear infinite;
}

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

/* Top Lang Toggle */
.lang-toggle-wrap {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
}

.btn-lang {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    color: var(--color-text);
    font-family: inherit;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s;
}

.btn-lang:hover {
    background: #ffffff;
    border-color: var(--color-accent);
}

/* ==========================================================================
   PARTICLES (Falling Petals / Sparkles) - Meriah & Ringan
   ========================================================================== */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 998;
    overflow: hidden;
}

.particle {
    position: absolute;
    top: -30px;
    pointer-events: none;
    user-select: none;
    will-change: transform;
    animation: fallAnimation linear infinite;
}

@keyframes fallAnimation {
    0% {
        transform: translateY(-20px) rotate(0deg) translateX(0);
        opacity: 0.9;
    }
    100% {
        transform: translateY(105vh) rotate(360deg) translateX(35px);
        opacity: 0.1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .particles-container { display: none !important; }
    .cover-overlay { transition: opacity 0.4s ease !important; }
    .cover-content { animation: none !important; }
}

/* ==========================================================================
   2. SECTIONS & CARDS (Dengan Scroll Reveal)
   ========================================================================== */
.section {
    padding: 2.75rem 1.5rem;
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--color-border);
}

.section:last-of-type {
    border-bottom: none;
}

/* Scroll Reveal */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.section-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

/* Ornamental Divider */
.ornamental-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem 0;
    gap: 12px;
    opacity: 0.8;
}

.ornamental-divider::before,
.ornamental-divider::after {
    content: '';
    height: 1px;
    flex: 1;
    background: linear-gradient(to right, transparent, var(--color-accent), transparent);
}

.ornamental-divider-symbol {
    color: var(--color-accent);
    font-size: 1.1rem;
}

/* Bismillah & Opening */
.bismillah {
    font-size: 1.7rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
    line-height: 1.5;
}

.host-names {
    font-weight: 700;
    font-size: 1.2rem;
    margin: 1.25rem 0;
    color: var(--color-text);
}

.opening-text {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--color-text);
    margin-bottom: 1.25rem;
}

.doa-box {
    background: rgba(0,0,0,0.02);
    border-left: 3px solid var(--color-accent);
    border-right: 1px solid var(--color-border);
    padding: 1.2rem;
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 1.5rem 0;
    border-radius: 0 10px 10px 0;
    color: var(--color-text-muted);
}

/* ==========================================================================
   3. EVENT DETAILS & BUTTONS
   ========================================================================== */
.event-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
    position: relative;
}

.event-card-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.event-info-item {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.event-venue {
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 0.6rem;
}

.event-address {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 1.25rem;
}

.btn-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--color-border);
    background: #ffffff;
    color: var(--color-text);
    transition: all 0.15s ease;
    flex: 1;
    min-width: 110px;
    font-family: inherit;
}

.btn-action:hover {
    background: #f1f5f9;
}

.btn-action.btn-primary {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

.btn-action.btn-primary:hover {
    background: var(--color-primary-hover);
}

/* ==========================================================================
   4. COUNTDOWN TIMER (Dengan Pulse / Flip Feel)
   ========================================================================== */
.countdown-grid {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 1.5rem 0 0.5rem;
}

.countdown-box {
    background: var(--color-primary);
    color: #ffffff;
    padding: 12px 10px;
    border-radius: 10px;
    min-width: 68px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.countdown-num {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    display: block;
    font-variant-numeric: tabular-nums;
}

.countdown-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    margin-top: 4px;
    display: block;
    font-weight: 600;
}

.cd-pulse {
    transform: scale(1.06);
}

/* ==========================================================================
   5. ATURCARA (ITINERARY)
   ========================================================================== */
.timeline {
    position: relative;
    max-width: 380px;
    margin: 0 auto;
    text-align: left;
    padding-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--color-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.4rem;
    padding-left: 22px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -19px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-accent);
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 2px var(--color-accent);
}

.timeline-time {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-primary);
}

.timeline-desc {
    font-size: 1rem;
    color: var(--color-text);
}

/* ==========================================================================
   6. GALLERY (Ganjil Memenuhi Baris Akhir)
   ========================================================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

/* Jika jumlah imej ganjil, jadikan imej terakhir merentasi 2 lajur */
.gallery-grid .gallery-item:last-child:nth-child(odd) {
    grid-column: span 2;
    aspect-ratio: 2 / 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.04);
}

.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.92);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-img {
    max-width: 92vw;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 4px 25px rgba(0,0,0,0.6);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #ffffff;
    font-size: 2.2rem;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* ==========================================================================
   7. FORMS (RSVP & GUESTBOOK)
   ========================================================================== */
.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--color-text);
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #ffffff;
    color: var(--color-text);
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.radio-group {
    display: flex;
    gap: 12px;
}

.radio-btn-label {
    flex: 1;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 12px 10px;
    text-align: center;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    background: #ffffff;
    transition: all 0.15s ease;
}

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

.radio-btn-label.selected {
    border-color: var(--color-primary);
    background: rgba(0,0,0,0.03);
    color: var(--color-primary);
    box-shadow: inset 0 0 0 1px var(--color-primary);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    border: none;
    background: var(--color-primary);
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s;
    font-family: inherit;
}

.btn-submit:hover {
    background: var(--color-primary-hover);
}

.form-feedback {
    display: none;
    padding: 12px;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.95rem;
    text-align: center;
}

.form-feedback.success {
    display: block;
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.form-feedback.error {
    display: block;
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

/* ==========================================================================
   8. GUESTBOOK WISHES LIST
   ========================================================================== */
.wishes-list {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
    text-align: left;
}

.wish-item {
    background: #fdfdfd;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.95rem;
}

.wish-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.wish-name {
    font-weight: 700;
    color: var(--color-primary);
}

.wish-time {
    color: var(--color-text-muted);
}

.wish-message {
    color: var(--color-text);
    line-height: 1.55;
    word-break: break-word;
}

/* ==========================================================================
   9. SALAM KAUT & QR
   ========================================================================== */
.bank-card {
    background: #ffffff;
    border: 1.5px dashed var(--color-accent);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1rem;
    position: relative;
}

.bank-tag-contoh {
    display: inline-block;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.bank-name {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--color-primary);
}

.bank-acc-num {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin: 8px 0;
    font-family: monospace;
}

.bank-acc-holder {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.btn-copy:hover {
    background: #f8fafc;
}

.qr-preview {
    margin-top: 1.5rem;
}

.qr-img {
    max-width: 180px;
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    cursor: pointer;
}

/* ==========================================================================
   10. CONTACTS & SHARE
   ========================================================================== */
.contacts-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 1rem;
}

.contact-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 10px 14px;
}

.contact-name {
    font-weight: 600;
    font-size: 1rem;
    text-align: left;
}

.contact-actions {
    display: flex;
    gap: 8px;
}

.btn-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    font-size: 18px;
    transition: transform 0.15s;
}

.btn-icon-link:hover {
    transform: scale(1.08);
}

.btn-wa { background: #25d366; color: #ffffff; }
.btn-tel { background: #3b82f6; color: #ffffff; }

.btn-share-wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25d366;
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    padding: 14px 20px;
    border-radius: 50px;
    text-decoration: none;
    width: 100%;
    box-shadow: var(--shadow-sm);
    margin-top: 1.25rem;
    font-family: inherit;
}

/* ==========================================================================
   11. FOOTER
   ========================================================================== */
.kad-footer {
    padding: 2rem 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    background: rgba(0,0,0,0.02);
}

.kad-footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 700;
}

.kad-footer a:hover {
    text-decoration: underline;
}

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