/* ==========================================================================
   رادیو قرآن ژاپن - فایل استایل اصلی (CSS)
   نسخه: 9.0 (مجهز به جستجوی کپسولی گلوبال و ایجکس)
   ========================================================================== */

/* ==========================================================================
   بخش ۱: متغیرهای رنگی و تم‌ها (Variables & Themes)
   ========================================================================== */
:root {
    --bg-body: #F9FBF9;
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.95);
    --bg-element: #eff2f1;
    --bg-sidebar-glass: rgba(255, 255, 255, 0.98);
    --text-main: #1A2E26;
    --text-muted: #627D71;
    --primary: #1B5E20; 
    --primary-light: #4C8C4A;
    --accent: #D4AF37; 
    --japanese-red: #BC002D; 
    --header-height: 85px;
    --radius-card: 20px;
    --shadow: 0 8px 30px rgba(27, 94, 32, 0.08);
    --shadow-hover: 0 15px 35px rgba(27, 94, 32, 0.15);
}

body.dark-mode {
    --bg-body: #0D1410;
    --bg-card: #16211B;
    --bg-header: rgba(22, 33, 27, 0.95);
    --bg-element: #1F2E26;
    --bg-sidebar-glass: rgba(13, 20, 16, 0.98);
    --text-main: #E0EADD;
    --text-muted: #8FA69A;
    --primary: #2E7D32;
    --accent: #FDD835;
}

/* ==========================================================================
   بخش ۲: استایل‌های پایه و فونت‌ها (Base Styles & Typography)
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); -webkit-tap-highlight-color: transparent; }
html[lang="ja"] body { font-family: 'Noto Sans JP', sans-serif; letter-spacing: 0.02em; word-break: break-all; overflow-wrap: break-word; }
html[lang="ja"] h1, html[lang="ja"] h2, html[lang="ja"] h3 { font-family: 'Zen Old Mincho', serif; }
html[lang="en"] body { font-family: 'Noto Sans JP', sans-serif; letter-spacing: 0.01em; }
html[lang="fa"] body { font-family: 'Vazirmatn', sans-serif; letter-spacing: 0; }
body { background-color: var(--bg-body); color: var(--text-main); overflow-x: hidden; padding-bottom: calc(90px + env(safe-area-inset-bottom)); line-height: 1.8; background-image: radial-gradient(circle at 10% 20%, rgba(27, 94, 32, 0.03) 0%, transparent 20%), radial-gradient(circle at 90% 80%, rgba(212, 175, 55, 0.05) 0%, transparent 20%); }
a { text-decoration: none; color: inherit; display: inline-block; }
img { width: 100%; height: 100%; object-fit: cover; display: block; }
button:active, .control-btn:active, .qa-item:active, .prayer-time-card:active, .playlist-item:active, .live-btn:active, .mobile-header-btn:active, .s-btn:active { transform: scale(0.92); }
html[dir="rtl"] .fa-chevron-right { transform: scaleX(-1); }
html[dir="rtl"] .fa-chevron-left { transform: scaleX(-1); }

/* ==========================================================================
   بخش ۳: نوار اطلاعات بالا (Top Utility Bar)
   ========================================================================== */
.top-info-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 5%; padding-top: max(10px, env(safe-area-inset-top)); background: var(--bg-body); color: var(--text-muted); font-size: 0.8rem; border-bottom: 1px solid rgba(0,0,0,0.05); position: relative; z-index: 2000; }
.top-info-bar .prayer-times, .top-info-bar .left-controls { pointer-events: auto; }
.prayer-times { display: flex; align-items: center; gap: 8px; font-weight: 600; flex-wrap: wrap; }
.prayer-badge { background: rgba(27, 94, 32, 0.1); color: var(--primary); padding: 2px 8px; border-radius: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.countdown-badge { background: #ffebee; color: #d32f2f; border: 1px solid #ffcdd2; padding: 2px 10px; border-radius: 20px; font-weight: 800; font-size: 0.75rem; display: flex; align-items: center; gap: 4px; animation: pulse-red-soft 2s infinite; white-space: nowrap; }
.countdown-badge i { font-size: 0.7rem; }
@keyframes pulse-red-soft { 0% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.2); } 70% { box-shadow: 0 0 0 4px rgba(211, 47, 47, 0); } 100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); } }
.left-controls { display: flex; align-items: center; gap: 8px; }
.control-btn { width: 32px; height: 32px; background-color: var(--bg-element); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-main); cursor: pointer; pointer-events: auto; }
.lang-wrapper { position: relative; pointer-events: auto; }
.lang-selector { width: auto; padding: 0 12px; border-radius: 20px; gap: 6px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center;}
.lang-dropdown { position: absolute; top: 120%; right: 0; width: 140px; background-color: var(--bg-card); border-radius: 12px; box-shadow: 0 5px 25px rgba(0,0,0,0.2); border: 1px solid rgba(0,0,0,0.05); display: none; flex-direction: column; z-index: 2005; overflow: hidden; }
html[dir="ltr"] .lang-dropdown { right: 0; left: auto; }
html[dir="rtl"] .lang-dropdown { left: 0; right: auto; }
.lang-dropdown.show { display: flex; animation: slideDown 0.3s ease; }
.lang-option { padding: 12px 15px; font-size: 0.9rem; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.lang-option:hover { background-color: var(--bg-element); color: var(--primary); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   بخش ۴: هدر اصلی و لوگوی مستقل (Main Header & Logo)
   ========================================================================== */
.header-wrapper { position: sticky; top: 10px; height: var(--header-height); background-color: var(--bg-header); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: space-between; padding: 0 40px; z-index: 1000; width: 95%; max-width: 1400px; margin: 0 auto; border-radius: 25px; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,0.2); }
.nav-section { display: flex; align-items: center; gap: 20px; flex: 1; }
.nav-link { font-weight: 600; font-size: 1rem; color: var(--text-main); gap: 8px; position: relative; display: flex; align-items: center; white-space: nowrap; cursor: pointer; }
.nav-link::after { content: ''; position: absolute; bottom: -5px; right: 0; width: 0; height: 2px; background: var(--accent); transition: 0.3s; }
html[dir="ltr"] .nav-link::after { right: auto; left: 0; }
.nav-link:hover { color: var(--primary); }
.nav-link:hover::after { width: 100%; }
#master-logo-section { position: absolute; top: 25px; left: 50%; transform: translateX(-50%); width: 160px; height: 160px; z-index: 10000; display: flex; align-items: center; justify-content: center; flex-direction: column; background: var(--bg-card); border-radius: 50%; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border: 6px solid var(--bg-body); overflow: hidden; pointer-events: auto; transition: all 0.3s ease; }
.logo-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-text { font-family: 'Zen Old Mincho', serif; font-weight: 900; font-size: 1.2rem; color: var(--primary); text-align: center; line-height: 1.2; }
html[lang="fa"] .logo-text { font-family: 'Vazirmatn'; font-size: 1.4rem; }
.logo-text span { color: var(--accent); display: block; font-size: 0.9rem; font-weight: 400; margin-top: 5px; font-family: sans-serif; }
.live-btn { background: linear-gradient(135deg, var(--japanese-red), #D32F2F); color: white !important; padding: 10px 20px; border-radius: 50px; box-shadow: 0 4px 15px rgba(188, 0, 45, 0.3); display: flex; align-items: center; gap: 8px; font-weight: 700; animation: pulse-red 2s infinite; white-space: nowrap; font-size: 0.9rem; }
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(188, 0, 45, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(188, 0, 45, 0); } 100% { box-shadow: 0 0 0 0 rgba(188, 0, 45, 0); } }

/* ==========================================================================
   بخش ۵: سایدبار موبایل (Mobile Sidebar)
   ========================================================================== */
.mobile-header-btn { display: none; font-size: 1.5rem; color: var(--text-main); cursor: pointer; width: 44px; height: 44px; display: none; align-items: center; justify-content: center;}
.mobile-sidebar { position: fixed; top: 0; width: 280px; height: 100vh; background-color: var(--bg-sidebar-glass); backdrop-filter: blur(20px); z-index: 5000; display: flex; flex-direction: column; transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 0 30px rgba(0,0,0,0.2); padding-top: env(safe-area-inset-top); }
html[dir="rtl"] .mobile-sidebar { right: -300px; left: auto; border-left: 1px solid rgba(0,0,0,0.1); }
html[dir="rtl"] .mobile-sidebar.open { right: 0; }
html[dir="ltr"] .mobile-sidebar { left: -300px; right: auto; border-right: 1px solid rgba(0,0,0,0.1); }
html[dir="ltr"] .mobile-sidebar.open { left: 0; }
.mobile-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 4999; opacity: 0; visibility: hidden; transition: 0.3s; backdrop-filter: blur(3px); }
.mobile-overlay.open { opacity: 1; visibility: visible; }

/* ==========================================================================
   بخش ۶: جستجوی کپسولی گلوبال (NEW SMART GLOBAL SEARCH)
   ========================================================================== */
.global-search-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); z-index: 10001; opacity: 0; visibility: hidden; transition: 0.3s ease; }
.global-search-overlay.active { opacity: 1; visibility: visible; }

.global-search-container { position: fixed; top: 20px; left: 50%; transform: translate(-50%, -150%); z-index: 10002; width: 90%; max-width: 600px; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.global-search-container.active { transform: translate(-50%, 0); }

.search-capsule { display: flex; align-items: center; background: var(--bg-card); padding: 8px 15px; border-radius: 50px; box-shadow: 0 15px 40px rgba(0,0,0,0.2); border: 2px solid var(--accent); }
body.dark-mode .search-capsule { border-color: rgba(253, 216, 53, 0.5); }
.search-capsule input { flex: 1; border: none; background: transparent; font-size: 1.1rem; color: var(--text-main); padding: 0 15px; outline: none; font-family: inherit; font-weight: bold; }
.s-icon { color: var(--text-muted); font-size: 1.2rem; margin-inline-start: 10px; }

.s-btn { background: var(--bg-element); border: none; width: 45px; height: 45px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-main); cursor: pointer; margin-inline-start: 10px; transition: 0.3s; font-size: 1.1rem; }
.s-btn:hover { background: var(--primary); color: white; transform: scale(1.05); }
.s-btn.close-btn { background: rgba(188,0,45,0.1); color: var(--japanese-red); }
.s-btn.close-btn:hover { background: var(--japanese-red); color: white; }

.search-filters-panel { background: var(--bg-card); border-radius: 25px; padding: 20px; margin-top: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); display: none; gap: 15px; flex-direction: column; border: 1px solid rgba(0,0,0,0.05); }
body.dark-mode .search-filters-panel { border-color: rgba(255,255,255,0.05); }
.search-filters-panel.show { display: flex; animation: slideDown 0.3s ease; }
.search-filters-panel select { width: 100%; padding: 15px 20px; border-radius: 15px; border: 2px solid var(--bg-element); background: var(--bg-body); font-family: inherit; font-size: 1rem; font-weight: bold; color: var(--text-main); outline: none; cursor: pointer; transition: 0.3s; }
.search-filters-panel select:focus { border-color: var(--accent); }

/* ==========================================================================
   بخش ۷: اسلایدر صفحه اصلی (Hero Slider)
   ========================================================================== */
.hero-slider-section { position: relative; width: 100%; height: 600px; margin-top: -50px; z-index: 1; overflow: hidden; }
.slider-container { position: relative; width: 100%; height: 100%; }
.hero-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; visibility: hidden; transition: opacity 1.5s ease-in-out, visibility 1.5s ease-in-out; display: flex; align-items: center; justify-content: center; text-align: center; color: white; }
.hero-slide.active { opacity: 1; visibility: visible; }
.hero-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; z-index: 0; transform: scale(1.05); transition: transform 10s ease; }
.hero-slide.active .hero-bg { transform: scale(1); }
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(180deg, rgba(27,94,32,0.7), rgba(0,0,0,0.3), var(--bg-body)); z-index: 1; }
.hero-content { position: relative; z-index: 2; max-width: 800px; padding: 20px; opacity: 0; transform: translateY(20px); transition: all 1s ease-out 0.5s; }
.hero-slide.active .hero-content { opacity: 1; transform: translateY(0); }
.hero-title { font-size: 3rem; font-weight: 800; margin-bottom: 15px; text-shadow: 0 4px 10px rgba(0,0,0,0.3); line-height: 1.3; }
.hero-subtitle { font-size: 1.2rem; font-weight: 300; margin-bottom: 30px; color: #eee; }
html[lang="ja"] .hero-content { display: flex; flex-direction: row-reverse; align-items: center; justify-content: center; gap: 40px; height: 100%; }
html[lang="ja"] .hero-title { writing-mode: vertical-rl; text-orientation: upright; font-family: 'Zen Old Mincho', serif; letter-spacing: 0.2em; margin: 0; height: 300px; text-align: left; border-right: 4px solid var(--accent); padding-right: 20px; }
html[lang="ja"] .hero-subtitle { writing-mode: vertical-rl; text-orientation: upright; margin: 0; letter-spacing: 0.1em; height: 200px; opacity: 0.9; }
html[lang="ja"] .hero-action-wrapper { writing-mode: horizontal-tb; display: flex; flex-direction: column; align-items: center; margin-right: 40px; }
.hero-player-btn { width: 80px; height: 80px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #fff; margin: 0 auto; cursor: pointer; box-shadow: 0 0 0 8px rgba(212, 175, 55, 0.3); transition: 0.3s; }
.hero-player-btn:hover { transform: scale(1.1); background: white; color: var(--accent); }
.slider-dots { position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 10; }
.slider-dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; transition: 0.3s; }
.slider-dot.active { background: var(--accent); transform: scale(1.2); }

/* ==========================================================================
   بخش ۸: ساختار محتوا، دسترسی سریع و آیه متحرک
   ========================================================================== */
.content-wrapper { max-width: 1250px; margin: 0 auto; padding: 40px 20px; position: relative; z-index: 5; }
.quick-access-bar { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; margin-top: -60px; margin-bottom: 60px; }
.qa-item { background: var(--bg-card); padding: 20px 25px; border-radius: 15px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 140px; flex: 1; max-width: 200px; cursor: pointer; border-bottom: 3px solid transparent; text-align: center; }

.daily-ayah-wrapper { margin-bottom: 50px; position: relative; z-index: 5; }
.ayah-card { background: linear-gradient(135deg, var(--bg-card), var(--bg-element)); border-radius: var(--radius-card); padding: 15px 25px; display: flex; align-items: center; gap: 20px; box-shadow: 0 10px 40px rgba(212, 175, 55, 0.15); border: 1px solid rgba(212, 175, 55, 0.4); position: relative; overflow: hidden; backdrop-filter: blur(10px); transition: transform 0.3s ease; }
.ayah-card:hover { transform: translateY(-3px); box-shadow: 0 15px 50px rgba(212, 175, 55, 0.25); }
.ayah-card::before { content: ''; position: absolute; top: 0; left: 0; width: 5px; height: 100%; background: var(--accent); box-shadow: 0 0 15px var(--accent); }
html[dir="rtl"] .ayah-card::before { left: auto; right: 0; }
body.dark-mode .ayah-card { background: linear-gradient(135deg, #16211B, #1F2E26); border-color: rgba(253, 216, 53, 0.25); }
.ayah-icon { width: 55px; height: 55px; background: rgba(212, 175, 55, 0.15); color: var(--accent); border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.6rem; flex-shrink: 0; animation: pulse-gold-ayah 3s infinite; }
@keyframes pulse-gold-ayah { 0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); } 70% { box-shadow: 0 0 0 12px rgba(212, 175, 55, 0); } 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); } }
.ayah-content { flex-grow: 1; overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.ayah-badge { font-size: 0.75rem; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; display: flex; align-items: center; gap: 5px; }
.ayah-ticker-container { width: 100%; overflow: hidden; white-space: nowrap; box-sizing: border-box; mask-image: linear-gradient(to right, transparent, black 3%, black 97%, transparent); -webkit-mask-image: linear-gradient(to right, transparent, black 3%, black 97%, transparent); }
.ayah-ticker { display: inline-block; padding-left: 100%; animation: ayah-scroll 25s linear infinite; font-size: 1.15rem; font-weight: 600; color: var(--text-main); cursor: default; }
.ayah-ticker:hover { animation-play-state: paused; }
html[dir="rtl"] .ayah-ticker { padding-left: 0; padding-right: 100%; animation: ayah-scroll-rtl 25s linear infinite; }
@keyframes ayah-scroll { 0% { transform: translate(0, 0); } 100% { transform: translate(-100%, 0); } }
@keyframes ayah-scroll-rtl { 0% { transform: translate(0, 0); } 100% { transform: translate(100%, 0); } }
.ayah-arabic { font-family: 'Amiri', 'Vazirmatn', serif; color: var(--primary); font-size: 1.35rem; font-weight: bold; }
body.dark-mode .ayah-arabic { color: var(--accent); }
.ayah-divider { margin: 0 20px; color: var(--accent); opacity: 0.7; }

/* ==========================================================================
   بخش ۹: اوقات شرعی و جدول رمضان (Prayer Times & Ramadan)
   ========================================================================== */
.prayer-full-section { margin-bottom: 70px; scroll-margin-top: 100px; }
.prayer-controls { display: flex; justify-content: space-between; align-items: center; background: var(--bg-card); padding: 20px; border-radius: var(--radius-card); box-shadow: var(--shadow); margin-bottom: 30px; flex-wrap: wrap; gap: 15px; }
.city-select-group { display: flex; align-items: center; gap: 10px; flex: 1; }
.custom-select { padding: 12px 15px; border-radius: 12px; border: 1px solid #ddd; background: var(--bg-body); font-family: inherit; color: var(--text-main); font-weight: bold; cursor: pointer; width: 100%; max-width: 200px; }
.audio-toggle-btn { background: var(--bg-element); border: none; padding: 12px 20px; border-radius: 50px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-muted); transition: 0.3s; font-weight: 600; white-space: nowrap; }
.audio-toggle-btn.active { background: var(--primary); color: white; }
.prayer-cards-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; margin-bottom: 40px; }
.prayer-time-card { background: var(--bg-card); padding: 20px 10px; border-radius: 15px; text-align: center; box-shadow: var(--shadow); border: 1px solid transparent; transition: 0.3s; position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 140px; }
.prayer-time-card.active { border-color: var(--accent); background: linear-gradient(to bottom, var(--bg-card), rgba(212, 175, 55, 0.1)); transform: translateY(-5px); }
.prayer-time-card.active::before { content: 'Next'; position: absolute; top: 0; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 0.6rem; padding: 2px 8px; border-radius: 0 0 8px 8px; }
.p-icon { font-size: 1.8rem; color: var(--primary); margin-bottom: 10px; }
.p-name { font-size: 0.9rem; color: var(--text-muted); font-weight: 600; margin-bottom: 5px; }
.p-time { font-size: 1.3rem; font-weight: 800; color: var(--text-main); font-family: 'Vazirmatn', sans-serif; }
.adhan-control-area { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 25px; }
.adhan-toggle-icon { cursor: pointer; color: var(--text-muted); font-size: 1.1rem; transition: 0.3s; padding: 8px; border-radius: 50%; background: var(--bg-element); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }
.adhan-toggle-icon:hover { background: rgba(0,0,0,0.05); }
.adhan-toggle-icon.active { color: white; background: var(--primary); box-shadow: 0 2px 5px rgba(27, 94, 32, 0.3); }
.adhan-countdown-text { font-size: 0.75rem; color: var(--japanese-red); font-weight: bold; font-family: monospace; background: #ffebee; padding: 2px 6px; border-radius: 4px; display: none; }
.adhan-countdown-text.visible { display: inline-block; animation: blink-soft 2s infinite; }
.ramadan-table-wrapper { background: var(--bg-card); border-radius: var(--radius-card); padding: 25px; box-shadow: var(--shadow); overflow-x: auto; position: relative; -webkit-overflow-scrolling: touch; }
.ramadan-header { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; border-bottom: 2px solid var(--accent); padding-bottom: 10px; }
.ramadan-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; min-width: 600px; }
.ramadan-table th { text-align: center; padding: 15px; background: var(--bg-element); color: var(--primary); font-weight: 800; white-space: nowrap; }
.ramadan-table td { text-align: center; padding: 12px; border-bottom: 1px solid rgba(0,0,0,0.05); color: var(--text-main); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ramadan-table tr.row-past { background-color: rgba(220, 220, 220, 0.3); color: #999; }
.ramadan-table tr.row-past td { color: #999; }
.ramadan-table tr.row-future { background-color: rgba(224, 247, 250, 0.4); }
.ramadan-table tr.row-today td { background-color: #1B5E20 !important; color: white !important; border: none !important; border-radius: 0; }
html[dir="ltr"] .ramadan-table tr.row-today td:first-child { border-top-left-radius: 20px; border-bottom-left-radius: 20px; }
html[dir="ltr"] .ramadan-table tr.row-today td:last-child { border-top-right-radius: 20px; border-bottom-right-radius: 20px; }
html[dir="rtl"] .ramadan-table tr.row-today td:first-child { border-top-right-radius: 20px; border-bottom-right-radius: 20px; }
html[dir="rtl"] .ramadan-table tr.row-today td:last-child { border-top-left-radius: 20px; border-bottom-left-radius: 20px; }
.ramadan-table tr.row-hidden { display: none; }
.ramadan-show-more { text-align: center; margin-top: 20px; border-top: 1px solid rgba(0,0,0,0.05); padding-top: 15px; }
.btn-show-more { background-color: var(--bg-element); color: var(--text-main); border: 1px solid var(--primary); padding: 12px 30px; border-radius: 50px; cursor: pointer; font-size: 0.9rem; font-weight: 700; transition: 0.3s; display: inline-flex; align-items: center; gap: 8px; }
.btn-show-more:hover { background-color: var(--primary); color: white; }
.table-countdown { font-size: 0.85rem; background: #c0392b; color: white; padding: 2px 8px; border-radius: 10px; margin-left: 5px; font-weight: bold; animation: pulse-red-soft 2s infinite; display: inline-block; }

/* ==========================================================================
   بخش ۱۰: اخبار قرآنی و اسلامی (Islamic News)
   ========================================================================== */
.news-section-wrapper { position: relative; z-index: 5; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 25px; }
.news-card { background: var(--bg-card); border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; border: 1px solid transparent; transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); display: flex; flex-direction: column; }
.news-card:hover { transform: translateY(-7px); border-color: var(--accent); box-shadow: var(--shadow-hover); }
.news-img-wrap { width: 100%; height: 200px; overflow: hidden; position: relative; border-bottom: 3px solid var(--accent); }
.news-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.news-card:hover .news-img-wrap img { transform: scale(1.08); }
.news-content { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.news-tag { align-self: flex-start; background: rgba(212, 175, 55, 0.15); color: var(--accent); padding: 5px 15px; border-radius: 20px; font-size: 0.75rem; font-weight: bold; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.5px;}
.news-title { font-size: 1.2rem; color: var(--text-main); margin-bottom: 10px; line-height: 1.5; font-weight: 800; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-excerpt { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex-grow: 1; }
.news-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: var(--text-muted); border-top: 1px solid var(--bg-element); padding-top: 15px; font-weight: 600; }
.read-more-btn { color: var(--primary); font-weight: bold; display: flex; align-items: center; gap: 6px; transition: 0.3s; }
.news-card:hover .read-more-btn { color: var(--accent); }
html[dir="rtl"] .read-more-btn i { transform: scaleX(-1); }

/* ==========================================================================
   بخش ۱۱: دایرکتوری‌های ماژولار (مساجد، حلال، فرهنگی، خیرین)
   (توجه: فیلترهای هر بخش حذف شد تا فقط از سرچ گلوبال استفاده شود)
   ========================================================================== */
.dir-section-wrapper { position: relative; z-index: 5; transition: opacity 0.5s ease; }

.dir-capsules-container { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 20px; }
.dir-capsule { display: flex; align-items: center; background: var(--bg-card); padding: 8px 20px 8px 8px; border-radius: 50px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); cursor: pointer; border: 1px solid rgba(0,0,0,0.03); transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); width: calc(33.333% - 10px); min-width: 280px; }
html[dir="rtl"] .dir-capsule { padding: 8px 8px 8px 20px; }
body.dark-mode .dir-capsule { border-color: rgba(255,255,255,0.05); }
.dir-capsule:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 10px 25px rgba(27, 94, 32, 0.15); border-color: var(--accent); }
.dir-cap-logo { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; margin-inline-end: 15px; border: 2px solid var(--bg-element); box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.dir-cap-info { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.dir-cap-name { font-size: 1rem; font-weight: 800; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.dir-cap-address { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.section-header .slider-nav-btns { display: flex; gap: 10px; margin-left: auto; }
html[dir="rtl"] .section-header .slider-nav-btns { margin-left: 0; margin-right: auto; }
.nav-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--bg-element); color: var(--text-main); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.3s; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.nav-btn:hover { background: var(--accent); color: white; border-color: var(--accent); transform: scale(1.1); }

.dir-post-slider { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 20px; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.dir-post-slider::-webkit-scrollbar { display: none; }
.dir-slide-card { flex: 0 0 320px; scroll-snap-align: start; background: var(--bg-card); border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow); border: 1px solid transparent; transition: 0.3s; cursor: pointer; display: flex; flex-direction: column; }
.dir-slide-card:hover { transform: translateY(-7px); border-color: var(--accent); box-shadow: var(--shadow-hover); }

.dir-slide-img { width: 100%; height: 220px; position: relative; overflow: hidden; }
.dir-slide-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.dir-slide-card:hover .dir-slide-img img { transform: scale(1.08); }
.dir-slide-city { position: absolute; top: 15px; right: 15px; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); color: white; padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; border: 1px solid rgba(255,255,255,0.2); }
html[dir="rtl"] .dir-slide-city { right: auto; left: 15px; }

.dir-slide-content { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.dir-slide-title { font-size: 1.15rem; font-weight: 800; color: var(--text-main); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.dir-slide-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 15px; flex-grow: 1; }
.dir-slide-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--bg-element); padding-top: 15px; }
.dir-slide-footer-btn { color: var(--primary); font-weight: bold; font-size: 0.9rem; display: flex; align-items: center; gap: 5px; }
.dir-slide-card:hover .dir-slide-footer-btn { color: var(--accent); }

/* ==========================================================================
   بخش ۱۲: بخش ویدیوها و لیست پخش (Video Section)
   ========================================================================== */
.video-wrapper { max-width: 1250px; margin: 0 auto 70px; padding: 30px; display: grid; grid-template-columns: 1.8fr 1fr; gap: 30px; background: var(--bg-card); border-radius: 30px; box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.03); }
.video-player-box { background: #000; border-radius: 20px; min-height: 400px; position: relative; overflow: hidden; display: block; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.video-thumbnail-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; cursor: pointer; }
.video-thumbnail-container img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.video-thumbnail-container:hover img { transform: scale(1.05); }
.play-button-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 80px; height: 80px; background: rgba(188, 0, 45, 0.9); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 35px; box-shadow: 0 0 20px rgba(0,0,0,0.3); transition: all 0.3s; z-index: 2; padding-left: 5px; }
.video-thumbnail-container:hover .play-button-overlay { background: #ff0000; transform: translate(-50%, -50%) scale(1.1); }
.playlist-sidebar { display: flex; flex-direction: column; height: 400px; }
.playlist-header { padding-bottom: 15px; margin-bottom: 15px; border-bottom: 2px solid var(--bg-element); display: flex; justify-content: space-between; align-items: center; }
.playlist-header h3 { font-size: 1.1rem; color: var(--primary); font-weight: 700; margin: 0; }
.playlist-badge { background: var(--accent); color: white; padding: 2px 10px; border-radius: 20px; font-size: 0.75rem; }
.playlist-items-container { flex-grow: 1; overflow-y: auto; padding-right: 5px; scrollbar-width: thin; scrollbar-color: var(--accent) var(--bg-element); }
.playlist-items-container::-webkit-scrollbar { width: 6px; }
.playlist-items-container::-webkit-scrollbar-thumb { background-color: var(--accent); border-radius: 10px; }
.playlist-item { display: flex; gap: 15px; padding: 12px; margin-bottom: 10px; background: var(--bg-element); border-radius: 12px; cursor: pointer; transition: 0.3s; border: 1px solid transparent; align-items: center; }
.playlist-item:hover, .playlist-item.active { background: white; border-color: var(--accent); transform: translateX(5px); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
body.dark-mode .playlist-item:hover h4, body.dark-mode .playlist-item.active h4 { color: #2196F3 !important; }
body.dark-mode .playlist-item:hover p, body.dark-mode .playlist-item.active p { color: #666 !important; }
.playlist-thumb { width: 80px; height: 60px; border-radius: 8px; overflow: hidden; flex-shrink: 0; position: relative; }
.playlist-info { display: flex; flex-direction: column; justify-content: center; }
.playlist-info h4 { font-size: 0.9rem; margin: 0 0 5px; color: var(--text-main); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.playlist-info p { font-size: 0.75rem; color: var(--text-muted); margin: 0; }

/* ==========================================================================
   بخش ۱۳: پلیر صوتی چسبیده پایین صفحه (Sticky Player)
   ========================================================================== */
.sticky-player { position: fixed; bottom: 0; left: 0; width: 100%; height: 80px; background: var(--bg-card); border-top: 1px solid var(--accent); display: flex; align-items: center; justify-content: space-between; padding: 0 5%; padding-bottom: env(safe-area-inset-bottom); z-index: 5000; box-shadow: 0 -5px 20px rgba(0,0,0,0.1); height: calc(80px + env(safe-area-inset-bottom)); }
.player-info { display: flex; align-items: center; gap: 15px; }
.player-thumb { width: 50px; height: 50px; border-radius: 10px; }
.player-text h4 { font-size: 0.95rem; margin: 0; color: var(--text-main); }
.player-text span { font-size: 0.8rem; color: var(--text-muted); }
.player-controls { display: flex; align-items: center; gap: 20px; }
.p-btn { background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; padding: 10px; }
html[dir="rtl"] .fa-step-backward, html[dir="rtl"] .fa-step-forward { transform: scaleX(-1); }
.play-pause-main { width: 56px; height: 56px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; box-shadow: 0 4px 10px rgba(27, 94, 32, 0.3); }
.play-pause-main:hover { transform: scale(1.1); background: var(--accent); }

/* ==========================================================================
   بخش ۱۴: پنجره‌های پاپ‌آپ و مودال (Modals - News & Directory)
   ========================================================================== */
.news-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); z-index: 9998; opacity: 0; visibility: hidden; transition: 0.3s ease; }

.news-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -45%) scale(0.95); width: 90%; max-width: 850px; height: 88vh; background: var(--bg-body); border-radius: 30px; z-index: 9999; opacity: 0; visibility: hidden; transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 25px 60px rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.05); }
.news-modal.show, .news-modal-overlay.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.news-modal-overlay.show { transform: none; }
.news-modal-close { position: absolute; top: 20px; right: 20px; width: 45px; height: 45px; background: rgba(0,0,0,0.4); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10000; font-size: 1.4rem; transition: 0.3s; backdrop-filter: blur(4px); }
html[dir="rtl"] .news-modal-close { right: auto; left: 20px; }
.news-modal-close:hover { background: var(--japanese-red); transform: rotate(90deg) scale(1.1); }
.news-modal-scroll { overflow-y: auto; flex-grow: 1; scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
.news-modal-scroll::-webkit-scrollbar { width: 6px; }
.news-modal-scroll::-webkit-scrollbar-thumb { background-color: var(--accent); border-radius: 10px; }

/* 14.1 News Modal */
.modal-hero-img { width: 100%; height: 350px; object-fit: cover; }
.modal-content-wrap { padding: 40px; background: var(--bg-card); border-radius: 30px 30px 0 0; margin-top: -30px; position: relative; box-shadow: 0 -10px 20px rgba(0,0,0,0.05); padding-bottom: calc(50px + env(safe-area-inset-bottom)); }
.modal-title { font-size: 2rem; color: var(--text-main); margin-bottom: 10px; line-height: 1.4; font-weight: 900; }
.modal-subtitle { font-size: 1.2rem; color: var(--text-muted); font-weight: 400; margin-bottom: 25px; line-height: 1.5; }
.modal-meta-bar { display: flex; flex-wrap: wrap; gap: 20px; padding: 15px 20px; background: var(--bg-element); border-radius: 15px; margin-bottom: 30px; font-size: 0.95rem; color: var(--text-muted); align-items: center; border-left: 4px solid var(--accent); }
.modal-meta-item b { color: var(--text-main); margin-inline-start: 5px; }
.modal-body { font-size: 1.05rem; line-height: 1.9; color: var(--text-main); margin-bottom: 40px; }
.modal-body p { margin-bottom: 20px; }
.modal-share-section { margin-bottom: 40px; border-top: 2px dashed var(--bg-element); padding-top: 30px; }
.modal-share-section h4 { margin-bottom: 15px; color: var(--text-main); font-size: 1.1rem; }
.share-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.share-btn { width: 45px; height: 45px; border-radius: 12px; border: none; display: flex; align-items: center; justify-content: center; color: white; cursor: pointer; font-size: 1.2rem; transition: 0.3s; }
.share-btn.twitter { background: #1DA1F2; } .share-btn.facebook { background: #4267B2; } .share-btn.whatsapp { background: #25D366; } .share-btn.copy { background: var(--text-muted); }
.share-btn:hover { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0,0,0,0.2); }
.modal-comments-section { background: var(--bg-element); padding: 35px; border-radius: 20px; border: 1px solid rgba(0,0,0,0.03); }
body.dark-mode .modal-comments-section { border-color: rgba(255,255,255,0.05); }
.modal-comments-section h3 { margin-bottom: 25px; color: var(--text-main); display: flex; align-items: center; gap: 10px; }
.modal-comments-section h3::before { content: ''; display: block; width: 5px; height: 20px; background: var(--accent); border-radius: 5px; }
.comment-form { display: flex; flex-direction: column; gap: 15px; }
.comment-form input, .comment-form textarea { width: 100%; padding: 18px; border-radius: 15px; border: 1px solid rgba(0,0,0,0.08); background: var(--bg-card); color: var(--text-main); font-family: inherit; font-size: 1rem; resize: vertical; transition: 0.3s; outline: none; }
body.dark-mode .comment-form input, body.dark-mode .comment-form textarea { border-color: rgba(255,255,255,0.08); }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1); }
.submit-comment-btn { background: var(--primary); color: white; border: none; padding: 18px; border-radius: 15px; font-weight: bold; font-size: 1.1rem; cursor: pointer; transition: 0.3s; }
.submit-comment-btn:hover { background: var(--accent); color: var(--text-main); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3); }

/* 14.2 Unified Directory Modal (Mosques, Centers, Halal, Charity) */
.dir-modal-header { position: relative; height: 350px; width: 100%; }
.dir-hero-img { width: 100%; height: 100%; object-fit: cover; }
.dir-hero-gradient { position: absolute; bottom: 0; left: 0; width: 100%; height: 50%; background: linear-gradient(to top, var(--bg-card), transparent); }
.dir-logo-img { position: absolute; bottom: -30px; left: 40px; width: 100px; height: 100px; border-radius: 50%; border: 5px solid var(--bg-card); object-fit: cover; box-shadow: 0 5px 20px rgba(0,0,0,0.2); background: white; z-index: 10; }
html[dir="rtl"] .dir-logo-img { left: auto; right: 40px; }

.dir-content-wrap { margin-top: 0; padding-top: 50px; border-radius: 0; box-shadow: none; padding-bottom: calc(50px + env(safe-area-inset-bottom)); }
.dir-city-badge { display: inline-flex; align-items: center; gap: 5px; background: rgba(212, 175, 55, 0.15); color: var(--accent); padding: 5px 15px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; margin-bottom: 10px; }
.dir-title { font-size: 2.2rem; margin-bottom: 20px; }
.dir-address-box { display: flex; align-items: center; gap: 15px; background: var(--bg-element); padding: 15px 20px; border-radius: 15px; margin-bottom: 20px; border-left: 4px solid var(--primary); }
html[dir="rtl"] .dir-address-box { border-left: none; border-right: 4px solid var(--primary); }
.dir-address-box i { font-size: 1.5rem; color: var(--primary); }

.dir-map-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: #4285F4; color: white !important; padding: 12px 25px; border-radius: 12px; font-weight: bold; text-decoration: none; margin-bottom: 30px; transition: 0.3s; box-shadow: 0 5px 15px rgba(66, 133, 244, 0.3); }
.dir-map-btn:hover { background: #3367D6; transform: translateY(-3px); box-shadow: 0 8px 20px rgba(66, 133, 244, 0.4); }

.dir-desc-container { position: relative; }
.dir-desc-text { font-size: 1.05rem; line-height: 1.9; color: var(--text-main); margin-bottom: 20px; max-height: 100px; overflow: hidden; transition: max-height 0.5s ease; position: relative; }
.dir-desc-text::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 50px; background: linear-gradient(to top, var(--bg-card), transparent); transition: opacity 0.3s; }
.dir-desc-container.expanded .dir-desc-text { max-height: 2000px; }
.dir-desc-container.expanded .dir-desc-text::after { opacity: 0; pointer-events: none; }

.dir-read-more-btn { background: none; border: 2px dashed var(--accent); color: var(--accent); padding: 10px 20px; border-radius: 50px; cursor: pointer; font-weight: bold; display: flex; align-items: center; gap: 8px; margin: 0 auto; transition: 0.3s; }
.dir-read-more-btn:hover { background: var(--accent); color: white; }
.dir-desc-container.expanded .dir-read-more-btn i { transform: rotate(180deg); }

/* ==========================================================================
   بخش ۱۵: رسپانسیو و حالت موبایل (Mobile Responsive Design)
   ========================================================================== */
@media (max-width: 900px) {
    .header-wrapper { background: var(--bg-body) !important; box-shadow: none !important; border: none !important; border-radius: 0 !important; margin: 0 !important; width: 100% !important; max-width: none !important; padding: 0 20px !important; position: relative !important; top: 0 !important; height: 60px !important; z-index: 1000 !important; display: flex; align-items: center; justify-content: space-between; backdrop-filter: none !important; }
    .nav-section { display: none; }
    .mobile-header-btn { display: flex !important; width: 44px; height: 44px; background: var(--bg-element); border-radius: 50%; box-shadow: 2px 2px 5px rgba(0,0,0,0.05), -2px -2px 5px rgba(255,255,255,0.5); color: var(--primary); font-size: 1.2rem; justify-content: center; align-items: center; border: 1px solid rgba(0,0,0,0.02); }
    .mobile-header-btn:active { transform: scale(0.9); box-shadow: inset 1px 1px 3px rgba(0,0,0,0.1); }
    
    #master-logo-section { width: 85px !important; height: 85px !important; top: 20px !important; margin: 0 !important; box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important; border-radius: 50% !important; background: var(--bg-card) !important; overflow: hidden !important; border: 3px solid var(--bg-body) !important; z-index: 1003 !important; }
    #master-logo-section .logo-img { width: 100% !important; height: 100% !important; }
    #master-logo-section .logo-text { display: none !important; }

    .top-info-bar { z-index: 2000; position: relative; width: 100%; background: transparent !important; border-bottom: none !important; box-shadow: none !important; padding: 10px 20px !important; color: var(--text-muted) !important; display: flex !important; justify-content: space-between !important; height: 45px; text-shadow: none; top: 0 !important; left: 0 !important; pointer-events: auto !important; }
    .prayer-times, #currentDate, #currentTime, .control-btn, .lang-selector { color: var(--text-main) !important; }
    .prayer-badge { background: var(--bg-element) !important; color: var(--primary) !important; }
    .prayer-times { font-size: 0.8rem; gap: 8px; flex-wrap: nowrap !important; }
    .prayer-times i, #nextPrayerInfo, #countdownContainer { display: none; } 
    .left-controls { gap: 15px !important; width: auto !important; margin-top: 0 !important; border: none !important; padding: 0 !important; justify-content: flex-end !important; }
    .left-controls .control-btn { display: flex !important; background: var(--bg-element) !important; width: 32px !important; height: 32px !important; } 
    #currentLangLabel { display: none !important; }
    .lang-selector i { font-size: 1.2rem; }

    .hero-slider-section { margin-top: 0; height: 500px; padding-top: 0; } 
    .hero-slider-section::before { display: none !important; }
    html[lang="ja"] .hero-content { padding-top: 40px; }
    
    .video-wrapper { grid-template-columns: 1fr; padding: 15px; gap: 20px; border-radius: 20px; }
    .video-player-box { min-height: 250px; border-radius: 15px; } 
    .playlist-sidebar { height: 350px; } 
    
    .prayer-full-section { margin-bottom: 40px; }
    .prayer-controls { flex-direction: column; align-items: stretch; gap: 15px; padding: 15px; }
    .custom-select { max-width: none; width: 100%; }
    .audio-toggle-btn { justify-content: center; width: 100%; }
    .prayer-cards-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .prayer-time-card { padding: 15px 5px; min-height: 120px; }
    .p-icon { font-size: 1.4rem; margin-bottom: 5px; }
    .p-time { font-size: 1.2rem; }
    
    .quick-access-bar { gap: 10px; margin-top: -30px; padding: 0 10px; }
    .qa-item { flex: 1 1 40%; min-width: auto; padding: 15px 10px; font-size: 0.8rem; }
    
    .dir-capsule { width: 100%; }
    
    .sticky-player { padding: 0 15px; height: calc(70px + env(safe-area-inset-bottom)); }
    .player-text { display: none; } 
    .mobile-only-player-text { display: block; font-size: 0.75rem; position: absolute; top: -20px; left: 0; width: 100%; background: var(--accent); color: var(--primary); text-align: center; padding: 3px; font-weight: bold; border-radius: 5px 5px 0 0; }

    /* Modals Response for Mobile */
    .news-modal { width: 100%; height: 100dvh; top: 0; left: 0; transform: translateY(100%); border-radius: 0; max-width: none; }
    .news-modal.show { transform: translateY(0); }
    .news-modal-close { top: 15px; right: 15px; background: rgba(0,0,0,0.6); }
    html[dir="rtl"] .news-modal-close { right: auto; left: 15px; }
    
    .modal-hero-img { height: 280px; }
    .modal-content-wrap { padding: 25px 20px; border-radius: 25px 25px 0 0; margin-top: -25px; padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
    .modal-title { font-size: 1.6rem; }
    .modal-meta-bar { flex-direction: column; align-items: flex-start; gap: 10px; padding: 15px; }
    .modal-comments-section { padding: 25px 20px; }

    .dir-modal-header { height: 250px; }
    .dir-logo-img { width: 80px; height: 80px; bottom: -25px; left: 20px; }
    html[dir="rtl"] .dir-logo-img { left: auto; right: 20px; }
    .dir-content-wrap { padding-top: 40px; padding-left: 20px; padding-right: 20px; padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
    .dir-title { font-size: 1.6rem; }
    .dir-address-box { flex-direction: column; align-items: flex-start; }
}
/* ==========================================================================
   بخش ۱۶: انیمیشن لودینگ تنبل (Lazy Load Skeleton Shimmer)
   ========================================================================== */
.lazy-section { min-height: 200px; position: relative; transition: opacity 0.5s ease; }
/* وقتی در حال لود است محتوای اصلی را مخفی کن */
.lazy-section.is-loading > div:not(.section-header) { display: none !important; }
/* اسکلت لودینگ نوری */
.lazy-section.is-loading::after {
    content: ''; position: absolute; top: 80px; left: 0; right: 0; height: 150px;
    background: linear-gradient(90deg, var(--bg-element) 25%, var(--bg-card) 50%, var(--bg-element) 75%);
    background-size: 200% 100%; animation: shimmer 1.5s infinite linear; border-radius: var(--radius-card);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }


/* ==========================================================================
   بخش ۱۷: جدول پخش برنامه‌ها (Schedule Conductor - Modern UI)
   ========================================================================== */
.schedule-section-wrapper { position: relative; z-index: 5; }

.schedule-timeline-container {
    background: var(--bg-card); border-radius: var(--radius-card); padding: 40px 20px;
    box-shadow: var(--shadow); overflow-x: auto; position: relative;
    /* پنهان کردن کامل اسکرول بار */
    scrollbar-width: none; 
    -ms-overflow-style: none; 
    -webkit-overflow-scrolling: touch; scroll-behavior: smooth;
}
.schedule-timeline-container::-webkit-scrollbar { display: none; }

/* خط زمان پس‌زمینه کپسولی و ضخیم
*/
.schedule-track { 
    display: flex; position: relative; gap: 10px; min-width: max-content; 
    align-items: flex-start; padding-top: 15px; 
}

/* این کلاس محاسبات دقیق ریاضی برای وسط بودن و عدم بیرون‌زدگی دارد */
.schedule-track::before {
    content: ''; 
    position: absolute; 
    top: 57px; /* عبور میلی‌متری از مرکز دایره */
    left: 80px; /* شروع دقیق از مرکز اولین دایره (بدون بیرون‌زدگی) */
    right: 80px; /* پایان دقیق در مرکز آخرین دایره (بدون بیرون‌زدگی) */
    height: 8px; /* ضخامت خط زمان */
    background: var(--bg-element); 
    border-radius: 50px; 
    z-index: 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

/* کارت هر برنامه */
.sch-item {
    position: relative; z-index: 1; 
    width: 160px; /* عرض ثابت هر برنامه */
    flex-shrink: 0;
    display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: 0.3s;
}

/* استایل برنامه‌های گذشته (کمرنگ شده) */
.sch-item.past-program { opacity: 0.35; filter: grayscale(100%); }
.sch-item.past-program:hover { opacity: 0.8; filter: grayscale(50%); transform: translateY(-3px); }

/* نقطه و زمان روی خط */
.sch-time-txt { 
    font-size: 1.15rem; font-weight: 900; color: var(--text-main); 
    font-family: 'Vazirmatn', sans-serif; transition: 0.3s; 
    height: 26px; line-height: 26px; margin-bottom: 8px; /* ارتفاع ثابت برای محاسبه وسط */
}

.sch-time-node {
    width: 24px; height: 24px; background: var(--bg-card); border: 5px solid var(--text-muted);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin-bottom: 15px; transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sch-title { font-size: 0.95rem; font-weight: bold; color: var(--text-main); text-align: center; line-height: 1.5; transition: 0.3s; padding: 0 10px;}

/* افکت هاور روی برنامه‌های آینده و در حال پخش */
.sch-item:hover .sch-time-node { border-color: var(--accent); transform: scale(1.3); box-shadow: 0 0 15px rgba(212, 175, 55, 0.3); }
.sch-item:hover .sch-time-txt, .sch-item:hover .sch-title { color: var(--accent); }

/* حالت در حال پخش (Now Playing) */
.sch-item.now-playing { transform: scale(1.05); }
.sch-item.now-playing .sch-time-node {
    border-color: var(--japanese-red); background: var(--japanese-red);
    box-shadow: 0 0 0 6px rgba(188, 0, 45, 0.2); animation: pulse-red 2s infinite; transform: scale(1.2);
}
.sch-item.now-playing .sch-time-txt { color: var(--japanese-red); }
.sch-item.now-playing .sch-title { color: var(--japanese-red); }

.sch-now-badge {
    background: var(--japanese-red); color: white; font-size: 0.75rem; font-weight: bold;
    padding: 4px 12px; border-radius: 20px; margin-top: 10px; animation: blink-soft 2s infinite;
}

/* استایل ردیف‌های داخل پاپ‌آپ */
.sch-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; margin-bottom: 10px; border-bottom: 1px dashed var(--bg-element); padding-bottom: 10px; }
.sch-row span.right { color: var(--text-muted); font-weight: 600; }
.sch-row span.left { color: var(--text-main); font-weight: 900; font-family: 'Vazirmatn', sans-serif; font-size: 1.1rem; direction: ltr; }


/* ==================== استایل‌های پلیر مدرن هوشمند ==================== */
.smart-sticky-player {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    width: 95%; max-width: 550px; background: rgba(22, 33, 27, 0.95);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--accent); border-radius: 30px; 
    display: flex; align-items: center; padding: 10px 15px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5); z-index: 3000; gap: 15px;
    transition: 0.4s;
}
body:not(.dark-mode) .smart-sticky-player { background: rgba(255, 255, 255, 0.95); }

.sp-cover-box { position: relative; width: 60px; height: 60px; border-radius: 20px; overflow: hidden; flex-shrink: 0; }
.sp-cover-box img { width: 100%; height: 100%; object-fit: cover; }
.sp-badge { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: 0.6rem; font-weight: bold; color: white; padding: 2px 0; }
.live-badge { background: var(--japanese-red); animation: pulseBg 2s infinite; }
.auto-badge { background: var(--emerald); }
@keyframes pulseBg { 0% { opacity: 0.8; } 50% { opacity: 1; } 100% { opacity: 0.8; } }

.sp-info { flex-grow: 1; overflow: hidden; white-space: nowrap; }
.sp-info h4 { color: var(--text-main); font-size: 1.05rem; margin: 0; text-overflow: ellipsis; overflow: hidden; }
.sp-info span { color: var(--text-muted); font-size: 0.8rem; }

.sp-controls { flex-shrink: 0; display: flex; align-items: center; gap: 15px; }
.sp-btn.play-btn { width: 50px; height: 50px; border-radius: 50%; background: var(--primary); color: white; border: none; font-size: 1.2rem; cursor: pointer; transition: 0.3s; box-shadow: 0 4px 15px rgba(27, 94, 32, 0.4); display: flex; align-items: center; justify-content: center; }
.sp-btn.play-btn:hover { background: var(--accent); color: var(--bg-card); transform: scale(1.05); }

/* اکولایزر انیمیشنی */
.equalizer { display: flex; align-items: flex-end; gap: 3px; height: 25px; margin-right: 10px; }
.eq-bar { width: 4px; background: var(--accent); border-radius: 2px; animation: eq-play 0.5s infinite alternate; }
.eq-bar:nth-child(2) { animation-delay: 0.1s; }
.eq-bar:nth-child(3) { animation-delay: 0.2s; }
.eq-bar:nth-child(4) { animation-delay: 0.3s; }
.eq-bar:nth-child(5) { animation-delay: 0.4s; }
.equalizer.paused .eq-bar { animation-play-state: paused; height: 4px; }
@keyframes eq-play { 0% { height: 4px; } 100% { height: 25px; } }

/* دکمه پنل ادمین */
.btn-admin-panel {
    background: linear-gradient(135deg, #c0392b, #8e44ad); color: white;
    border: none; padding: 12px; border-radius: 15px; width: 100%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    gap: 8px; font-weight: bold; transition: 0.3s; box-shadow: 0 4px 15px rgba(192, 57, 43, 0.4);
}
.btn-admin-panel:hover { filter: brightness(1.2); }



/* ============ بخش جدید: کارت تبلیغاتی مدرن (Promo Card)============== */

.promo-card-section {
    margin: 40px auto 60px;
    max-width: 1000px;
    padding: 0 20px;
}

.promo-card {
    position: relative;
    border-radius: 40px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 25px 50px -8px rgba(0,0,0,0.3);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    background: linear-gradient(135deg, var(--primary), #0a3b0e);
}

.promo-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 35px 60px -10px rgba(212, 175, 55, 0.5);
}

.promo-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1575883259974-9c3f3f3b060f?q=80&w=1920&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    opacity: 0.2;
    mix-blend-mode: overlay;
    transition: transform 0.5s ease;
}

.promo-card:hover .promo-bg {
    transform: scale(1.1);
}

.promo-content {
    position: relative;
    z-index: 2;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    backdrop-filter: blur(2px);
}

.promo-icon {
    width: 90px;
    height: 90px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 25px;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transition: 0.3s;
}

.promo-card:hover .promo-icon {
    transform: rotate(5deg) scale(1.1);
    background: var(--accent);
    color: var(--primary);
    border-color: white;
}

.promo-title {
    font-size: 2.8rem;
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

.promo-desc {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
    max-width: 600px;
    line-height: 1.6;
    font-weight: 300;
}

.promo-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent);
    color: var(--primary);
    padding: 16px 40px;
    border-radius: 60px;
    font-weight: 800;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    transition: 0.3s;
    border: 1px solid rgba(255,255,255,0.3);
}

.promo-btn i {
    transition: transform 0.3s ease;
}

.promo-card:hover .promo-btn {
    background: white;
    color: var(--primary);
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.5);
}

.promo-card:hover .promo-btn i {
    transform: translateX(5px);
}

html[dir="rtl"] .promo-card:hover .promo-btn i {
    transform: translateX(-5px);
}

/* موبایل */
@media (max-width: 900px) {
    .promo-card-section {
        margin: 20px auto 40px;
    }
    .promo-content {
        padding: 40px 20px;
    }
    .promo-icon {
        width: 70px;
        height: 70px;
        font-size: 2.2rem;
    }
    .promo-title {
        font-size: 2rem;
    }
    .promo-desc {
        font-size: 1rem;
    }
    .promo-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
}


/* ==========================================================================
   بخش ۱۸: فوتر سایت (Social Icons & Copyright)
   ========================================================================== */
.site-footer {
    background: var(--bg-card);
    border-top: 2px solid var(--accent);
    padding: 40px 20px 30px;
    margin-top: 60px;
    text-align: center;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
}

.footer-social {
    display: flex;
    flex-wrap: nowrap;          /* جلوگیری از رفتن به خط بعد */
    justify-content: center;
    gap: clamp(5px, 2vw, 15px); /* فاصله واکنش‌گرا */
    margin-bottom: 25px;
    overflow-x: auto;            /* در صورت لزوم اسکرول افقی (اختیاری) */
    padding: 0 10px;             /* کمی فاصله از لبه‌ها */
    -webkit-overflow-scrolling: touch; /* اسکرول نرم در iOS */
}

.social-icon {
    flex-shrink: 0;              /* جلوگیری از کوچک‌شدن بیش از حد آیکون‌ها */
    width: clamp(35px, 8vw, 50px);
    height: clamp(35px, 8vw, 50px);
    border-radius: 50%;
    background: var(--bg-element);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-size: clamp(1rem, 4vw, 1.4rem);
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 1px solid rgba(212,175,55,0.2);
}

.social-icon:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 20px rgba(212,175,55,0.3);
    border-color: transparent;
}

.footer-copyright p {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   بخش ۱۹: بنر تبلیغاتی ( پشتیبانی از تصویر)
   ========================================================================== */
.promo-banner-section {
    margin: 40px auto 60px;
    max-width: 1250px;
    padding: 0 20px;
}

.promo-banner-card {
    position: relative;
    height: 300px;
    border-radius: 40px;
    overflow: hidden;
    background: linear-gradient(135deg, #1B5E20, #0a3b0e);
    box-shadow: 0 25px 50px -8px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    border: 1px solid rgba(212,175,55,0.3);
}

/* تصویر بنر (در صورت وجود) */
.banner-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    display: block; /* اگر src خالی باشد، با onerror مخفی می‌شود */
}

.banner-image[src=""],
.banner-image:not([src]) {
    display: none; /* اگر src خالی یا وجود نداشته باشد، مخفی کن */
}

.banner-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.5) 100%);
    z-index: 1;
    pointer-events: none;
}

.banner-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    animation: fadeInUp 1s ease;
}

.banner-icon {
    font-size: 5rem;
    color: var(--accent);
    margin-bottom: 20px;
    filter: drop-shadow(0 5px 15px rgba(212,175,55,0.5));
    animation: float 3s infinite ease-in-out;
}

.banner-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 10px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

.banner-text {
    font-size: 1.4rem;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
    font-weight: 300;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
    padding: 8px 20px;
    border-radius: 50px;
    display: inline-block;
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* موبایل */
@media (max-width: 900px) {
    .promo-banner-card {
        height: 250px;
        border-radius: 30px;
    }
    .banner-icon {
        font-size: 4rem;
        margin-bottom: 10px;
    }
    .banner-title {
        font-size: 2.2rem;
    }
    .banner-text {
        font-size: 1.1rem;
        padding: 6px 15px;
    }
}
/* ==========================================================================
   بخش ۲۰: فلش‌های کناری سلایدر (دایرکتوری)
   ========================================================================== */
.dir-slider-wrapper {
    position: relative;
    margin-top: 20px;
}

.dir-post-slider {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.dir-post-slider::-webkit-scrollbar {
    display: none;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--accent);
    color: var(--accent);
    display: none; /* initially hidden, shown via JS */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.slider-arrow:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.slider-arrow.left {
    left: -20px;
}

.slider-arrow.right {
    right: -20px;
}

/* نمایش فلش‌ها در موبایل با فاصله کمتر */
@media (max-width: 900px) {
    .slider-arrow.left {
        left: -10px;
    }
    .slider-arrow.right {
        right: -10px;
    }
    .slider-arrow {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

/* ==========================================================================
   به‌روزرسانی لوگو در موبایل (بر اساس radiojp20.html)
   ========================================================================== */
@media (max-width: 900px) {
    #master-logo-section {
        width: 85px !important;
        height: 85px !important;
        top: 50px !important; /* changed from 20px to 50px */
        border: 3px solid var(--bg-body) !important;
        /* بقیه ویژگی‌ها مانند قبل باقی می‌مانند */
    }
}
