:root {
  --top-bar-bg: LightGray;
  --panel-bg: LightGray ;
  --icon: #1f890564;
  --icon-hover: #079436;
  --text: #535151e5;
  --top-height: 100px;
  --panel-width: 300px;
  --pad-l: 18px;
  --pad-r: 80px;
  --submenu-font-size: 16px;
  --submenu-padding: 6px 12px;
  /* ...بقیه متغیرها... */
  --file-width: 225px;   /* ← عرض قاب — دلخواه تنظیم کن */
  --file-height: 150px;  /* ← ارتفاع قاب — دلخواه تنظیم کن */
    --file-gap: 12px;      /* ← فاصلهٔ دلخواه افقی */
      --files-offset-right: 50px; /* ← این خط جدید */
      
   --files-offset-top: 128px;   /* ← فاصله جدید از بالا */

}

html, body {
  margin: 0;
  height: 100%;
  font-family: tahoma;
  overflow-x: hidden;
  background-color: #f5f5f5;
}
.panel-site-link {
  display: block;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: #222;
  text-decoration: none;
  margin: -14px 0 14px;
  padding: 1px 0;
  cursor: pointer;
  /* سایه‌های سه‌بعدی جذاب */
  text-shadow:
    0 2px 4px rgba(0,0,0,0.15),
    0 4px 12px rgba(0,0,0,0.1),
    0 1px 5px rgba(0,0,0,0.25);
  transition: none;
  letter-spacing: 0.5px;
  background: transparent;
}

.panel-site-link:focus {
  outline: none;
}
/* ===== دسکتاپ ===== */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--top-height);
  background: var(--top-bar-bg);
  padding-left: var(--pad-l);
  padding-right: var(--pad-r);
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  z-index: 1002;
  border-bottom: 1px solid #ccc;
}

.header-container {
  position: relative;
  height: 100%;
}

.menu-btn {
  position: absolute;
  left: 120px;
  top: 32px;
  font-size: 24px;
  cursor: pointer;
}

.menu-btn i {
  color: var(--icon);
  transition: 0.4s;
}

.menu-btn.open i {
  transform: rotate(90deg);
}

.main-text {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 15px;
  font-size: 20px;
  font-weight: bold;
  color: #362b26;
}

.header-menu {
  position: absolute;
  top: 65%;
  left: 268px;
  display: flex;
  gap: 16px;
  direction:ltr;
}

.header-menu ul {
   display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  /* gap: 28px; ← این خط را حذف یا کامنت کنید */
  align-items: center;
}

.header-menu > ul > li {
  position: relative;
}

.header-menu a {
  text-decoration: none;
  color: var(--text);
  font-weight: bold;
  font-size: 14px;
  white-space: nowrap;
}
.header-menu a:hover {
  color: var(--icon-hover); /* یا هر رنگ دلخواه، مثلاً #0951a0 */
}

.header-menu > ul > li > a {
  text-decoration: none;
  color: var(--text);
  font-weight: bold;
  font-size: 14px;
  white-space: nowrap;
  padding: 0 18px;
  position: relative;
}

/* خط عمودی سه‌بعدی بین منوها */
.header-menu > ul > li:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 1px;
  height: 24px;
  background: linear-gradient(to bottom, transparent, #999, transparent);
  box-shadow: 1px 0 2px rgba(0, 0, 0, 0.1);
}
.header-menu > ul > li:last-child {
  position: relative;
  z-index: 2001;
}

.header-menu li ul {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 140px;
  z-index: 2000;
  background: #f2f2f2;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  display: block;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.header-menu li:hover ul {
  max-height: 500px;
}

.header-menu li ul a {
  display: block;
  padding: var(--submenu-padding);
  font-size: var(--submenu-font-size);
  text-align: center;
  font-weight: normal;
  background: #f2f2f2;
  border-bottom: 1px solid #ccc;
  margin: 0;
}

.header-menu li ul a:last-child {
  border-bottom: none;
}

.right-section {
  position: absolute;
  top: 50%;
  right: 60px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 15px;
}

.social-icons i {
  font-size: 18px;
  cursor: pointer;
  color: var(--icon);
}

.social-icons i:hover {
  color: var(--icon-hover);
}

.logo-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: url('/assets/images/photo_2026-01-08_12-43-10.jpg') center / cover no-repeat;
  border: 3px solid #1f890564; /* ← رنگ سبز (Violet) */
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}


/* ===== پنل چپ ===== */
.side-panel {
  position: fixed;
  top: var(--top-height);
  left: -320px;
  width: var(--panel-width);
  height: calc(100% - var(--top-height));
  background: var(--panel-bg);
  padding: 30px;
  transition: .5s;
  z-index: 1001;
  border-radius: 0 15px 15px 0;
  box-shadow: 5px 1 15px rgba(0,0,0,.25);
  overflow-y: auto;
    border-right: 2px solid #ccc; /* ✅ خط جدید */
}

.side-panel.show {
  left: 0;
}

.divider {
  height: 1px;
  margin: 18px 0;
  background: linear-gradient(to right, transparent, #999, transparent);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: none;
}

.accordion-header {
  text-align: center;
  font-size: 13.5px;
  font-weight: bold;
  cursor: pointer;
  color: var(--text);
}
.accordion-header:hover {
  color: #1b7803d5; /* یا هر رنگ دلخواه */
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: .4s;
}

.accordion-content a {
  display: block;
  text-align: center;
  margin: 15px 0;
  text-decoration: none;
  color: #333;
  font-size:14px;
}

.accordion-content a:hover {
  color: #079436;
}

/* ===== محتوا ===== */
.main-content {
  position: absolute;
  top: var(--top-height);
  left: var(--panel-width);
  width: calc(100% - var(--panel-width) - 40px);
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.content-card {
  width: calc(33.33% - 10px);
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px;
  background: #fff;
  text-align: center;
}

.content-card img,
.content-card video,
.content-card audio {
  width: 100%;
  border-radius: 4px;
}

/* ===== جستجو ===== */
#searchOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.4s;
  z-index: 2000;
}

#searchOverlay.show {
  opacity: 1;
  pointer-events: auto;
}

#searchOverlay .search-container {
  position: relative;
  width: 0;
  height: 60px;
  opacity: 0;
  transition: width 0.5s, opacity 0.5s;
    transform: translateY(-180px); /* ✅ این خط جدید */

}

#searchOverlay.show .search-container {
  width: 70%;
  opacity: 1;
}

#searchOverlay input {
  width:876px;
  height: 100%;
  padding: 0 40px 0 20px;
  font-size: 22px;
  color: #fff;
  background: transparent;
  border: 2px solid #0951a0;
  border-radius: 4px;
  text-align: center;
  outline: none;
  box-sizing: border-box;
}

#searchOverlay .search-close {
  position: absolute;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
  font-size: 28px;
  color: white;
  cursor: pointer;
  user-select: none;
}

#searchOverlay.show {
  opacity: 1;
  pointer-events: auto;
}

#searchOverlay input {
  width: 480px;
  height: 185px;
  opacity: 0;
  transition: 0.5s;
  background: transparent;
  border: 2px solid #1b7803d5;
  border-radius: 4px;
  font-size: 22px;
  color: #fff;
  text-align: center;
  outline: none;
  padding: 0 20px;
  box-sizing: border-box;
  color:white;
  background-color: #1b7803d5;
}

#searchOverlay.show input {
  width: 100%;
  opacity: 1;
  margin: 0 auto;
}

.mobile-social-icons {
  display: none;
}

.mobile-search {
  display: none !important;
}

/* ========================= PDF SUPPORT ========================= */
.file-media .pdf-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
}
.file-media .pdf-container canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* ========================= FILES GRID – FINAL ========================= */
#filesContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, var(--file-width));
  gap: 12px var(--file-gap);
  margin-top: calc(var(--top-height) + 20px);
  margin-left: calc(var(--panel-width) + 20px);
  padding-right: 100px; /* ← مقدار منطقی، نه بیشتر */
  padding-bottom: 40px;
  justify-content: start;
  margin-left: calc(var(--panel-width) + var(--files-offset-right)); /* ← این خط به‌روز شد */
  margin-top: var(--files-offset-top);        /* ← تغییر اعمال شد */
direction: ltr;
}
     
}

/* قاب‌ها — پر کردن کامل سلول گرید */
.file-item {
  width: 100%;
  box-sizing: border-box;
}


/* قاب اصلی — بدون عرض/ارتفاع ثابت */
.file-box {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 0;
  border: 1px solid Silver;
  border-radius: 4px;
  background-color: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  box-sizing: border-box;
  width: var(--file-width);
  height: var(--file-height);
  margin: 0 auto; /* centred in cell */
   width: var(--file-width);
  height: 160px; /* یا هر ارتفاع دلخواه */
}

/* بخش رسانه — اینجا ابعاد را تنظیم کن */
.file-media {
  width: 100%;
  aspect-ratio: 16 / 9; /* ← اینجا می‌تونی تغییر بدی */
  background: #f9f9f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
}

/* تنظیمات دقیق برای قاب داخلی که فایل‌ها در آن قرار می‌گیرند */
.file-box .file-media {
  display: flex;               /* استفاده از flexbox برای مدیریت چیدمان */
  flex-direction: column;      /* چیدمان عمودی محتوای داخل قاب داخلی */
  justify-content: flex-start; /* چسباندن فایل‌ها به بالای قاب داخلی */
  padding: 0;                  /* حذف فاصله داخلی از اطراف فایل‌ها */
  margin: 0;                   /* حذف فاصله خارجی برای جلوگیری از اختلال */
  width: 100%;                 /* عرض کامل قاب داخلی */
  height: 100%;                /* ارتفاع کامل قاب داخلی */
  background: transparent;    /* شفاف کردن پس‌زمینه */
  border-radius: 4px;          /* گرد کردن گوشه‌ها */
  overflow: hidden;            /* جلوگیری از بیرون رفتن فایل‌ها از قاب داخلی */
}

.file-media img,
.file-media video {
  width: 100%;
  height: 100%;
  object-fit: cover; /* ← کامل، بدون فاصله، بدون برش ناقص */
}

/* فقط برای فایل‌های صوتی — کنترل کامل ابعاد قاب */
.file-box.audio-only {
  width: 225px;    /* ← عرض دلخواه قاب صوتی */
  height: 115px;   /* ← ارتفاع دلخواه قاب صوتی */
  padding: 0;
  margin: 0 auto;  /* centred در سلول گرید */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 1px solid silver;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
}

/* پلیر صوتی داخل قاب — پر کردن فضای قاب */
.file-box.audio-only .file-media {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  overflow: visible;
}


.file-box.audio-only .file-media audio {
  width: 100%;
  height: 36px; /* ← ارتفاع پلیر — دلخواه */
}

.file-box.audio-only .file-media {
  aspect-ratio: auto;
  height: 50px; /* ارتفاع ثابت برای فایل صوتی */
  width: 100%;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

/* تنظیمات تیتر */
.file-box h4 {
  margin-top: 10px;  /* فاصله کمی از بالا برای تیتر */
  font-size: 15px;
  text-align: center;
  word-break: break-word;
  direction: ltr;
  padding: 0 5px;  /* کمی فاصله از چپ و راست */
}

/* خط افقی زیر هر ردیف */
#filesContainer .file-item:nth-child(3n)::after {
  content: "";
  display: block;
  position: absolute;
  bottom: -13px;
  left: -18px;
  right: -18px;
  height: 1px;
  background: linear-gradient(to right, transparent, #999, transparent);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1;
}

/* ========================= IMAGE POPUP ========================= */
#imagePopupOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

#imagePopupOverlay img {
  max-width: 80%;
  max-height: 80%;
  border-radius: 4px;
}

/* ضربدر پاپ‌آپ */
#imagePopupOverlay .close-btn {
  position: absolute;
  top: 20px;
  right: 20px;       /* فاصله از راست */
  left: auto !important; /* مهم: جلوگیری از تداخل */
  font-size: 32px;
  color: white;
  cursor: pointer;
  z-index: 3001;
  direction: ltr;    /* ضربدر همیشه از راست خوانده شود */
  text-align: right;
}

/* ویدیو بدون برش */
.file-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* ========================= MOBILE ========================= */
@media (max-width: 768px) {
  .social-icons,
  .header-menu,
  .main-text {
    display: none !important;
  }

  .top-bar {
    height: 100px;
    padding: 0;
  }

  .header-container {
    position: relative;
    height: 100%;
  }

  .menu-btn {
    position: absolute;
    left: 35px;
    top: 28px;
    font-size: 45px;
    width: 45px;
    height: 45px;
    cursor: pointer;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .logo-circle {
    position: absolute;
    left: -60px;
    top: -43px;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 2px solid #1f890564;
    cursor: pointer;
    z-index: 10;
    background: url('/assets/images/photo_2026-01-08_12-43-10.jpg') center / cover no-repeat;
  }

  .mobile-search {
    display: block !important;
    position: absolute;
    right: 155px;
    top: 35px;
    font-size: 36px;
    width: 32px;
    height: 32px;
    color: var(--icon);
    cursor: pointer;
    z-index: 2001;
  }

  .side-panel {
    position: fixed;
    top: 100px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 100px);
    background: LightGray;
    padding: 0 20px 20px 8px;
    z-index: 1500;
    overflow-y: auto;
    transition: left 0.5s;
    border-radius: 0 !important;
     padding-top: 24px; /* یا هر مقدار دلخواه */
    
  }

  .side-panel.show {
    left: 0;
  }

  .panel-bottom-icons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #ccc;
  }

  .panel-bottom-icons i {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    color: var(--icon);
    cursor: pointer;
  }

  /* ✅ اصلاح اصلی: فقط یک ستون در تمام موبایل‌ها */
  #filesContainer {
    grid-template-columns: 1fr; /* ← فقط یک ستون */
    margin-left: 15px;
    margin-right: 15px;
    padding: 20px 0;
    gap: 18px;
  }

  /* ✅ حذف خطوط افقی برای 2n و 3n — فقط یک خط زیر هر فایل */
  #filesContainer .file-item::after {
    content: "";
    display: block;
    position: absolute;
    bottom: -13px;
    left: -15px;
    right: -15px;
    height: 1px;
    background: linear-gradient(to right, transparent, #999, transparent);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1;
  }


  /* مطمئن شویم خطوط قبلی نمایش داده نشوند */
  #filesContainer .file-item:nth-child(2n)::after,
  #filesContainer .file-item:nth-child(3n)::after {
    display: none;
  }
}
/* یکسان‌سازی ظاهر منوهای پنل چپ */
.accordion-header a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.accordion-header a:visited {
  color: inherit;
}

#searchInput {
  display: none;
}

#loadMoreBtn {
  display: block;
  margin: 20px auto;
  background-color: #0f64c586;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  text-align: center;
}

#loadMoreBtn:hover {
  background-color: #0951a0;
}
/* ===== پلیر بزرگ صوتی ===== */
.big-audio-player {
  position: absolute;
  bottom: 0;
  left: 301px;
  width: 80.1%;
  background: LightGray;
  padding: 12px 60px;   /* ← padding عمودی کمتر */
  box-sizing: border-box;
  z-index: 2000;
  transform: translateY(120%);
  transition: transform 0.4s ease;
  display: none;
  border:2px solid #ccc;
  border-radius: 12px;
}

.big-audio-player.show {
  transform: translateY(0);
  display: block;
}

.player-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px; /* ← فاصله کمتر بین تیتر و پلیر */
  max-width: calc(100% - 120px);
  margin: 0 auto;
}

.big-player-title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  text-align: center;
  width: 100%;
  direction: rtl;
  word-break: break-word;
  margin: 0; /* ← حذف فاصله اضافه */
}

#bigAudioElement {
  width: 100%;
  height: 50px; /* ← ارتفاع استاندارد مثل پلیر کوچک */
}

.close-btn {
  position: absolute;
  left: 1100px;
  top: -8px; /* ← کمی بالاتر */
  background: none;
  border: none;
  font-size: 28px;
  color: #079436;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  margin: 0;
}

.player-controls {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.player-controls button {
  background: #0f64c586;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

.player-controls button:hover {
  background: #079436;
}
/* ===== موبایل: پلیر بزرگ تمام‌عرض داخلی ===== */
@media (max-width: 768px) {
  .big-audio-player {
    padding: 12px 8px; /* ← فقط 8px حاشیه از چپ/راست */
    /* ===== پلیر بزرگ صوتی ===== */

  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 12px 60px;   /* ← padding عمودی کمتر */
  box-sizing: border-box;
  z-index: 2000;
  transform: translateY(120%);
  transition: transform 0.4s ease;
  display: none;

  }
  
  .close-btn {
  position: absolute;
  left: 380px;
  top: -8px; /* ← کمی بالاتر */
  background: none;
  border: none;
  font-size: 28px;
  color: #0951a0;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  margin: 0;
}
  
  .player-content {
    max-width: none; /* ← حذف محدودیت عرض */
    padding: 0;
    width: 100%;
  }

  #bigAudioElement {
    height: 56px; /* ← کمی بزرگ‌تر برای خوانایی بهتر */
  }

  .player-controls button {
    width: 44px;
    height: 44px;
  }
}