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

:root {
    --primary: #d4af37;
    /* Metallic Gold */
    --primary-light: #eecf73;
    --background: #fcfbf9;
    /* Soft cream/ivory */
    --text-dark: #2c302e;
    --text-light: #6c706e;
    --white: #ffffff;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Prevent native body shifting */
}

body {
    background-color: var(--background);
    color: var(--text-dark);
    font-family: 'Tajawal', sans-serif;
    line-height: 1.6;
}

.amiri-font {
    font-family: 'Amiri', serif;
}

.tajawal-font {
    font-family: 'Tajawal', sans-serif;
}

/* ===== Utilities ===== */
.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none !important;
}

/* ===== Starry Background for Landing ===== */
.stars-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #2b3036 0%, #15181a 100%);
    z-index: -1;
}

/* ===== Screen Containers ===== */
.screen {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#envelope-screen {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: opacity 1.5s ease-in-out;
}

#envelope-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* ===== Envelope Design ===== */
.envelope-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.9);
}

.envelope {
    position: relative;
    width: 320px;
    height: 220px;
    background-color: #f5f2eb;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    perspective: 1000px;
    margin-bottom: 30px;
}

.envelope-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #e5dfd3;
    z-index: 1;
}

.envelope-paper {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 300px;
    height: 200px;
    background-color: var(--white);
    z-index: 2;
    transition: transform 1.5s ease-in-out, opacity 1.5s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.envelope.open .envelope-paper {
    transform: translateY(-150px);
    opacity: 0;
    /* Fades out as the main screen fades in */
}

/* Decor inside paper */
.paper-preview {
    text-align: center;
}

.floral-preview {
    width: 50px;
    height: 50px;
    margin: 0 auto 10px;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M50 0 C60 30, 80 40, 100 50 C80 60, 60 70, 50 100 C40 70, 20 60, 0 50 C20 40, 40 30, 50 0 Z" fill="none" stroke="%23d4af37" stroke-width="2"/></svg>');
    background-size: cover;
}

.preview-names {
    font-family: 'Amiri', serif;
    color: var(--primary);
    font-size: 1.2rem;
}

.envelope-front {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 160px solid #f3efea;
    border-right: 160px solid #f3efea;
    border-bottom: 110px solid #ebe5da;
    border-top: 110px solid transparent;
    z-index: 3;
}

.envelope-flap-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    border-top: 120px solid #dfd8c8;
    z-index: 4;
    transform-origin: top;
    transition: transform 1s ease;
}

.envelope.open .envelope-flap-top {
    transform: rotateX(180deg);
    z-index: 1;
}

.seal-container {
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    cursor: pointer;
    transition: all 0.3s ease;
}

.seal-container:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.seal {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #d4af37 0%, #a67c00 100%);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.seal::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    border: 1px dashed rgba(255, 255, 255, 0.4);
    border-radius: 50%;
}

.seal span {
    font-family: 'Amiri', serif;
    color: var(--white);
    font-weight: bold;
    font-size: 1.1rem;
    z-index: 2;
}

.envelope.open .seal-container {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.tap-hint {
    color: var(--white);
    font-size: 1.1rem;
    margin-top: 20px;
    opacity: 0.8;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
        transform: scale(0.95);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0.5;
        transform: scale(0.95);
    }
}


/* ===== Main Invitation Screen ===== */
#invitation-screen {
    background-color: var(--background);
    padding: 30px 15px 0;
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><g fill="%23d4af37" fill-opacity="0.03"><path d="M50 0 C60 30, 80 40, 100 50 C80 60, 60 70, 50 100 C40 70, 20 60, 0 50 C20 40, 40 30, 50 0 Z"/></g></svg>');
}

.invitation-card {
    max-width: 500px;
    margin: 0 auto;
    background-color: transparent;
    padding: 20px 10px 0;
    border-radius: 20px;
    box-shadow: none;
    text-align: center;
    position: relative;
    border: none;
}

/* Thicker Lottie Filter removed (fixed in JSON) */

.floral {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.floral-svg {
    width: 80px;
    height: 80px;
}

.floral-svg.rotated {
    transform: rotate(180deg);
}

.rings-animation-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    height: 100px;
}

.rings-svg {
    filter: drop-shadow(0px 4px 10px rgba(212, 175, 55, 0.3));
}

.ring-left,
.ring-right,
.ring-left-overlap {
    animation: ringRotate 4s ease-in-out infinite alternate;
}

.ring-left,
.ring-left-overlap {
    transform-origin: 35px 30px;
}

.ring-right {
    transform-origin: 65px 30px;
    animation-delay: -2s;
}

.sparkle {
    transform-origin: center;
    animation: sparkleTwinkle 2s infinite ease-in-out;
}

.s2 {
    animation-delay: 0.5s;
    transform-origin: 85px 45px;
}

.s3 {
    animation-delay: 1s;
    transform-origin: 48px 5px;
}

.s1 {
    transform-origin: 20px 10px;
}

@keyframes ringRotate {
    0% {
        transform: rotate(-5deg) scale(0.95);
    }

    100% {
        transform: rotate(5deg) scale(1.05);
    }
}

@keyframes sparkleTwinkle {

    0%,
    100% {
        transform: scale(0.5);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.wedding-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
    background: linear-gradient(45deg, #a67c00, #d4af37, #f3e5ab, #d4af37);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: goldShine 3s linear infinite;
}

.couple-names {
    font-size: 3.2rem;
    margin-bottom: 15px;
    background: linear-gradient(to right, #2c302e 0%, #4a504c 50%, #2c302e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(212, 175, 55, 0.2);
}

@keyframes goldShine {
    to {
        background-position: 200% center;
    }
}

.intro-text {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.divider {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.details-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 40px;
}

.detail-item {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 25px 15px;
    border-radius: 20px;
    transition: transform 0.3s ease;
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

.detail-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(212, 175, 55, 0.15);
    background-color: rgba(255, 255, 255, 0.85);
}

.icon-wrapper {
    width: 50px;
    height: 50px;
    background-color: #fdfaf2;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 15px;
    box-shadow: inset 0 0 10px rgba(212, 175, 55, 0.1);
}

.detail-item h3 {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 500;
}

.detail-item p {
    font-size: 1.1rem;
    color: var(--text-dark);
}

.bottom-floral {
    margin-top: 30px;
    margin-bottom: 0;
    animation: floralBreathe 4s ease-in-out infinite;
}

@keyframes floralBreathe {

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

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

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 400px) {
    .couple-names {
        font-size: 2.3rem;
    }

    .wedding-title {
        font-size: 1.5rem;
    }
}

/* Luxury Map Button */
.map-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    padding: 12px 25px;
    text-decoration: none;
    color: var(--white);
    background: linear-gradient(135deg, #d4af37, #a67c00);
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.map-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.5);
}

.map-button svg {
    stroke: var(--white);
}

/* Ambient Sparkles Background elements */
.ambient-sparklets {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.asparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: var(--primary-light);
    border-radius: 50%;
    filter: blur(2px);
    animation: floatUp 8s linear infinite;
    opacity: 0;
}

.asparkle:nth-child(1) {
    left: 10%;
    animation-duration: 9s;
    animation-delay: 0s;
}

.asparkle:nth-child(2) {
    left: 25%;
    animation-duration: 7s;
    animation-delay: 2s;
}

.asparkle:nth-child(3) {
    left: 40%;
    animation-duration: 10s;
    animation-delay: 4s;
}

.asparkle:nth-child(4) {
    left: 55%;
    animation-duration: 6s;
    animation-delay: 1s;
}

.asparkle:nth-child(5) {
    left: 70%;
    animation-duration: 8s;
    animation-delay: 3s;
}

.asparkle:nth-child(6) {
    left: 85%;
    animation-duration: 11s;
    animation-delay: 0s;
}

.asparkle:nth-child(7) {
    left: 15%;
    animation-duration: 7s;
    animation-delay: 5s;
}

.asparkle:nth-child(8) {
    left: 65%;
    animation-duration: 9s;
    animation-delay: 2.5s;
}

.asparkle:nth-child(9) {
    left: 80%;
    animation-duration: 8s;
    animation-delay: 6s;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) scale(0.5);
        opacity: 0;
    }

    20% {
        opacity: 0.8;
    }

    80% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(-100px) scale(1.5);
        opacity: 0;
    }
}