/* ==================================================================
   متغیرهای رنگی
================================================================== */
:root {
    --bg-color: #f1f5f9;
    --surface-color: rgba(255, 255, 255, 0.8);
    --surface-border: rgba(212, 175, 55, 0.6);
    --gold-main: #b8860b;
    --gold-light: #8b6508;
    --text-main: #0f172a;
    --text-muted: #475569;
    --glass-blur: blur(16px);
}

.dark-mode {
    --bg-color: #0b1120;
    --surface-color: rgba(15, 23, 42, 0.65);
    --surface-border: rgba(212, 175, 55, 0.3);
    --gold-main: #d4af37;
    --gold-light: #f3e5ab;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

.light-mode {
    --bg-color: #f1f5f9;
    --surface-color: rgba(255, 255, 255, 0.8);
    --surface-border: rgba(212, 175, 55, 0.6);
    --gold-main: #b8860b;
    --gold-light: #8b6508;
    --text-main: #0f172a;
    --text-muted: #475569;
}

/* اسکرول نرم */
html { scroll-behavior: smooth; scroll-padding-top: 120px; }

body {
    margin: 0; padding: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Vazirmatn', 'Amiri', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
    display: flex; flex-direction: column; min-height: 100vh;
    
    /* فیکس رندر فونت در مرورگرهای اپل (Safari/iOS) */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* فیکس قطعی مشکل جدا شدن حروف عربی و فارسی در آیفون */
html[dir="rtl"] * {
    letter-spacing: normal !important;
    font-variant-ligatures: normal;
}

* { box-sizing: border-box; }
a { color: inherit; text-decoration: none; }

/* ==================================================================
   موشن پارالکس و پس‌زمینه اصلی
================================================================== */
.bg-layer {
    position: fixed; top: -5%; left: -5%; width: 110%; height: 110%;
    background-size: cover; background-position: center; z-index: -1;
    transition: transform 0.1s ease-out;
}

/* ==================================================================
   هدر و ناوبری
================================================================== */
header {
    display: flex; justify-content: space-between; align-items: center;
    gap: 30px; padding: 12px 30px;
    background: var(--surface-color); backdrop-filter: var(--glass-blur);
    border: 1px solid var(--surface-border);
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 1200px; border-radius: 30px; z-index: 100;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.light-mode header { box-shadow: 0 10px 30px rgba(0,0,0,0.1); }

.header-right { display: flex; align-items: center; gap: 15px; }

.header-socials-vert {
    display: flex; flex-direction: column; gap: 8px;
    border-left: 1px solid var(--surface-border); padding-left: 15px;
}
html[dir="ltr"] .header-socials-vert { border-left: none; border-right: 1px solid var(--surface-border); padding-left: 0; padding-right: 15px; }

.header-socials-vert a { color: var(--text-muted); transition: color 0.3s, transform 0.3s; display: flex; align-items: center; }
.header-socials-vert a:hover { color: var(--gold-main); transform: scale(1.1); }
.header-socials-vert svg { width: 14px; height: 14px; }
.header-socials-vert img,
.toggles-vert .icon-btn img {
    transition: filter 0.3s ease, opacity 0.3s ease;
}
.dark-mode .header-socials-vert img,
.dark-mode .toggles-vert .icon-btn img,
html[data-pwa-theme="dark"] body .header-socials-vert img,
html[data-pwa-theme="dark"] body .toggles-vert .icon-btn img {
    filter: brightness(0) invert(1) !important;
    opacity: 0.95;
}
.light-mode .header-socials-vert img,
.light-mode .toggles-vert .icon-btn img,
html[data-pwa-theme="light"] body .header-socials-vert img,
html[data-pwa-theme="light"] body .toggles-vert .icon-btn img {
    filter: brightness(0) saturate(100%) invert(22%) sepia(13%) saturate(1718%) hue-rotate(178deg) brightness(92%) contrast(91%) !important;
    opacity: 0.9;
}
.header-socials-vert a svg [fill]:not([fill="none"]),
.toggles-vert .icon-btn svg [fill]:not([fill="none"]) {
    fill: currentColor !important;
}
.header-socials-vert a svg [stroke]:not([stroke="none"]),
.toggles-vert .icon-btn svg [stroke]:not([stroke="none"]) {
    stroke: currentColor !important;
}
.header-socials-vert a svg,
.header-socials-vert a svg *,
.toggles-vert .icon-btn:not(.theme-toggle):not(.lang-btn) svg,
.toggles-vert .icon-btn:not(.theme-toggle):not(.lang-btn) svg * {
    color: currentColor !important;
    fill: currentColor !important;
}
.header-socials-vert a svg [fill="none"],
.toggles-vert .icon-btn:not(.theme-toggle):not(.lang-btn) svg [fill="none"] {
    fill: none !important;
}

.auth-block { display: flex; flex-direction: column; gap: 6px; }

.btn-outline {
    border: 1px solid var(--surface-border); padding: 5px 15px; border-radius: 30px;
    background: transparent; color: var(--text-main); font-family: inherit;
    cursor: pointer; transition: all 0.3s; font-size: 11px; text-align: center;
}
.btn-outline:hover { background: var(--surface-border); color: var(--gold-light); }

nav ul { display: flex; gap: 15px; list-style: none; margin: 0; padding: 0; align-items: center; }
nav ul li a { font-size: 14px; font-weight: bold; transition: color 0.3s; display: flex; align-items: center; gap: 5px; white-space: nowrap;}
nav ul li a:hover, nav ul li a.active { color: var(--gold-main); }
nav ul > li > a.active { border-bottom: 2px solid var(--gold-main); padding-bottom: 5px; }

/* استایل‌های مربوط به زیرمنوها (اضافه شده به فایل جامع) */
.nav-item-has-child { position: relative; }
.nav-submenu { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); background: var(--surface-color); backdrop-filter: var(--glass-blur); border: 1px solid var(--surface-border); border-radius: 12px; padding: 10px; min-width: 150px; z-index: 200; box-shadow: 0 10px 30px rgba(0,0,0,0.3); list-style: none; flex-direction: column; gap: 5px; }
.nav-item-has-child:hover .nav-submenu { display: flex; }
.nav-submenu li a { display: block; padding: 8px 15px; border-radius: 6px; }
.nav-submenu li a:hover { background: rgba(255,255,255,0.1); color: var(--gold-main); }

.header-left { display: flex; align-items: center; gap: 20px; padding-left: 15px; }

.toggles-vert {
    display: flex; flex-direction: column; gap: 6px; align-items: center;
    border-right: 1px solid var(--surface-border); padding-right: 15px; padding-left: 18px;
}
html[dir="ltr"] .toggles-vert { border-right: none; border-left: 1px solid var(--surface-border); padding-right: 0; padding-left: 15px; }

.icon-btn {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%; transition: color 0.3s, background 0.3s;
}
.icon-btn:hover { background: rgba(212, 175, 55, 0.1); color: var(--gold-main); }
.lang-btn { font-family: 'Inter', sans-serif; font-weight: bold; font-size: 11px; text-decoration: none; }

.logo-box { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.main-logo { height: 35px; transition: opacity 0.3s ease; }

/* منطق هوشمند برای پنهان کردن لوگوی تکراری (منتقل شده به فایل جامع) */
.logo-light { display: none !important; }
.light-mode .logo-dark.has-light-logo { display: none !important; }
.light-mode .logo-light { display: block !important; }
.light-mode .main-logo:not(.has-light-logo):not(.logo-light) { filter: invert(1) brightness(0); }

.logo-text { display: flex; flex-direction: column; }
html[dir="rtl"] .logo-text { align-items: flex-end; text-align: right; }
html[dir="ltr"] .logo-text { align-items: flex-start; text-align: left; }

.logo-text h1 { margin: 0; font-size: 15px; color: var(--gold-main); font-weight: 700; white-space: nowrap; }
.logo-text p { margin: 0; font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ==================================================================
   اسلایدر دینامیک (Hero Slider)
================================================================== */
.content-wrapper { padding-top: 100px; padding-bottom: 50px; flex: 1; }

.hero-section {
    width: 90%; max-width: 1300px; margin: 40px auto;
    position: relative; height: 45vh; min-height: 380px;
    border-radius: 20px; overflow: hidden; display: block;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border: 1px solid var(--surface-border);
}
.light-mode .hero-section { box-shadow: 0 10px 40px rgba(0,0,0,0.1); }

.hero-slide {
    position: absolute; inset: 0; opacity: 0; z-index: 1;
    transition: opacity 0.8s ease-in-out;
    display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
}
.hero-slide.active { opacity: 1; z-index: 2; }

.hero-bg-media {
    position: absolute; top: -10%; left: -10%;
    width: 120%; height: 120%; z-index: 1;
    background-size: cover; background-position: center; object-fit: cover;
}

/* افکت حرکت نرم (Ken Burns) */
.hero-bg-media.kenburns { animation: kenburns 20s linear infinite alternate; }
@keyframes kenburns {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.1) translate(-2%, -2%); }
}

.hero-overlay {
    position: absolute; inset: 0; z-index: 2;
    background-color: var(--od); opacity: var(--odo);
    transition: background-color 0.5s, opacity 0.5s;
}
.light-mode .hero-overlay { background-color: var(--ol); opacity: var(--olo); }

.hero-content { position: relative; z-index: 3; padding: 20px; width: 100%; direction: inherit; }
.hero-content * { text-shadow: 0 2px 4px rgba(0,0,0,0.8); } /* ایجاد سایه برای خوانایی متون روی عکس */
.light-mode .hero-content * { text-shadow: 0 1px 3px rgba(255,255,255,0.4); }

/* فلش‌های اسلایدر */
.slider-controls {
    position: absolute; bottom: 20px; right: 20px; z-index: 10; display: flex; gap: 10px;
}
html[dir="ltr"] .slider-controls { right: auto; left: 20px; flex-direction: row-reverse; }

.slider-btn {
    background: rgba(0,0,0,0.4); color: #fff;
    border: 1px solid rgba(255,255,255,0.2); border-radius: 50%;
    width: 35px; height: 35px; cursor: pointer;
    display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(4px); transition: all 0.3s;
}
.slider-btn:hover { background: var(--gold-main); color: #000; border-color: var(--gold-main); }
.light-mode .slider-btn { background: rgba(255,255,255,0.4); color: #000; border-color: rgba(0,0,0,0.1); }
.light-mode .slider-btn:hover { background: var(--gold-main); color: #fff; }

/* ==================================================================
   سایر بخش‌ها و طراحی شیشه‌ای
================================================================== */
.main-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px;
    width: 90%; max-width: 1300px; margin: 0 auto 40px auto;
}

.glass-panel, .feat-item {
    position: relative; border-radius: 16px; padding: 1px; 
    background: transparent; z-index: 1; overflow: hidden; transition: transform 0.3s ease;
}

.glass-panel::before, .feat-item::before {
    content: ''; position: absolute; top: 50%; left: 50%; width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent 75%, rgba(212, 175, 55, 0.4) 100%);
    transform-origin: center; transform: translate(-50%, -50%);
    animation: spin 3s linear infinite; z-index: -2;
    opacity: 0; transition: opacity 0.4s ease;
}

.glass-panel:hover::before, .feat-item:hover::before { opacity: 1; }
.glass-panel:hover, .feat-item:hover { transform: translateY(-5px); }

.glass-panel::after, .feat-item::after {
    content: ''; position: absolute; inset: 1px;
    background: var(--surface-color); backdrop-filter: var(--glass-blur);
    border-radius: 15px; z-index: -1;
}

.glass-panel-content { position: relative; z-index: 2; padding: 25px; height: 100%; display: flex; flex-direction: column; }
.feat-item-content { display: flex; gap: 15px; align-items: center; width: 100%; padding: 15px; position: relative; z-index: 2; }

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.panel-header { text-align: center; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 15px; }
.light-mode .panel-header { border-bottom-color: rgba(0,0,0,0.05); }
.panel-header h3 { margin: 0 0 5px 0; color: var(--gold-main); font-size: 20px; }
.panel-header p { margin: 0; font-size: 12px; color: var(--text-muted); }

.item-list { display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; flex: 1; align-content: flex-start; }

.book-card { text-align: center; width: calc(33.333% - 10px); }
.book-cover { width: 100%; height: 140px; border-radius: 6px; object-fit: cover; box-shadow: 2px 4px 10px rgba(0,0,0,0.5); margin-bottom: 10px; border: 1px solid rgba(212, 175, 55, 0.2); }
.book-card h4 { font-size: 13px; margin: 0; }

.audio-card { text-align: center; width: calc(33.333% - 10px); }
.audio-cover { width: 100%; aspect-ratio: 1/1; border-radius: 8px; object-fit: cover; margin-bottom: 10px; border: 1px solid rgba(212, 175, 55, 0.2); }
.player-controls { display: flex; justify-content: center; gap: 8px; color: var(--text-muted); }
.player-controls span { cursor: pointer; transition: color 0.2s; font-size: 12px; }
.player-controls span:hover { color: var(--gold-main); }
.audio-card h4 { font-size: 12px; margin: 0 0 5px 0; }

.video-card { position: relative; width: calc(50% - 10px); border-radius: 8px; overflow: hidden; cursor: pointer; border: 1px solid rgba(212, 175, 55, 0.2); margin-bottom: 10px; }
.video-card img { width: 100%; height: 100px; object-fit: cover; display: block; filter: brightness(0.7); transition: filter 0.3s; }
.video-card:hover img { filter: brightness(0.9); }
.play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 35px; height: 35px; background: rgba(212, 175, 55, 0.8); border-radius: 50%; display: flex; justify-content: center; align-items: center; color: #fff; padding-left: 3px; backdrop-filter: blur(4px); font-size: 12px;}

.article-card { width: 100%; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.02); padding: 8px; border-radius: 8px; }
.article-card img { width: 50px; height: 50px; border-radius: 4px; object-fit: cover; }
.article-card h4 { font-size: 12px; margin: 0; color: var(--text-main); }

.gallery-card { width: calc(50% - 10px); border-radius: 8px; overflow: hidden; }
.gallery-card img { width: 100%; height: 100px; object-fit: cover; display: block; transition: transform 0.3s; }
.gallery-card:hover img { transform: scale(1.1); }

.featured-section { width: 90%; max-width: 1300px; margin: 0 auto 40px auto; }
.featured-content { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.feat-item { flex: 1; min-width: 250px; }
.feat-item img { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; }
.feat-info h4 { margin: 0 0 5px 0; color: var(--gold-light); font-size: 15px; }
.feat-info p { margin: 0; font-size: 11px; color: var(--text-muted); }

/* ==================================================================
   اینستاگرام و تماس با ما
================================================================== */
.instagram-section { width: 90%; max-width: 1300px; margin: 0 auto 50px auto; display: none; }
.insta-marquee-wrapper { overflow: hidden; white-space: nowrap; width: 100%; position: relative; padding: 10px 0; mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent); -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent); }
.insta-marquee { display: inline-flex; gap: 20px; }
.marquee-animate-rtl { animation: marquee-right 30s linear infinite; }
.marquee-animate-ltr { animation: marquee-left 30s linear infinite; }
.insta-marquee:hover { animation-play-state: paused; }
@keyframes marquee-right { 0% { transform: translateX(-50%); } 100% { transform: translateX(0%); } }
@keyframes marquee-left { 0% { transform: translateX(0%); } 100% { transform: translateX(-50%); } }

.insta-post { width: 200px; height: 200px; border-radius: 12px; overflow: hidden; position: relative; flex-shrink: 0; border: 1px solid var(--surface-border); display: block; }
.insta-post img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.insta-post:hover img { transform: scale(1.1); }
.insta-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s; color: #fff; }
.insta-post:hover .insta-overlay { opacity: 1; }
.insta-overlay svg { width: 40px; height: 40px; }

.contact-section { width: 90%; max-width: 1300px; margin: 0 auto 50px auto; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.contact-form-box { display: flex; flex-direction: column; gap: 15px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--gold-main); font-size: 14px; font-weight: bold; }
.form-control { width: 100%; padding: 12px; background: rgba(0,0,0,0.2); border: 1px solid var(--surface-border); color: var(--text-main); border-radius: 8px; font-family: inherit; box-sizing: border-box; transition: border-color 0.3s; }
.light-mode .form-control { background: rgba(255,255,255,0.5); }
.form-control:focus { outline: none; border-color: var(--gold-main); }
.btn-submit { background: var(--gold-main); color: #111; padding: 12px 25px; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; font-family: inherit; transition: background 0.3s; margin-top: 10px; width: 100%; }
.btn-submit:hover { background: var(--gold-light); }

.contact-info-box { display: flex; flex-direction: column; gap: 20px; }
.info-item { display: flex; gap: 15px; align-items: flex-start; }
.info-icon { background: rgba(212, 175, 55, 0.1); color: var(--gold-main); width: 40px; height: 40px; border-radius: 50%; display: flex; justify-content: center; align-items: center; flex-shrink: 0; font-size: 18px; }
.info-text h4 { margin: 0 0 5px 0; color: var(--gold-main); font-size: 15px; }
.info-text p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.map-container { width: 100%; height: 200px; border-radius: 8px; overflow: hidden; border: 1px solid var(--surface-border); margin-top: 10px; }
.map-container iframe { width: 100%; height: 100%; border: none; }

.main-footer { width: 100%; background: var(--surface-color); backdrop-filter: var(--glass-blur); border-top: 1px solid var(--surface-border); padding: 20px 0; font-size: 13px; color: var(--text-muted); margin-top: auto; }
.footer-content { display: flex; justify-content: space-between; align-items: center; width: 90%; max-width: 1300px; margin: 0 auto; }
.footer-section { flex: 1; }
.right-section { text-align: right; }
html[dir="ltr"] .right-section { text-align: left; }
.center-section { text-align: center; }
.left-section { text-align: left; }
html[dir="ltr"] .left-section { text-align: right; }

@media (max-width: 1100px) {
    header { gap: 15px; padding: 12px 15px; flex-wrap: wrap; justify-content: center; }
    nav { width: 100%; }
    nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0; padding: 0; }
    nav ul li { flex: 0 1 auto; }
    .logo-box h1 { font-size: 16px; }
    .btn-outline { padding: 4px 8px; font-size: 10px; }
}
@media (max-width: 768px) {
    .main-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .hero-section h2 { font-size: 24px; }
    .hero-section { width: 95%; }
    .footer-content { flex-direction: column; gap: 10px; text-align: center; }
    .right-section, .center-section, .left-section { text-align: center; }
}

/* =======================================================
   انیمیشن‌های شکیل و سینمایی برای پاپ‌آپ کتاب (Modal)
======================================================= */
.book-modal-overlay { 
    position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(15px); 
    z-index: 9999; display: flex; justify-content: center; align-items: center; 
    opacity: 0; visibility: hidden; 
    transition: opacity 0.5s ease, visibility 0.5s ease; padding: 20px; 
}
.book-modal-overlay.active { opacity: 1; visibility: visible; }

.book-modal { 
    background: var(--surface-color); border: 1px solid var(--surface-border); 
    width: 100%; max-width: 1200px; height: 85vh; max-height: 800px; 
    border-radius: 20px; overflow: hidden; display: flex; box-shadow: 0 30px 60px rgba(0,0,0,0.7); 
    position: relative; 
    transform: scale(0.9) translateY(40px); opacity: 0; 
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1); 
}
.light-mode .book-modal { background: rgba(255, 255, 255, 0.95); box-shadow: 0 20px 50px rgba(0,0,0,0.2); }
.book-modal-overlay.active .book-modal { transform: scale(1) translateY(0); opacity: 1; }

.modal-cover { width: 400px; flex-shrink: 0; background: rgba(0,0,0,0.3); display: flex; justify-content: center; align-items: center; padding: 40px; border-right: 1px solid var(--surface-border); }
html[dir="rtl"] .modal-cover { border-right: none; border-left: 1px solid var(--surface-border); }
.light-mode .modal-cover { background: rgba(0,0,0,0.03); }
.modal-cover img { width: 100%; max-width: 260px; border-radius: 8px; box-shadow: 0 15px 35px rgba(0,0,0,0.6); }

.modal-info { padding: 50px 60px; flex: 1; display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--gold-main) transparent; }
.modal-info h2 { margin: 0 0 15px 0; color: var(--gold-main); font-size: 38px; line-height: 1.3; }
.modal-info h4 { margin: 0 0 25px 0; color: var(--text-muted); font-size: 20px; font-weight: normal; display: flex; align-items: center; gap: 8px; }
.modal-info h4::before { content: '✍️'; font-size: 18px; }
.modal-info .summary { font-size: 17px; line-height: 2; color: var(--text-main); margin-bottom: 40px; text-align: justify; }

.modal-close { position: absolute; top: 20px; right: 20px; background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); width: 45px; height: 45px; border-radius: 50%; font-size: 20px; cursor: pointer; transition: all 0.3s; display: flex; justify-content: center; align-items: center; z-index: 10; }
html[dir="rtl"] .modal-close { right: auto; left: 20px; }
.modal-close:hover { background: #ef4444; color: #fff; transform: rotate(90deg); }

/* =======================================================
   استایل‌های پاپ‌آپ یکپارچه تماس با ما
======================================================= */
.contact-modal-overlay { 
    position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(15px); 
    z-index: 9999; display: flex; justify-content: center; align-items: center; 
    opacity: 0; visibility: hidden; 
    transition: opacity 0.5s ease, visibility 0.5s ease; padding: 20px; 
}
.contact-modal-overlay.active { opacity: 1; visibility: visible; }

.contact-modal-box { 
    background: var(--surface-color); border: 1px solid var(--surface-border); 
    width: 100%; max-width: 1000px; border-radius: 20px; padding: 30px; 
    box-shadow: 0 30px 60px rgba(0,0,0,0.7); position: relative; 
    transform: scale(0.9) translateY(40px); opacity: 0; 
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1); 
    max-height: 95vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--gold-main) transparent; 
}
.light-mode .contact-modal-box { background: rgba(255, 255, 255, 0.95); box-shadow: 0 20px 50px rgba(0,0,0,0.2); }
.contact-modal-overlay.active .contact-modal-box { transform: scale(1) translateY(0); opacity: 1; }

.contact-modal-close { position: absolute; top: 20px; right: 20px; background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); width: 40px; height: 40px; border-radius: 50%; font-size: 18px; cursor: pointer; transition: all 0.3s; display: flex; justify-content: center; align-items: center; z-index: 10; }
html[dir="rtl"] .contact-modal-close { right: auto; left: 20px; }
.contact-modal-close:hover { background: #ef4444; color: #fff; transform: rotate(90deg); }

@media (max-width: 992px) {
    .book-modal { flex-direction: column; height: auto; max-height: 90vh; }
    .modal-cover { width: 100%; padding: 30px; height: auto; border: none; border-bottom: 1px solid var(--surface-border); }
    .modal-cover img { max-width: 180px; }
    .modal-info { padding: 30px; }
    .modal-info h2 { font-size: 28px; }
    .modal-info .summary { font-size: 16px; }
    .contact-modal-box { padding: 25px; }
}

/* =======================================================
   صفحه لودینگ (Splash Screen) سایت
======================================================= */
#site-global-splash { 
    position: fixed; inset: 0; z-index: 9999999; 
    display: flex; justify-content: center; align-items: center; 
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
#site-global-splash.hide-splash { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-content-box { text-align: center; }
.splash-content-box img { 
    max-width: 250px; max-height: 250px; object-fit: contain; 
    animation: splashPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes splashPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

/* Mobile website only: keep these changes outside index.php and the installed app. */
@media (max-width: 768px) {
    html:not(.pwa-standalone) .content-wrapper {
        margin-top: 100px !important;
        padding-right: clamp(12px, 4vw, 20px) !important;
        padding-left: clamp(12px, 4vw, 20px) !important;
    }

    html:not(.pwa-standalone) .hero-section {
        aspect-ratio: auto !important;
        height: clamp(190px, 55vw, 300px) !important;
        min-height: 190px !important;
        max-height: 300px !important;
        border-radius: 16px !important;
    }

    html:not(.pwa-standalone) .featured-content {
        padding: 16px !important;
    }

    html:not(.pwa-standalone) .featured-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-flow: row;
        grid-auto-columns: auto;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    html:not(.pwa-standalone) .hero-section {
        width: 100% !important;
        margin-top: 10px !important;
        aspect-ratio: auto !important;
        height: clamp(190px, 58vw, 250px) !important;
        min-height: 190px !important;
        max-height: 250px !important;
        border-radius: 12px !important;
    }

    html:not(.pwa-standalone) .featured-grid { gap: 10px; }
    html:not(.pwa-standalone) .featured-pick-card { border-radius: 10px; }
    html:not(.pwa-standalone) .featured-badge {
        width: 28px;
        height: 28px;
        top: 7px;
        right: 7px;
        font-size: 14px;
    }
    html[dir="rtl"]:not(.pwa-standalone) .featured-badge { right: auto; left: 7px; }
    html:not(.pwa-standalone) .feat-media-btn { width: 42px; height: 42px; border-width: 2px; }
    html:not(.pwa-standalone) .feat-video-btn { padding-left: 3px; font-size: 16px; }
    html:not(.pwa-standalone) .feat-audio-btn { font-size: 18px; }
    html:not(.pwa-standalone) .featured-pick-overlay span { font-size: 24px !important; }
}
