/* =========================================
   1. الإعدادات الأساسية (إجبار مقاس الموبايل)
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: #1a1a1a;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

body {
    font-family: 'Alata', 'Cairo', sans-serif;
    color: #333;
    width: 100vw;
    height: 100vh;
    max-width: 430px;
    max-height: 932px;
    position: relative;
    background-color: #f9f6f0;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border-radius: 20px;
}

/* =========================================
   2. شاشة الظرف التفاعلي الجديدة (صورة وفيديو الفتح)
========================================= */
#envelope-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f9f6f0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    overflow: hidden;
    border-radius: 20px;
    transition: opacity 1.5s ease, visibility 1.5s ease;
}

.envelope-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.envelope-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.tap-overlay {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
}

.tap-text {
    font-size: 16px;
    color: #a88a50;
    animation: pulseText 1.5s infinite;
    background: rgba(249, 246, 240, 0.85);
    padding: 6px 16px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    font-family: 'Cairo', sans-serif;
}

@keyframes pulseText {
    0%, 100% { opacity: 0.6; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
}

.fade-out {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* =========================================
   3. الشاشة الرئيسية (الحديقة والفيديو)
========================================= */
#main-content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    background-color: #f9f6f0;
}

.bg-container {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    z-index: 0;
    overflow: hidden;
    border-radius: 20px;
}

.bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
}

.content-wrapper {
    position: relative;
    z-index: 10;
    padding: 30px 20px;
    text-align: center;
}

/* أزرار التحكم العلوية */
.top-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    display: flex;
    gap: 10px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #d4af37;
    color: #d4af37;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    font-weight: bold;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}
.control-btn:hover { background: #d4af37; color: #fff; }

/* =========================================
   4. تنسيقات النصوص والـ Hero Section
========================================= */
.hero-section {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    position: relative;
    padding-top: 40px;
    padding-bottom: 20px;
}

.verse-section {
    background: transparent;
    border: none;
    box-shadow: none;
    margin-top: 20px;
    margin-bottom: 15px;
    padding: 0;
}
.verse-text {
    font-family: 'Aref Ruqaa', serif;
    font-size: 22px;
    color: #4a2e1b;
}

/* تحسين قراءة الآية الإنجليزية */
html[lang="en"] .verse-text {
    font-family: 'Passions Conflict', cursive, serif;
    font-size: 34px;
    font-weight: 600;
    line-height: 1.3;
}

.verse-ref {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.names-section { 
    margin-top: -20px;
    margin-bottom: 20px; 
}
.names {
    font-family: 'Mea Culpa', cursive;
    font-size: 54px;
    color: #5a3e2b;
    margin-bottom: 5px;
    line-height: 1.1;
}
.sub-title {
    font-size: 16px;
    color: #6a4a36;
    letter-spacing: 1px;
}

/* بوكس التاريخ المعدل */
.date {
    font-family: 'Cairo', 'Alata', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #5a3e2b;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(90, 62, 43, 0.2);
    padding: 8px 24px;
    border-radius: 30px;
    display: inline-block;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.countdown-section { 
    margin: 100px 0 80px 0;
}
.elegant-title {
    font-family: 'Alata', sans-serif;
    font-size: 22px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #5a3e2b;
    margin-bottom: 25px;
}

.transparent-countdown {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    color: #5a3e2b;
}
.time-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
}
.time-col span {
    font-family: 'Alata', sans-serif;
    font-size: 28px;
}
.time-col p {
    font-family: 'Mea Culpa', cursive;
    font-size: 18px;
    margin-top: -3px;
}
.divider { font-size: 26px; line-height: 1.2; }

.venue-section { 
    margin: 90px 0;
}
.church-img {
    width: 75%;
    max-width: 220px;
    margin-bottom: 15px;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.15));
}
.venue-section h4 {
    font-size: 20px;
    color: #333;
    margin-bottom: 5px;
}

/* الأزرار */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}
.primary-btn {
    background: #d4af37;
    color: #fff;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}
.primary-btn:hover { background: #b5952f; transform: translateY(-2px); }

.outline-btn {
    background: transparent;
    border: 2px solid #d4af37;
    color: #d4af37;
    margin-top: 10px;
}
.outline-btn:hover { background: #d4af37; color: #fff; transform: translateY(-2px); }

/* تأكيد الحضور (RSVP) */
.rsvp-section {
    margin: 50px auto 70px auto;
    background: rgba(255, 255, 255, 0.85);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    backdrop-filter: blur(5px);
}
input[type="text"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    background: #fdfbf7;
}
.rsvp-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.rsvp-btn {
    flex: 1;
    border: 2px solid #ccc;
    background: transparent;
    color: #555;
    padding: 10px 5px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}
.rsvp-btn.selected.yes { background: #4caf50; border-color: #4caf50; color: #fff; }
.rsvp-btn.selected.no { background: #f44336; border-color: #f44336; color: #fff; }

/* مؤشر النزول */
.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 1;
    transition: opacity 0.5s ease;
    margin-top: 10px;
    z-index: 20;
}
.scroll-indicator span {
    font-size: 11px;
    color: #555;
    margin-bottom: 3px;
    letter-spacing: 1px;
    white-space: nowrap;
}
.mouse {
    width: 18px;
    height: 30px;
    border: 2px solid #5a3e2b;
    border-radius: 12px;
    position: relative;
}
.wheel {
    width: 3px;
    height: 5px;
    background: #5a3e2b;
    border-radius: 2px;
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 1.5s infinite;
}
@keyframes scrollWheel {
    0% { top: 4px; opacity: 1; }
    100% { top: 16px; opacity: 0; }
}

/* =========================================
   5. تطبيق خط Cairo الموحد على النسخة العربية
========================================= */
html[lang="ar"] body,
html[lang="ar"] .date,
html[lang="ar"] .sub-title,
html[lang="ar"] .elegant-title,
html[lang="ar"] .venue-section h4,
html[lang="ar"] .time-text,
html[lang="ar"] .btn,
html[lang="ar"] .scroll-indicator span,
html[lang="ar"] .tap-text {
    font-family: 'Cairo', sans-serif !important;
}

/* أنيميشن الظهور والتخفي */
.animate-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}
.start-animation .animate-up {
    opacity: 1;
    transform: translateY(0);
}
.start-animation .item-1 { transition-delay: 0.2s; }
.start-animation .item-2 { transition-delay: 0.5s; }
.start-animation .item-3 { transition-delay: 0.8s; }
.start-animation .item-4 { transition-delay: 1.1s; }

.hidden { display: none !important; }

/* أنيميشن السكرول للأقسام السفلية */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease, transform 1s ease;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}