/* ==========================================================================
   Faraz Schema — ItemList Block Premium Styles (Ranked / Numbered / Bullet)
   ========================================================================== */

.faraz-schema-item-list-wrapper,
.faraz-schema-item-list-block,
.wp-block-faraz-item-list {
  direction: rtl;
  margin: 1.5rem 0;
  font-family: 'IRANSansXV', 'Vazirmatn', system-ui, -apple-system, sans-serif;
  width: 100%;
}

/* Outer Card Container — Transparent background */
.faraz-item-list-card,
.faraz-schema-item-list-block {
  width: 100%;
  margin-inline: auto;
  box-sizing: border-box;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.faraz-item-list-header {
  margin-bottom: 1rem !important;
  padding-bottom: 0.75rem !important;
  border-bottom: 1px solid rgba(218, 220, 224, 0.6);
}

.dark .faraz-item-list-header,
body.dark-theme .faraz-item-list-header,
[data-theme="dark"] .faraz-item-list-header {
  border-bottom-color: rgba(55, 65, 81, 0.6);
}

.faraz-item-list-main-title {
  font-size: 1.125rem !important;
  font-weight: 700 !important;
  color: #191f27 !important;
  margin: 0 !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.dark .faraz-item-list-main-title,
body.dark-theme .faraz-item-list-main-title,
[data-theme="dark"] .faraz-item-list-main-title {
  color: #ffffff !important;
}

.faraz-item-list-sub-title {
  font-size: 14px;
  color: #303437;
  margin: 0;
}

.dark .faraz-item-list-sub-title,
body.dark-theme .faraz-item-sub-title,
[data-theme="dark"] .faraz-item-sub-title {
  color: #919eab;
}

.faraz-item-list-container,
.faraz-item-list-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem !important; /* Standard 12px gap */
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  counter-reset: faraz-rank;
}

/* Item Card Entry — 16px Left/Right Padding */
.faraz-item-entry,
.faraz-item-list-entry {
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem !important; /* Exactly 16px left/right */
  border-radius: 0.75rem !important;
  background-color: #ffffff !important;
  border: 1px solid #dadce0 !important;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
  margin-bottom: 0 !important;
  position: relative;
}

.dark .faraz-item-entry,
.dark .faraz-item-list-entry,
body.dark-theme .faraz-item-entry,
body.dark-theme .faraz-item-list-entry,
[data-theme="dark"] .faraz-item-entry,
[data-theme="dark"] .faraz-item-list-entry {
  background-color: #212b36 !important;
  border-color: rgba(99, 115, 129, 0.2) !important;
  box-shadow: none !important;
}

.faraz-item-entry:hover,
.faraz-item-list-entry:hover {
  transform: translateY(-2px);
  border-color: rgba(51, 102, 255, 0.5) !important;
}

/* 🟢 Simple 6px x 6px Bullet Point Indicator */
.faraz-item-bullet-point {
  width: 6px !important;
  height: 6px !important;
  min-width: 6px !important;
  min-height: 6px !important;
  border-radius: 50% !important;
  background-color: #3366ff !important; /* Brand Color */
  flex-shrink: 0;
  margin-left: 0.875rem !important;
  margin-right: 0.25rem !important;
  box-shadow: 0 0 0 2px rgba(51, 102, 255, 0.15);
  transition: background-color 0.2s ease;
}

.dark .faraz-item-bullet-point,
body.dark-theme .faraz-item-bullet-point,
[data-theme="dark"] .faraz-item-bullet-point {
  background-color: #598eff !important; /* Dark mode brand color */
  box-shadow: 0 0 0 2px rgba(89, 142, 255, 0.25);
}

/* 🔢 Clean Number Badge Indicator */
.faraz-item-number-badge {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(51, 102, 255, 0.1) !important;
  color: #3366ff !important;
  margin-left: 0.875rem !important;
  margin-right: 0 !important;
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1;
}

.dark .faraz-item-number-badge,
body.dark-theme .faraz-item-number-badge,
[data-theme="dark"] .faraz-item-number-badge {
  background-color: rgba(51, 102, 255, 0.2) !important;
  color: #598eff !important;
}

/* 🏆 Rank Badges via CSS Counter for legacy HTML and class selector */
.faraz-item-rank-badge,
.faraz-item-list-entry::before {
  counter-increment: faraz-rank;
  content: counter(faraz-rank);
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  margin-left: 0.875rem !important;
  margin-right: 0 !important;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1;
}

/* Rank 1: Gold Amber Gradient */
.faraz-item-rank-badge.rank-1,
.faraz-item-list-entry:nth-child(1)::before {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
}

/* Rank 2 & 3: Primary Blue */
.faraz-item-rank-badge.rank-2,
.faraz-item-rank-badge.rank-3,
.faraz-item-list-entry:nth-child(2)::before,
.faraz-item-list-entry:nth-child(3)::before {
  background-color: rgba(51, 102, 255, 0.1) !important;
  color: #3366ff !important;
}

.dark .faraz-item-rank-badge.rank-2,
.dark .faraz-item-rank-badge.rank-3,
.dark .faraz-item-list-entry:nth-child(2)::before,
.dark .faraz-item-list-entry:nth-child(3)::before,
body.dark-theme .faraz-item-rank-badge.rank-2,
body.dark-theme .faraz-item-rank-badge.rank-3,
[data-theme="dark"] .faraz-item-rank-badge.rank-2,
[data-theme="dark"] .faraz-item-rank-badge.rank-3 {
  background-color: rgba(51, 102, 255, 0.2) !important;
  color: #598eff !important;
}

/* Rank 4+: Neutral */
.faraz-item-rank-badge.rank-default,
.faraz-item-list-entry:nth-child(n+4)::before {
  background-color: #f4f6f8 !important;
  color: #303437 !important;
  border: 1px solid rgba(218, 220, 224, 0.5) !important;
}

.dark .faraz-item-rank-badge.rank-default,
.dark .faraz-item-list-entry:nth-child(n+4)::before,
body.dark-theme .faraz-item-rank-badge.rank-default,
body.dark-theme .faraz-item-list-entry:nth-child(n+4)::before,
[data-theme="dark"] .faraz-item-rank-badge.rank-default,
[data-theme="dark"] .faraz-item-list-entry:nth-child(n+4)::before {
  background-color: #08151e !important;
  color: #919eab !important;
  border-color: rgba(55, 65, 81, 0.5) !important;
}

.faraz-item-content {
  flex-grow: 1;
}

.faraz-item-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.faraz-item-name,
.faraz-item-title {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #191f27 !important;
  margin: 0 !important;
  line-height: 1.25 !important;
}

.dark .faraz-item-name,
.dark .faraz-item-title,
body.dark-theme .faraz-item-name,
body.dark-theme .faraz-item-title,
[data-theme="dark"] .faraz-item-name,
[data-theme="dark"] .faraz-item-title {
  color: #ffffff !important;
}

/* Optional Item Badge Pill (e.g., $, رایگان, ویژه) */
.faraz-item-tag-badge {
  background-color: rgba(51, 102, 255, 0.1);
  color: #3366ff;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

.dark .faraz-item-tag-badge,
body.dark-theme .faraz-item-tag-badge,
[data-theme="dark"] .faraz-item-tag-badge {
  background-color: rgba(51, 102, 255, 0.2);
  color: #598eff;
}

.faraz-item-desc,
.faraz-item-description {
  font-size: 12px !important;
  color: #8d90a1 !important;
  margin: 0 !important;
  line-height: 1.4 !important;
}

.dark .faraz-item-desc,
.dark .faraz-item-description,
body.dark-theme .faraz-item-desc,
body.dark-theme .faraz-item-description,
[data-theme="dark"] .faraz-item-desc,
[data-theme="dark"] .faraz-item-description {
  color: #919eab !important;
}

.faraz-item-action-btn {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background-color: #f4f6f8;
  color: #8d90a1;
  margin-right: 0.75rem;
  transition: all 0.2s ease-in-out;
  text-decoration: none;
}

.dark .faraz-item-action-btn,
body.dark-theme .faraz-item-action-btn,
[data-theme="dark"] .faraz-item-action-btn {
  background-color: #08151e;
  color: #919eab;
}

.faraz-item-entry:hover .faraz-item-action-btn,
.faraz-item-list-entry:hover .faraz-item-action-btn,
.faraz-item-action-btn:hover {
  background-color: #3366ff !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(51, 102, 255, 0.2) !important;
}
