/* ts:1765530526085 */
:root {
  --primary-color: #0f172a;
  --primary-color-light: #1e293b;
  --secondary-color: #06b6d4;
  --secondary-color-light: #22d3ee;
  --accent-color: #38bdf8;
  --card-bg: #1e293b;
  --card-hover-bg: #334155;
  --text-color: #f8fafc;
  --muted-text: #94a3b8;
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  --transition: all 0.3s ease;
  --cta-border-radius: 14px;
  --navbar-height: 48px;
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Vazirmatn", sans-serif;
}

body {
  background: linear-gradient(135deg, var(--primary-color), #0a0f1f);
  color: var(--text-color);
  min-height: 100vh;
}

main {
  margin-top: 80px;
  display: flex;
  gap: 1.5rem;
  margin: 80px auto 1.5rem;
  padding: 0 1rem;
  max-width: 1200px;
}

/* Navbar */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--navbar-height);
  background: transparent !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 1100;
  transition: var(--transition);
}

.nav.scrolled {
  background: rgba(13, 13, 26, 0.95) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav.hidden {
  transform: translateY(-100%);
}

.nav ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
}

.nav ul li a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9rem;
  transition: var(--transition);
}

.nav ul li a:hover {
  color: var(--accent-color);
}

.signout {
  color: var(--text-color);
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9rem;
  background-color: transparent;
  border: none;
  transition: var(--transition);
}
.signout:hover {
  color: var(--accent-color);
  cursor: pointer;
}

.nav .logo {
  font-size: 1.2rem;
  color: var(--accent-color);
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 20px;
  height: 15px;
  cursor: pointer;
  z-index: 1001;
}

.hamburger span {
  height: 2px;
  width: 100%;
  background: var(--text-color);
  border-radius: 3px;
  transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(-1px) scaleX(0.8);
}
.hamburger.active span:nth-child(2) {
  transform: scaleX(0.6);
}
.hamburger.active span:nth-child(3) {
  transform: translateY(1px) scaleX(0.8);
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  .nav ul {
    position: absolute;
    top: var(--navbar-height);
    right: var(--padding);
    width: 180px;
    background: rgba(13, 13, 26, 0.95);
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    transform: translateY(-100%);
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    border-radius: 6px;
  }
  .nav ul.active {
    transform: translateY(0);
    opacity: 1;
  }
  .nav .logo {
    font-size: 1rem;
  }
  .nav ul li a {
    font-size: 0.85rem;
  }
}

/* Sidebar */

.sidebar {
  position: relative;
  flex: 0 0 220px;
  right: 16px;
  display: flex;
  flex-direction: column;
  width: 220px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.sidebar header {
  display: flex;
  align-items: center;
  height: 50px;
  /* padding: 0 1rem 0 0; */
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar header button {
  width: 46px;
  color: var(--accent-color);
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

.sidebar .menu {
  position: relative;
  display: grid;
  grid-auto-rows: min-content; /* ارتفاع هر دکمه براساس محتوایش */
  grid-template-columns: 1fr; /* ✅ ستون تکی که تمام عرض را می‌گیرد */
  justify-items: stretch; /* ✅ آیتم‌ها را در عرض می‌کشد */
  align-items: start;
  top: 8px;
  margin-bottom: 20px;
  width: 100%; /* اطمینان از پر کردن کل سایدبار */
  box-sizing: border-box;
}

.sidebar .menu::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  height: 48px;
  width: 3px;
  background: var(--secondary-color);
  transform: translateY(var(--top, 0));
  transition: transform 0.3s;
  border-radius: 0 3px 3px 0;
}

.sidebar button {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 48px;
  font-size: 14px;
  padding: 0 16px;
  width: 100%; /* ✅ کل عرض سایدبار */
  color: var(--muted-text);
  cursor: pointer;
  background: none;
  border: none;
  transition: var(--transition);
  text-align: right; /* در صورت راست‌چین بودن */
}

.sidebar .menu button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
}

.sidebar .menu button.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-color);
  font-weight: 600;
}
.sidebar button i {
  padding: 0 10px;
}

/* Main content */
.main-content {
  padding: 1.5rem;
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 14px;
  min-width: 100px;
}

h2 {
  margin: 0.5rem 0;
  font-size: 1.4rem;
  color: var(--secondary-color-light);
}
/* CSS برای مخفی کردن متن ها وقتی سایدبار بسته است و انیمیشن */


/* ---------- Responsive Collapsible Sidebar ---------- */
@media (max-width: 992px) {
  .sidebar {
    position: fixed;
    top: 80px;
    right: 0;
    height: calc(100vh - var(--navbar-height));
    width: 64px; /* فقط آیکن‌ها دیده می‌شن */
    border-radius: 0;
    transition: width 0.3s ease;
    z-index: 1000;
  }

  /* وقتی باز شد */
  .sidebar.open {
    width: 220px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  }

  /* دکمه‌ها فقط آیکن وقتی بسته است */
  .sidebar .menu button {
    position: relative;
  }
  .sidebar button {
    gap: 20px;
  }
  .sidebar:not(.open) .menu button span {
    display: none; /* متن‌ها مخفی */
  }

  /* متن‌ها داخل span باشن تا فقط اون مخفی شه */


  /* افتر برای حالت بسته غیرفعال */
  .sidebar:not(.open) .menu::after {
    display: none;
  }

  /* موقع باز شدن، روی محتوا میاد */
  main {
    margin-right: 64px;
    transition: margin-right 0.3s ease;
  }
  .sidebar.open ~ main {
    margin-right: 220px;
  }

  /* دکمه‌ی باز/بسته */
  .sidebar header button.toggle-btn {
    width: 46px;
    height: 46px;
    border: none;
    background: none;
    color: var(--accent-color);
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.3s ease;
  }

  .sidebar.open header button.toggle-btn {
    transform: rotate(180deg);
  }
}

@media (max-width: 576px) {
  .sidebar {
    top: 80px;
    width: 65px;
  }
  .sidebar.open {
    width: 200px;
  }
  .sidebar button {
    gap: 20px;
  }
  main {
    margin-right: 56px;
  }
  .sidebar.open ~ main {
    margin-right: 200px;
  }
}

/* 📱 برای گوشی‌های خیلی کوچک (320px و پایین‌تر) */
@media (max-width: 375px) {
  .sidebar {
    top: 80px; /* فاصله کمتر از نوار بالا */
    width: 45px; /* فقط آیکن‌ها */
  }

  .sidebar.open {
    width: 160px; /* هنگام باز شدن */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  }

  .sidebar button {
    gap: 10px; /* فاصله بین آیکن و متن */
    padding: 0 8px;
    font-size: 12px; /* متن کوچک‌تر */
  }

  .sidebar .menu button span {
    margin-right: 4px;
  }

  main {
    margin-right: 50px; /* فاصله محتوای اصلی */
    padding: 0 0.75rem;
  }

  .sidebar.open ~ main {
    margin-right: 160px;
  }

  /* 🔹 نوار بالا جمع‌تر می‌شود */
  .nav {
    height: 44px;
    padding: 0 0.75rem;
  }

  .nav .logo {
    font-size: 0.9rem;
  }

  .hamburger {
    width: 18px;
    height: 14px;
  }
}


/* Loader تیره هنگام لود صفحه */
#loader {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-color), #0a0f1f);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  font-size: 1.2rem;
  letter-spacing: 1px;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#loader.fade-out {
  opacity: 0;
  visibility: hidden;
}




/* === پیجینیشن === */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;

  margin: 10px 0px 40px 0;
  flex-wrap: wrap;
  gap: 5px;
}

.page-btn {
  background-color: var(--card-bg);
  color: var(--text-color);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  min-width: 30px;
  text-align: center;
  transition: 0.2s;
}

.page-btn:hover {
  background-color: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

.page-btn.active {
  background-color: var(--secondary-color-light);
  color: white;
  border-color: var(--primary-color);
}

.page-btn.prev,
.page-btn.next {
  font-weight: bold;
  padding: 3px 6px;
  min-width: 24px;
  font-size: 0.75rem;
}

.pagination .ellipsis {
  display: inline-block;
  padding: 5px 8px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}



/* لودر در مرکز سه ستون */
.loader-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  width: 100%;
  color: var(--text-color);
  opacity: 1;
  transition: opacity 0.5s ease;
  background: var(--primary-color-light);
  border-radius: var(--cta-border-radius);
  box-shadow: var(--card-shadow);
}

.loader-wrapper.fade-out {
  opacity: 0;
}

/* دایره‌های در حال چرخش */
.loader {
  position: relative;
  width: 64px;
  height: 64px;
}

.loader::before,
.loader::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--secondary-color-light);
  animation: spin 1.2s linear infinite;
}

.loader::after {
  border: 3px solid transparent;
  border-bottom-color: var(--accent-color);
  animation-direction: reverse;
}

.loader-wrapper p {
  margin-top: 14px;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  color: var(--muted-text);
  animation: pulse 1.5s ease-in-out infinite;
}

/* انیمیشن‌ها */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* افکت ورود کارت‌ها */
.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* مودال حذف */
.delete-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.delete-modal-content {
  background: var(--card-bg);
  color: var(--text-color);
  padding: 2rem 2.5rem;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  text-align: center;
  width: 360px;
  transform: scale(0.95);
  animation: popUp 0.3s ease forwards;
}

.delete-modal-icon {
  font-size: 3rem;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.delete-modal-content h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-color);
}

.delete-modal-content p {
  font-size: 0.95rem;
  color: var(--muted-text);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.delete-modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.delete-btn-confirm,
.delete-btn-cancel {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--cta-border-radius);
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.delete-btn-confirm {
  background: linear-gradient(
    135deg,
    var(--secondary-color),
    var(--accent-color)
  );
  color: var(--primary-color);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.4);
}

.delete-btn-confirm:hover {
  background: linear-gradient(
    135deg,
    var(--secondary-color-light),
    var(--accent-color)
  );
  transform: translateY(-2px);
}

.delete-btn-cancel {
  background: var(--primary-color-light);
  color: var(--muted-text);
  border: 1px solid var(--card-hover-bg);
}

.delete-btn-cancel:hover {
  background: var(--card-hover-bg);
  color: var(--text-color);
  transform: translateY(-2px);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes popUp {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}


/* متن‌های دکمه وقتی سایدبار بسته است */
.sidebar nav button p,
.sidebar nav button span {
  display: inline-block;
  max-width: 200px; /* حداکثر عرض متن در حالت باز */
  white-space: nowrap;
  overflow: hidden;
  transition: max-width 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}


