/* ===================================
   WEDDING WEBSITE - KALVIN & GLORIA
=================================== */
:root {
    --bg: #fdfbf7;
    --dark: #402319;
    /* Brownish dark */
    --darker: #2d1811;
    --leaf: #7A8062;
    /* Sage green */
    --cream: #f4eee6;
    --gold: #c9a97a;
    --font-serif: 'Cormorant Garamond', 'Georgia', serif;
    --font-script: 'Pinyon Script', cursive;
    --font-sans: 'Outfit', sans-serif;
    --font-inter: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: #e9e3db;
    color: var(--dark);
    font-family: var(--font-sans);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.mobile-wrapper {
    width: 100%;
    max-width: 480px;
    background: var(--bg);
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* ====== COVER PAGE ====== */
#cover-page {
    position: absolute;
    inset: 0;
    z-index: 9999;
    background: #e9e3db url('assets/opening.jpg') no-repeat center center;
    background-size: cover;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 1.2s cubic-bezier(0.7, 0, 0.3, 1), opacity 1s ease;
    overflow: hidden;
    cursor: pointer;
}

#cover-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(45, 24, 17, 0.3);
    /* Tint matching the aesthetic */
    backdrop-filter: blur(0px);
    z-index: 1;
}

#cover-page>* {
    position: relative;
    z-index: 10;
}

#cover-page.fade-out {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

.cal-title {
    text-align: center;
    margin-bottom: 20px;
}

.cover-envelope-wrapper {
    position: relative;
    width: 90%;
    max-width: 380px;
    aspect-ratio: 380/260;
    margin: 20px 0;
    cursor: pointer;
    background: url('assets/amplop.png') no-repeat center center;
    background-size: contain;
    transition: transform 0.8s ease-in-out, opacity 0.5s ease;
    animation: envelopeTwitch 2.8s ease-in-out infinite;
}

@keyframes envelopeTwitch {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }
}

.cover-envelope-wrapper.is-open {
    transform: scale(4);
    opacity: 0;
    transition: transform 1.5s cubic-bezier(0.7, 0, 0.3, 1), opacity 1s ease;
    filter: blur(5px);
    animation: none;
}

.cover-env-back {
    position: absolute;
    inset: 0;
    background: #EAE7D9;
    /* Cream color from image */
    border-radius: 8px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.cover-env-card {
    position: absolute;
    top: 5%;
    left: 8%;
    width: 84%;
    height: 90%;
    background: #fffdf5;
    border: 1px solid var(--gold);
    padding: 20px;
    text-align: center;
    z-index: 2;
    border-radius: 4px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    outline: 1px solid #ddd;
    outline-offset: -8px;
}

.cover-envelope-wrapper.is-open .cover-env-card {
    display: flex;
    animation: cardPopUp 1s 0.6s forwards ease-out;
}

@keyframes cardPopUp {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    100% {
        transform: translateY(-220px);
        opacity: 1;
    }
}

.c-sub {
    font-family: var(--font-script);
    font-size: 1.2rem;
    color: var(--gold);
}

.c-title {
    font-family: var(--font-script);
    font-size: 2rem;
    color: var(--dark);
    line-height: 1.2;
    margin: 5px 0;
}

.cover-env-front {
    position: absolute;
    inset: 0;
    z-index: 4;
    background: #EAE7D9;
    border-radius: 0 0 10px 10px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.cover-guest-info {
    text-align: center;
    z-index: 10;
    color: white;
    margin-top: 0;
    /* Reduced to avoid vertical overflow */
    transition: opacity 0.3s;
    width: 100%;
}

.guest-label,
.code-label {
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.9;
    margin-bottom: 10px;
}

.guest-name {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-style: italic;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.manual-code-container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.manual-code-container input {
    padding: 12px 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    text-align: center;
    font-family: var(--font-sans);
    letter-spacing: 3px;
    text-transform: uppercase;
    width: 180px;
    font-weight: bold;
    color: var(--dark);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.manual-code-container button {
    padding: 10px 25px;
    background: var(--gold);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.manual-code-container button:hover {
    background: white;
    color: var(--dark);
    transform: translateY(-2px);
}

.cover-env-flap {
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 140px;
    background: #F1EFE3;
    /* U-shape flap from reference */
    border-radius: 0 0 50% 50%;
    z-index: 6;
    transform-origin: top;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.3));
    overflow: visible;
    /* To allow shadow */
}

/* Adding a subtle border line to the flap edge for better definition */
.cover-env-flap::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(0 0, 100% 0, 100% 20%, 50% 100%, 0 20%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    pointer-events: none;
}


.cover-envelope-wrapper.is-open .cover-env-flap {
    transform: rotateX(180deg);
    z-index: 1;
}

.cover-wax {
    position: absolute;
    top: 155px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: #c5a38e;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6;
    transition: opacity 0.3s;
}

.cover-envelope-wrapper.is-open .cover-wax {
    opacity: 0;
}

.cover-wax::after {
    content: 'KG';
    font-family: var(--font-script);
    font-size: 1.2rem;
    color: #444;
}

.cover-footer {
    text-align: center;
    margin-top: 30px;
    /* Adjusted to fit better on smaller screens */
}

.valid-text {
    font-size: 0.8rem;
    color: var(--dark);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.click-hint {
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    color: #EAE7D9;
    /* Matching envelope color */
    text-transform: uppercase;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* --- MAIN CONTENT LAYOUT --- */
.main-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

section {
    padding: 60px 20px;
    position: relative;
}

.section-title {
    font-family: var(--font-script);
    font-size: 3.5rem;
    color: var(--dark);
    text-align: center;
    margin-bottom: 40px;
    font-weight: normal;
}

/* ====== SAVE THE DATE ====== */
.save-the-date-sec {
    background: url('assets/Save Our Date.jpg') no-repeat center center;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.std-content {
    background: rgba(0, 0, 0, 0.4);
    padding: 50px 30px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    width: 90%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.std-sub {
    font-family: var(--font-inter);
    letter-spacing: 0.2em;
    font-size: 0.75rem;
    margin-bottom: 25px;
    opacity: 0.9;
}

.std-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    letter-spacing: 0.4em;
    margin-bottom: 15px;
}

.std-names {
    font-family: var(--font-script);
    font-size: 4rem;
    margin-bottom: 15px;
    font-weight: normal;
}

.std-date {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    letter-spacing: 0.1em;
    margin-bottom: 35px;
}

.std-location {
    margin-bottom: 35px;
    font-family: var(--font-inter);
    font-size: 1rem;
    letter-spacing: 0.05em;
    line-height: 1.6;
}

.btn-detail {
    padding: 14px 40px;
    border-radius: 50px;
    border: 1px solid white;
    background: transparent;
    color: white;
    cursor: pointer;
    font-family: var(--font-serif);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.btn-detail:hover {
    background: white;
    color: var(--dark);
}

/* ====== GALLERY ====== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

/* ====== RSVP & WISHES ====== */
.rsvp-section {
    background: url('assets/wishes.jpg') no-repeat center center;
    background-size: cover;
    color: white;
    padding: 100px 20px;
    text-align: center;
    position: relative;
}

.rsvp-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 1;
}

.rsvp-section>* {
    position: relative;
    z-index: 2;
}

.rsvp-container {
    max-width: 450px;
    margin: 0 auto;
}

.rsvp-form {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px 30px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.rsvp-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.rsvp-form input[type="text"],
.rsvp-form select,
.rsvp-form textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px 20px;
    border-radius: 15px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--dark);
    outline: none;
    transition: all 0.3s ease;
}

.rsvp-form input:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.5);
}

.radio-group {
    display: flex;
    gap: 15px;
    margin: 25px 0;
}

.radio-group label {
    flex: 1;
    background: rgba(255, 255, 255, 0.15);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.radio-group input[type="radio"] {
    accent-color: var(--dark);
}

.radio-group label:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-rsvp {
    width: 100%;
    background: var(--dark);
    color: white;
    padding: 16px;
    border: none;
    border-radius: 50px;
    font-family: var(--font-serif);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.btn-rsvp:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    filter: brightness(1.2);
}

/* E-Ticket Styles */
.ticket-card {
    background: white;
    color: var(--dark);
    border-radius: 30px;
    padding: 40px 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.ticket-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--gold);
}

.ticket-card h3 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.qr-box {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 20px;
    margin: 25px 0;
    border: 1px dashed #ddd;
}

.qr-box img {
    width: 180px;
    height: 180px;
}

.qr-code-text {
    margin-top: 10px;
    font-family: monospace;
    font-weight: bold;
    letter-spacing: 2px;
    color: #888;
}

.ticket-details {
    border-top: 1px solid #eee;
    padding-top: 20px;
    text-align: left;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.detail-row .val {
    font-weight: 600;
}

.ucapan-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
    max-height: 550px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Custom Scrollbar for Wishes List */
.ucapan-list::-webkit-scrollbar {
    width: 6px;
}

.ucapan-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.ucapan-list::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 10px;
    opacity: 0.5;
}

.ucapan-section {
    background: #fff;
    padding: 100px 20px;
}

.ucapan-section .section-title {
    color: var(--dark);
}

.ucapan-item {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 20px;
    display: flex;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
}

.u-name {
    font-family: var(--font-serif);
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 5px;
}

.u-text {
    font-size: 0.9rem;
    color: #444;
    line-height: 1.5;
}

.u-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--gold);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

/* ====== COUNTDOWN ====== */
.countdown-sec {
    padding: 80px 20px;
    text-align: center;
    background: var(--bg);
}

.timer-grid {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.timer-item {
    background: white;
    width: 70px;
    padding: 15px 5px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.t-val {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    font-family: var(--font-serif);
}

.t-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
}

footer {
    background: url('assets/closing.jpg') no-repeat center center;
    background-size: cover;
    color: white;
    padding: 100px 20px;
    text-align: center;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 1;
}

footer>* {
    position: relative;
    z-index: 2;
}

.f-names {
    font-family: var(--font-script);
    font-size: 3rem;
    margin-bottom: 10px;
}

.f-date {
    font-family: var(--font-serif);
    letter-spacing: 0.3em;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ====== MODAL DETAILS ====== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

#details-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
    z-index: 10000;
    display: none;
    padding: 0;
    background: transparent;
    transform: none;
    overflow: hidden;
    cursor: pointer;
}

#details-popup .modal-content {
    background: url('assets/awan.jpg') no-repeat center center;
    background-size: cover;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    display: block;
    padding: 80px 30px 40px;
    position: relative;
    overflow-y: auto;
    color: white;
}

#details-popup .modal-content * {
    color: white !important;
}

.modal-content {
    background: url('assets/wishes.jpg') no-repeat center center;
    background-size: cover;
    color: white;
    text-align: center;
    width: 100%;
    max-width: 400px;
    border-radius: 30px;
    padding: 40px 30px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    /* Darker overlay for readability */
    z-index: 1;
}

#details-popup .modal-content::before {
    display: none;
}

.modal-content>* {
    position: relative;
    z-index: 2;
}

.btn-close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: white;
}

.modal-h {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: white;
    margin-bottom: 15px;
    border-bottom: 2px solid white;
    padding-bottom: 5px;
    display: inline-block;
}

.modal-p {
    margin-bottom: 15px;
    line-height: 1.4;
    color: white;
    font-size: 0.85rem;
}

#details-popup .modal-content .btn-maps {
    display: inline-block;
    background: white;
    color: #000 !important;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-family: var(--font-serif);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.75rem;
    margin-top: 5px;
    font-weight: 600;
}

/* Floating Music */
.floating-music-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #483C32;
    /* Taupe */
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 11000;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.floating-music-btn.visible {
    display: flex;
}

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

    to {
        transform: rotate(360deg);
    }
}

.floating-music-btn.playing .music-icon-wrapper {
    animation: spin 4s linear infinite;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 10px;
}

/* ====== GIFT SECTION ====== */
.gift-section {
    padding: 80px 20px;
    text-align: center;
    background: #fdfbf7;
    color: #000;
}

.gift-section .section-title {
    color: #000;
}

.gift-card {
    background: white;
    padding: 40px 30px;
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.04);
    max-width: 360px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.bank-name {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--dark);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.acc-number {
    font-size: 1.6rem;
    font-family: var(--font-serif);
    color: #000;
    margin-bottom: 5px;
    font-weight: 600;
}

.acc-owner {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
    color: #000;
    margin-bottom: 25px;
}

.btn-copy {
    background: none;
    color: var(--dark);
    border: 1.5px solid var(--dark);
    padding: 10px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    transition: all 0.3s ease;
    outline: none;
}

.btn-copy:hover {
    background: var(--dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ====== GALLERY ZOOM MODAL ====== */
.gallery-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-modal.active {
    display: flex;
    opacity: 1;
}

.gallery-modal img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.gallery-modal.active img {
    transform: scale(1);
}

.close-gallery {
    position: absolute;
    top: 30px;
    right: 30px;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    z-index: 20001;
}

/* Mobile Responsiveness for small screens */
@media (max-width: 375px) {
    .cal-title h1 {
        font-size: 2.8rem !important;
    }

    .guest-name {
        font-size: 1.8rem !important;
    }

    .section-title {
        font-size: 2.8rem !important;
    }

    .std-inner-title {
        font-size: 2.8rem !important;
    }
}