/* استایل منوی کناری (Sidebar Menu) */
.sidebar-menu {
  position: fixed;
  top: 0;
  right: 0;
  transform: translateX(100%); /* مخفی در حالت اولیه */
  width: 75%;
  max-width: 320px;
  height: 100%;
  background: rgba(var(--theme-color-rgb), 0.85);
  backdrop-filter: blur(50px);
  z-index: 1001;
  padding: 25px 15px; /* پدینگ کمتر برای موبایل */
  box-sizing: border-box;
  transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1); /* انیمیشن بسیار نرم */
  box-shadow: -8px 0 25px rgba(0, 0, 0, 0.3);
  border-radius: 20px 0 0 20px;
  border-left: 1px solid var(--border-color);
  opacity: 0;
}

.sidebar-menu.active {
  transform: translateX(0); /* باز شدن منو */
  opacity: 1;
}

/* محتوای منوی کناری */
.sidebar-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* لینک‌های اجتماعی */
.social-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-link {
  color: var(--text-color);
  text-decoration: none;
  font-size: 1rem; /* کوچکتر برای موبایل */
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--items-color);
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییرات */
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.social-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  background: var(--items-color-adjusted-20);
}

.social-link i {
  font-size: 1.2rem;
  color: var(--text-color);
  transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر آیکن */
}

.social-link:hover i {
  transform: scale(1.08); /* افکت ظریف‌تر */
}

/* استایل منوی والد (Parent Menu) */
.parent-menu {
  position: fixed;
  top: 120px;
  width: 100%;
  max-width: 480px;
  margin-top: 20px;
  display: flex;
  overflow-x: auto;
  padding: 12px 8px;
  z-index: 999;
  background: rgba(var(--theme-color-rgb), 0.85);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  scroll-behavior: smooth;
  gap: 10px;
  transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییرات */
  box-sizing: border-box;
  transform: translateY(0);
}

.parent-menu.shrink {
  top: 60px;
  margin-top: 5px;
  padding: 8px;
  transform: translateY(-5px); /* افکت نرم برای جابجایی */
}

/* آیتم‌های منوی والد */
.parent-item {
  display: flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 1rem; /* کوچکتر برای موبایل */
  font-weight: 700;
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییرات */
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
  background-color: var(--items-color-adjusted-20);
  color: var(--text-color);
  gap: 12px;
}

.parent-menu.shrink .parent-item {
  padding: 6px 12px;
  font-size: 0.9rem;
}

.parent-item.active {
  background-color: var(--items-color);
  color: var(--text-color-adjusted-10);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.parent-item::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    rgba(var(--text-color-rgb), 0.1),
    transparent
  );
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر */
  border-radius: 20px;
}

.parent-item:hover::before,
.parent-item.active::before {
  opacity: 1;
}

.parent-item .menu-icon {
  width: 32px; /* کوچکتر برای موبایل */
  height: 32px;
  margin-left: 0;
  border-radius: 6px;
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر */
}

.parent-menu.shrink .menu-icon {
  width: 20px;
  height: 20px;
}

.parent-item.active .menu-icon {
  transform: scale(1.08); /* افکت ظریف‌تر */
}

.parent-item .check-icon {
  font-size: 0.85rem;
  margin-right: 6px;
  color: var(--theme-color-adjusted-10); /* جایگزینی #28a745 */
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر */
}

/* استایل منوی فرزند (Child Menu) */
.child-menu {
  position: fixed;
  top: 200px;
  width: 100%;
  max-width: 480px;
  display: flex;
  overflow-x: auto;
  padding: 12px 8px;
  z-index: 998;
  background: rgba(var(--theme-color-rgb), 0.85);
  backdrop-filter: blur(10px);
  scroll-behavior: smooth;
  gap: 8px;
  margin-top: 10px;
  transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییرات */
  box-sizing: border-box;
  transform: translateY(0);
}

.child-menu.shrink {
  top: 120px;
  margin-top: 1px;
  padding: 8px;
  transform: translateY(-5px); /* افکت نرم برای جابجایی */
}

/* آیتم‌های منوی فرزند */
.child-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 18px;
  text-decoration: none;
  font-size: 0.95rem; /* کوچکتر برای موبایل */
  font-weight: 700;
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییرات */
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
  background-color: var(--items-color-adjusted-30);
  color: var(--text-color);
  gap: 10px;
}

.child-menu.shrink .child-item {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.child-item.active {
  background-color: var(--items-color);
  color: var(--text-color-adjusted-10);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.child-item::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    rgba(var(--text-color-rgb), 0.15),
    transparent
  );
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر */
  border-radius: 18px;
}

.child-item:hover::before,
.child-item.active::before {
  opacity: 1;
}

.child-item .menu-icon {
  width: 28px; /* کوچکتر برای موبایل */
  height: 28px;
  margin-left: 0;
  border-radius: 6px;
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر */
}

.child-menu.shrink .menu-icon {
  width: 18px;
  height: 18px;
}

.child-item.active .menu-icon {
  transform: scale(1.08); /* افکت ظریف‌تر */
}

.child-item .check-icon {
  font-size: 0.8rem;
  margin-right: 6px;
  color: var(--theme-color-adjusted-10); /* جایگزینی #28a745 */
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر */
}

/* اسکرول‌بار برای منوها */
.parent-menu::-webkit-scrollbar,
.child-menu::-webkit-scrollbar {
  height: 5px; /* نازک‌تر برای موبایل */
}

.parent-menu::-webkit-scrollbar-thumb,
.child-menu::-webkit-scrollbar-thumb {
  background: rgba(var(--text-color-rgb), 0.3);
  border-radius: 3px;
  transition: background 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر */
}

.parent-menu::-webkit-scrollbar-thumb:hover,
.child-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--text-color-rgb), 0.5);
}

/* استایل دکمه همبرگری */
.hamburger-btn {
  background: none;
  border: none;
  font-size: 1.4rem; /* کمی کوچکتر برای موبایل */
  cursor: pointer;
  padding: 4px;
  color: var(--text-color);
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); /* نرم‌تر کردن تغییر */
}

.hamburger-btn.active {
  color: var(--theme-color-adjusted-10);
  transform: scale(1.08); /* افکت ظریف برای فعال شدن */
}
