@font-face {
    font-family: 'MyNewNastaliq';
    src: url('../assets/fonts/IranNastaliq_1.woff2') format('woff2'); 
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'DimaShekasteh';
    src: url('../assets/fonts/DimaShekasteh.woff2') format('woff2'); 
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'ShekastehV2';
    src: url('../assets/fonts/ShekastehV2.001.woff2') format('woff2'); 
    font-weight: normal;
    font-style: normal;
}

/* CSS Reset & Variables */
:root {نهایی‌سازی
    --gold: #d4af37;
    --gold-muted: #c5a456;
    --gold-light: #e6c875;
    --bg-color: #faf8f5; 
    --text-dark: #2c2c2c;
    --text-gray: #4a4a4a;
    
    --font-fa: 'Vazirmatn', Tahoma, sans-serif;
    --font-nastaliq: 'ShekastehV2', serif;
    --font-en: 'Great Vibes', cursive;
    
    --ease-out: cubic-bezier(0.25, 0.8, 0.25, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

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

body, html {
    width: 100%;
    height: 100%;
    background-color: #1a1a1a; 
    font-family: var(--font-fa);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

.hidden { display: none !important; }

/* ----------------------------------
   Mobile Container 
-------------------------------------*/
#mobile-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 480px; 
    background-color: var(--bg-color);
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

@media (min-width: 481px) {
    #mobile-container {
        height: 90vh; 
        max-height: 900px;
        border-radius: 20px;
    }
}

/* ----------------------------------
   Split Screen (Initial View)
-------------------------------------*/
#split-screen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: #f4efe9; 
    background-image: url('data:image/svg+xml,%3Csvg width="100" height="100" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noise"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="4" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100" height="100" filter="url(%23noise)" opacity="0.08"/%3E%3C/svg%3E');
    display: flex;
    z-index: 100;
    overflow: hidden;
    /* Adding 3D perspective to make opening more packet-like */
    perspective: 1000px;
}

.split-half {
    width: 50%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    transition: transform 1.8s var(--ease-in-out), opacity 1.5s ease;
    background-color: transparent;
    transform-style: preserve-3d;
}

.split-right { justify-content: flex-start; transform-origin: right center; }
.split-left { justify-content: flex-end; transform-origin: left center; }

.split-text {
    font-family: var(--font-nastaliq);
    font-size: 3.5rem; 
    color: #111;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
    line-height: 2; 
}

.right-text { left: 20px; }
.left-text { right: 20px; }

.split-line {
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 1px; height: 100%;
    background: rgba(0,0,0,0.1);
    z-index: 101;
    transition: opacity 0.5s;
}

/* Wax Seal - Modified to be an Image */
.wax-seal {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 110px; height: 110px; /* Adjusted size for image */
    z-index: 102;
    cursor: pointer;
    transition: all 0.5s var(--ease-out);
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4));
    display: flex;
    justify-content: center;
    align-items: center;
}

.seal-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

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

/* Open Animation - Swings open like doors/flaps */
#split-screen.opening .wax-seal { opacity: 0; transform: translate(-50%, -50%) scale(1.5); pointer-events: none; }
#split-screen.opening .split-line { opacity: 0; }
#split-screen.opening .split-right { transform: rotateY(80deg) translateX(50%); opacity: 0; }
#split-screen.opening .split-left { transform: rotateY(-80deg) translateX(-50%); opacity: 0; }

/* ----------------------------------
   Main Screen Background & Frame
-------------------------------------*/
#main-screen {
    position: relative;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    background-color: var(--bg-color);
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
    overflow: hidden;
    background-color: var(--bg-color); 
}

#main-screen:not(.hidden) .hero-bg {
    animation: heroReveal 2.5s var(--ease-out) forwards;
}

@keyframes heroReveal {
    0% { opacity: 0; transform: scale(1.15); filter: blur(5px); }
    100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

.bg-media-wrapper {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 20%, rgba(0,0,0,0) 80%);
    mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 20%, rgba(0,0,0,0) 80%);
}

.bg-media {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center 30%;
    filter: grayscale(100%) opacity(0.4); 
}

/* Enhanced Gold Frame */
.gold-frame {
    position: absolute;
    top: 20px; bottom: 20px;
    left: 20px; right: 20px;
    border: 2px solid var(--gold-muted);
    outline: 1px solid var(--gold-light);
    outline-offset: -5px;
    pointer-events: none;
    z-index: 1;
}

.corner-decor {
    position: absolute;
    width: 30px; height: 30px;
    pointer-events: none;
    z-index: 2;
}
.corner-decor::before, .corner-decor::after {
    content: ''; position: absolute;
    background-color: var(--gold); border-radius: 50%;
}
.corner-decor::before { width: 4px; height: 4px; top: 10px; left: 10px; }
.corner-decor::after { width: 5px; height: 5px; bottom: 16px; right: 16px; }

.top-right { top: 25px; right: 25px; }
.top-left { top: 25px; left: 25px; transform: scaleX(-1); }
.bottom-right { bottom: 25px; right: 25px; transform: scaleY(-1); }
.bottom-left { bottom: 25px; left: 25px; transform: scale(-1, -1); }

.ken-burns { animation: kenBurns 25s infinite alternate linear; }
@keyframes kenBurns {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* ----------------------------------
   Content
-------------------------------------*/
#content-container {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    padding: 30px 15px;
    z-index: 10;
    width: 100%; height: 100%;
}

.sequence-text {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1.5s var(--ease-out), transform 1.5s var(--ease-out);
}

.sequence-text.visible {
    opacity: 1; transform: translateY(0);
}

.header-text {
    font-family: var(--font-nastaliq);
    font-size: 1.8rem;
    color: var(--text-gray);
    margin-bottom: 20px;
    line-height: 2;
}

.names-wrapper {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; margin-bottom: 5px;
}

.name {
    font-family: var(--font-nastaliq);
    font-size: 4.5rem;
    color: var(--text-dark);
    line-height: 1.5;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}

.and-text {
    font-family: var(--font-nastaliq);
    font-size: 2rem;
    color: var(--text-gray);
}

.english-quote {
    font-family: var(--font-en);
    font-size: 1.8rem;
    color: var(--gold-muted);
    margin-bottom: 25px;
    letter-spacing: 1px;
}

.text-medium {
    font-family: var(--font-nastaliq);
    font-size: 1.5rem;
    color: var(--text-gray);
    line-height: 2;
    max-width: 90%;
}

/* Elegant Date Box Redesign */
.elegant-date-box {
    margin: 25px 0;
    padding: 15px 20px;
    border-top: 1px solid var(--gold-muted);
    border-bottom: 1px solid var(--gold-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 85%;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0.05), transparent);
}

.date-weekday {
    font-family: var(--font-fa);
    font-size: 0.95rem;
    color: var(--text-gray);
    margin-bottom: 5px;
}

.date-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.date-day {
    font-family: var(--font-fa);
    font-size: 3rem;
    font-weight: 300;
    color: var(--gold-muted);
    line-height: 1;
}

.date-month, .date-year {
    font-family: var(--font-fa);
    font-size: 1.1rem;
    color: var(--text-dark);
}

.date-time {
    font-family: var(--font-fa);
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-top: 10px;
}

.address-text { 
    font-family: var(--font-fa); 
    font-size: 0.85rem; 
    color: var(--text-gray); 
    line-height: 2; 
    max-width: 90%; 
    margin-top: 10px;
}

/* Floating Routing Button (Subtle Corner) */
.floating-route-btn {
    position: absolute;
    bottom: 35px;
    left: 35px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--gold-muted);
    backdrop-filter: blur(5px);
    color: var(--text-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 90;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.floating-route-btn:hover { background: var(--gold-muted); color: white; }

/* Sequence animation for the floating button */
.hidden-at-start {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 1.5s var(--ease-out), transform 1.5s var(--ease-out);
}
.hidden-at-start.visible {
    opacity: 1;
    transform: scale(1);
}

/* ----------------------------------
   Music Control
-------------------------------------*/
#music-toggle {
    position: absolute;
    top: 35px; right: 35px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--gold-muted);
    backdrop-filter: blur(5px);
    color: var(--text-dark);
    display: flex; justify-content: center; align-items: center;
    z-index: 90;
    cursor: pointer;
}

/* ----------------------------------
   Bottom Sheet (Details)
-------------------------------------*/
.sheet-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(3px);
    z-index: 100; opacity: 0; visibility: hidden; transition: all 0.4s ease;
}
.sheet-overlay.active { opacity: 1; visibility: visible; }

.bottom-sheet {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: var(--bg-color); border-top: 2px solid var(--gold-muted);
    border-radius: 20px 20px 0 0; padding: 20px 20px 30px;
    z-index: 101; transform: translateY(100%);
    transition: transform 0.5s var(--ease-out);
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    text-align: center;
}
.bottom-sheet.active { transform: translateY(0); }

.sheet-handle { width: 40px; height: 4px; background: #ccc; border-radius: 2px; margin: 0 auto 15px; }
.close-btn { position: absolute; top: 15px; right: 15px; background: none; border: none; color: var(--text-gray); font-size: 1.5rem; cursor: pointer; }

.sheet-title { font-family: var(--font-nastaliq); font-size: 2.2rem; color: var(--text-dark); margin-bottom: 10px; line-height: 1.5; }
.sheet-desc { font-size: 0.9rem; color: var(--text-gray); margin-bottom: 20px; }

.routing-btn {
    display: inline-block; text-decoration: none;
    background: var(--gold-muted); color: white;
    padding: 12px 25px; border-radius: 4px; font-size: 1rem;
    transition: background 0.3s ease; width: 85%;
}
.routing-btn:hover { background: var(--gold); }
