/* ==== متغیرهای اصلی ==== */
:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --muted: #6b7280;
  --shadow: 0 6px 18px rgba(12,20,30,0.08);
}

/* ==== فونت IRLotus ==== */
@font-face {
  font-family: 'IRLotus';
  src: url('fa.jamalolhagh.ir/styles/fonts/irlotus/IRLotus.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* ==== ریست کلی ==== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'IRLotus', Tahoma, sans-serif !important;
}
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  direction: rtl;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}


/* ==== هدر موبایل ==== */
header.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
header.mobile-header video {
  width: 100%;
  max-width: 180px;
  border-radius: 8px;
  object-fit: cover;
}
.mobile-header .hamburger {
  position: absolute;
  right: 8px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.05);
}
.mobile-header .hamburger .bar {
  width: 18px;
  height: 2px;
  background: var(--muted);
  position: relative;
}
.mobile-header .hamburger .bar::before,
.mobile-header .hamburger .bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--muted);
}
.mobile-header .hamburger .bar::before { top: -5px; }
.mobile-header .hamburger .bar::after { top: 5px; }

/* ==== کشوی موبایل سمت راست ==== */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  display: none;
  z-index: 1100;
  align-items: flex-start;
}
.mobile-drawer.visible { display: flex; }
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1;
  cursor: pointer;
}
.drawer {
  position: relative;
  width: 160px;
  height: 100%;
  background: var(--card);
  padding: 20px;
  overflow: auto;
  box-shadow: -20px 0 50px rgba(0,0,0,0.2);
  z-index: 2;
}
.drawer .close {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.drawer a {
  display: block;
  padding: 12px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  color: #0b1a1a;
  text-decoration: none;
  font-weight: 700;
}
.drawer a.small {
  font-weight: 600;
  color: var(--muted);
  font-size: 14px;
}

/* ==== هدر دسکتاپ ==== */
/* ===== هدر دسکتاپ کل عرض و لوگوها ===== */
header.desktop-header {
    background-color: #ffffff;
    width: 100%;          /* کل عرض صفحه */
    border-bottom: 1px solid #ddd;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 3000;        /* بالاتر از سایدبار */
    padding: 10px 20px;
    text-align: center;
}

/* کانتینر هدر برای لوگوها و ویدیو */
.header-container {
    position: relative;
    text-align: center;
}

/* ویدیو وسط هدر */
header.desktop-header video {
    display: block;
    margin: 0 auto;
    width: 50%;
    max-width: 190px;
    border-radius: 30px;
}

/* ===== سایدبار دسکتاپ ===== */
.sidebar {
  width: 120px;
  background-color: #006400;
  color: white;
  height: 100vh;
  position: fixed;
  top: 0;
  right: 0;
  padding-top: 20px; /* فاصله داخلی بالا */
  z-index: 2000;     /* زیر هدر و فوتر */
}

/* ===== فوتر دسکتاپ ===== */
footer.desktop-footer {
    background-color: #ffffff;
    width: 100%;
    border-top: 1px solid #ddd;
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 3000;        /* بالاتر از سایدبار */
    padding: 10px 20px;
    text-align: center;
}
.footer-links a {
    background:#006400;
    color:#fff;
    text-decoration:none;
    padding:50px 80px; /* اندازه اولیه */
    border-radius:30px;
    font-weight:900;
    font-size:36px;
    transition: all 0.3s ease;
    display:inline-block;
}

/* حالت برجسته هنگام اسکرول */
.footer-links a.scrolled {
    transform: scale(1.15);          /* کمی بزرگ‌تر */
    box-shadow: 0 15px 40px rgba(0,0,0,0.5); /* برجسته شدن */
}

/* ==== ریسپانسیو دکمه‌های تماس و درباره ما (موبایل سبک‌تر) ==== */
@media (max-width: 768px) {
  .footer-links {
    flex-direction: column;      /* زیر هم */
    align-items: center;
    gap: 15px;
    margin: 30px 0;
  }

  .footer-links a {
    width: 80%;                  /* نه تمام عرض */
    justify-content: center;
    padding: 14px 0;             /* ارتفاع کمتر */
    font-size: 18px;             /* فونت کوچکتر */
    border-radius: 15px;
    font-weight: 700;
  }

  .footer-links a img {
    width: 22px;
    height: 22px;
  }
}


/* لوگوی سمت راست */
#header-logo-bg {
    width: 100px;
    height: 80px;
    background-image: url('https://fa.jamalolhagh.ir/files/images/logos/logo-1.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    cursor: pointer;
    transition: all 0.5s ease-in-out;
}

/* لوگوی بزرگ وسط صفحه */
#header-logo-bg.large {
    width: 280px;
    height: 150px;
    top: 150px;
    right: calc(50% - 390px);
}

/* ==== سایدبار دسکتاپ ==== */
.sidebar {
  width: 120px;
  background-color: #006400;
  color: white;
  height: 100vh;
  position: fixed;
  top: 0;
  right: 0;
  padding-top: 20px; /* فاصله داخلی بالا */
  z-index: 2000;     /* زیر هدر */
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: center;
}

/* فاصله لینک اول زیر هدر */
@media (min-width: 768px) {
    .sidebar ul li:first-child {
        margin-top: 50px; /* ارتفاع هدر دسکتاپ */
    }
}

/* فاصله بین لینک‌ها */
.sidebar ul li {
  margin: 15px 0;
}

.sidebar ul li a {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  transition: background 0.3s;
  font-size: 18px;
}

.sidebar ul li a:hover {
  background-color: #228B22;
  border-radius: 6px;
}

.sidebar ul li a img {
  width: 33px;
  height: auto;
  margin-left: 5px;
  flex-shrink: 0;
}

/* ==== ریسپانسیو موبایل ==== */
@media (max-width: 768px) {
    .sidebar {
        display: none !important; /* پنهان کردن در موبایل */
    }
}


/* ==== محتوای اصلی ==== */
.content {
  margin-right: 120px;
  padding-top: 80px;
  flex: 1;
  background-image: url('https://fa.jamalolhagh.ir/files/images/backgrounds/background.jpg');
  background-repeat: repeat-y;
  background-size: 100% auto;
  background-position: top right;
  display: flex;
  flex-direction: column;
}

/* ==== بخش عکس بالای صفحه ==== */
.top-section {
  margin: 0;
  padding: 0;
  text-align: center;
}
.top-section img {
  display: block;
  width: 50%;
  height: auto;
  margin: 0 auto;
}

/* ==== کارت‌ها ==== */
.main-images {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
}
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}
.card {
  flex: 1 1 150px;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ==== فوتر ==== */
footer {
  text-align: center;
  padding: 10px;
  background: #f8f9fa;
  border-top: 1px solid #ddd;
  margin-top: auto;
}

/* ==== صفحه صوت ها ==== */
.accordion { margin-top: 20px; }
.accordion-item {
  margin-bottom: 10px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  overflow: hidden;
}
.accordion-header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: #f8f8f8;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
}
.accordion-header img {
  width: 20px;
  height: 20px;
  margin-left: 8px;
}
.accordion-header .arrow { margin-left: auto; }
.accordion-body {
  display: none;
  padding: 10px 16px;
  border-top: 1px solid #eee;
}
.audio-card {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px;
  background: #f9f9f9;
  border-radius: 6px;
}
.audio-card span { flex: 1; }
.audio-card .play-btn {
  margin-right: 10px;
  cursor: pointer;
  border: none;
  background: #4CAF50;
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
}
.progress-container {
  flex: 2;
  height: 5px;
  background: #ddd;
  border-radius: 2px;
  margin: 0 10px;
  cursor: pointer;
  position: relative;
}
.progress {
  width: 0;
  height: 100%;
  background: #4CAF50;
  border-radius: 2px;
}
.time { width: 50px; text-align: center; }
.audios-page h1 img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  vertical-align: middle;
  margin-left: 5px;
}
.download-btn {
  margin-left: 10px;
  text-decoration: none;
  background: #2196F3;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
}
.speed-select {
  margin-left: 10px;
  padding: 2px 5px;
}

/* ==== صفحه ویدیو ها ==== */
.videos-page h1 img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  vertical-align: middle;
  margin-left: 5px;
}
.aparat-video-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}
.aparat-video-card {
  flex: 1 1 240px;
  max-width: 240px;
  margin-bottom: 20px;
  padding: 12px;
  background: linear-gradient(145deg, #ffffff, #f3f3f3);
  border-radius: 12px;
  border: 1px solid #ddd;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
  text-align: center;
}
.aparat-video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.1);
}
.aparat-video-card span {
  display: block;
  font-weight: bold;
  margin: 8px 0;
  color: #333;
}
.h_iframe-aparat_embed_frame {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 60%;
  max-width: 240px;
  margin: 0 auto;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}
.h_iframe-aparat_embed_frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ==== اکاردئون عمومی ==== */
.accordion-header {
  width: 100%;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 12px 15px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.2s ease;
}
.accordion-header:hover { background: #f0f0f0; }
.accordion-header .arrow { transition: transform 0.3s ease; }
.accordion-body { margin-top: 10px; }
.accordion-header.active .arrow { transform: rotate(180deg); }

/* ==== ریسپانسیو ==== */
@media (min-width:768px) { header.mobile-header { display: none !important; } }
@media (max-width:767px) { header.desktop-header { display: none; } }

/* تبلت */
@media (max-width: 1024px) {
  .sidebar { width: 80px; }
  .content { margin-right: 80px; }
  header { width: calc(100% - 80px); right: 80px; padding: 8px 10px; }
  header video { width: 40%; max-width: 150px; }
  #header-logo-bg { width: 80px; height: 60px; right: 10px; }
  .sidebar ul li a { font-size: 16px; }
  .audio-card, .video-card, .aparat-video-card { padding: 8px; }
}

/* موبایل */
@media (max-width: 768px) {
  body { flex-direction: column; }
  .sidebar { display: none !important; }
  .content { margin-right: 0; padding-top: 120px; }
  header { width: 100%; right: 0; padding: 5px 10px; }
  header video { width: 60%; max-width: 120px; }
  #header-logo-bg { width: 60px; height: 50px; top: 10px; right: 10px; transform: none; }
  .aparat-video-row { flex-direction: column; gap: 10px; }
  .aparat-video-card { flex: 1 1 100%; max-width: 100%; }
}



/* ==== زنگوله اخبار ثابت و شناور ==== */
.news-bell {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: 60px;
    height: 60px;
    background: #006400;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 5000;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* تصویر زنگوله */
.news-bell img {
    width: 32px;
    height: 32px;
}

/* نشان کوچک قرمز برای اخبار جدید */
.news-bell .news-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    background: red;
    border-radius: 50%;
    display: none; /* JS فعال می‌کند */
    box-shadow: 0 0 3px rgba(0,0,0,0.5);
}

/* افکت هاور */
.news-bell:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* انیمیشن کم تکان زدن */
@keyframes subtle-ring {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    50% { transform: rotate(-3deg); }
    75% { transform: rotate(5deg); }
    100% { transform: rotate(0deg); }
}

.news-bell.ring {
    animation: subtle-ring 0.8s ease-in-out 1;
}

/* انیمیشن نشانه خبری (قرمز) چشمک زن */
@keyframes news-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.news-bell .news-badge.active {
    display: block;
    animation: news-blink 1s infinite;
}
