/* static/css/candle-tooltip.css — آموزش باکس مشخصات کندل */

/* ───────── توکن‌های رنگ ───────── */
.card-power-edu {
  --pe-text: #0f172a;
  --pe-head: #0b3a5c;
  --pe-strong: #071a2e;
  --pe-muted: #64748b;
  --pe-link: var(--primary, #1a5276);
  --pe-link-hover: #2980b9;
  --pe-border: #d3dcea;
  --pe-soft: #f4f7fb;
  --pe-note-bg: #fef9e7;
  --pe-note-text: #1b1b1b;
  --pe-note-link: #b7791f;
  --pe-gold: #f5b942;
  --pe-g: #1fb589;
  --pe-r: #ef4a4a;
  --pe-b: #60a5fa;
  --pe-p: #c084fc;
}

[data-theme="dark"] .card-power-edu,
body.dark-theme .card-power-edu {
  --pe-text: #e8eef8;
  --pe-head: #93c5fd;
  --pe-strong: #fff;
  --pe-muted: #cbd5e1;
  --pe-link: #93c5fd;
  --pe-link-hover: #bfdbfe;
  --pe-border: #2a3b5a;
  --pe-soft: #1c2d4a;
  --pe-note-bg: #3a2f14;
  --pe-note-text: #f5d98a;
  --pe-note-link: #fbbf24;
}

/* ───────── چیدمان صفحه ───────── */
body.power-page > .ui.container {
  width: auto !important;
  max-width: 1400px !important;
  margin-inline: auto !important;
  padding-inline: 16px !important;
  box-sizing: border-box;
}

body.power-page .power-wrap {
  width: 100% !important;
  max-width: none !important;
  margin: 24px 0 0 !important;
  padding: 0 !important;
}

#tablo-khani-guide {
  direction: rtl;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ───────── کارت اصلی و تایپوگرافی ───────── */
.card-power-edu {
  max-width: 100%;
  box-sizing: border-box;
  padding: 22px 24px;
  margin-bottom: 14px;
  font-family: "Vazirmatn", "Vazir", Tahoma, system-ui, sans-serif;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-right: 5px solid var(--primary);
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(26, 82, 118, .12);
  color: var(--pe-text);
  font-size: 1.05em;
  font-weight: 500;
  line-height: 2;
}

.card-power-edu h1,
.card-power-edu h2,
.card-power-edu h3 {
  color: var(--pe-head);
  font-weight: 800;
  line-height: 1.6;
}

.card-power-edu h1,
.card-power-edu h2 {
  font-size: 1.4em;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--primary);
}

.card-power-edu h2 { margin-top: 34px; }
.card-power-edu h3 { font-size: 1.2em; margin: 28px 0 8px; }

.card-power-edu strong,
.card-power-edu b { color: var(--pe-strong); font-weight: 800; }

.card-power-edu ol,
.card-power-edu ul { padding-inline-start: 1.4em; }
.card-power-edu li { margin-bottom: 6px; }

.power-kicker {
  margin: 0 0 10px;
  color: var(--pe-head);
  font-weight: 800;
}

a.ctt-edu {
  color: var(--pe-link);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

a.ctt-edu:hover,
a.ctt-edu:focus-visible { color: var(--pe-link-hover); }

.ctt-badge {
  display: inline-block;
  padding: 0 10px;
  border: 1px solid var(--pe-gold);
  border-radius: 6px;
  color: #b7791f;
  font-size: 14px;
  font-weight: 700;
}

[data-theme="dark"] .ctt-badge,
body.dark-theme .ctt-badge { color: #fbbf24; border-color: #f59e0b; }

/* ───────── تصویر ───────── */
.ctt-figure { margin: 20px auto 24px; text-align: center; }

.ctt-main-image {
  display: block;
  width: 100%;
  max-width: 1100px;
  height: auto;
  margin: 0 auto 10px;
  border: 1px solid var(--pe-border);
  border-radius: 12px;
  box-shadow: 0 5px 22px rgba(0, 0, 0, .12);
}

.ctt-image-caption { color: var(--pe-muted); font-size: .95em; }

/* ───────── پنل نمونه (همیشه تیره) ───────── */
.ctt-mock {
  max-width: 100%;
  box-sizing: border-box;
  margin: 16px 0;
  padding: 14px 16px;
  background: #15233b;
  border-radius: 12px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .25);
  color: #e8eef8;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.ctt-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px 12px;
  padding: 10px 0;
}

.ctt-row + .ctt-row { border-top: 1px solid #2a3b5a; }

.ctt-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  background: #1c2d4a;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition: background .15s;
}

a.ctt-item:hover,
a.ctt-item:focus-visible { background: #243a5c; outline: 1px solid #3b82f6; }

.ctt-item__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ctt-item__label { color: #9db0cc; font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.ctt-item__val { color: #f8fafc; font-size: 15px; font-weight: 700; line-height: 1.35; }

.ctt-n {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--pe-gold);
  color: #1b1b1b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.ctt-g { color: var(--pe-g); }
.ctt-r { color: var(--pe-r); }
.ctt-b { color: var(--pe-b); }
.ctt-p { color: var(--pe-p); }

/* ───────── کارت‌های توضیح ───────── */
.ctt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.ctt-card {
  min-width: 0;
  padding: 10px 14px;
  background: var(--pe-soft);
  border: 1px solid var(--pe-border);
  border-radius: 10px;
}

.ctt-card h3 { margin: 0 0 2px; padding: 0; border: 0; font-size: 1.05em; }
.ctt-card h3 a { color: var(--pe-link); text-decoration: none; }
.ctt-card h3 a:hover,
.ctt-card h3 a:focus-visible { text-decoration: underline; }
.ctt-card p { margin: 0; font-size: .95em; line-height: 1.9; }

/* ───────── ماشین‌حساب‌ها ───────── */
.ctt-calc {
  max-width: 100%;
  margin: 12px 0;
  padding: 14px 16px;
  background: #0f1b30;
  border-radius: 12px;
  color: #fff;
  font-size: 1em;
  font-weight: 500;
  line-height: 1.6;
}

.card-power-edu .ctt-calc h3 { margin: 0 0 2px; color: #fff; font-size: 1.05em; border: 0; }
.ctt-calc a.ctt-edu { color: #7dd3fc; }
.ctt-calc .cc-formula { margin: 0 0 6px; color: #ffd77a; font-weight: 700; line-height: 1.7; }
.ctt-calc .cc-formula a.ctt-edu { color: #ffd77a; }
.ctt-calc .cc-src { margin: 0 0 10px; color: #b9cbe6; font-size: 13.5px; line-height: 1.8; }

.ctt-calc .cc-eq { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }

.ctt-calc .cc-box {
  flex: 1 1 130px;
  min-width: 120px;
  padding: 8px 10px;
  background: #1f3556;
  border: 1px solid #3b5a8a;
  border-radius: 10px;
  color: #fff;
  text-align: center;
  text-decoration: none;
  line-height: 1.5;
  transition: border-color .15s, background .15s;
}

.ctt-calc a.cc-box:hover,
.ctt-calc a.cc-box:focus-visible { background: #25436a; border-color: #7dd3fc; }

.ctt-calc .cc-box b { display: block; color: #fff; font-size: 1.35em; }
.ctt-calc .cc-box span { display: block; color: #cfe0f7; font-size: 13px; line-height: 1.6; }
.ctt-calc .cc-res { background: #0e6b50; border-color: #27c79a; }
.ctt-calc .cc-res span { color: #d6fff1; }

.ctt-calc .cc-op {
  display: grid;
  place-items: center;
  padding: 0 2px;
  color: #ffd77a;
  font-size: 1.5em;
  font-weight: 700;
  line-height: 1;
}

.ctt-calc .cc-meaning { margin: 10px 0 0; color: #e6eefb; font-size: 14px; line-height: 1.9; }
.ctt-calc .cc-meaning b { color: #ffd77a; }

/* ───────── جدول‌ها ───────── */
.ctt-tbl {
  max-width: 100%;
  margin: 10px 0;
  overflow-x: auto;
  border: 1px solid var(--pe-border);
  border-radius: 8px;
}

.ctt-tbl table { width: 100%; border-collapse: collapse; }

.ctt-tbl th {
  padding: 9px 11px;
  background: linear-gradient(135deg, #1a5276, #2980b9);
  color: #fff;
  font-weight: 800;
  text-align: right;
}

.ctt-tbl th a.ctt-edu { color: #fff; }
.ctt-tbl td { padding: 8px 11px; border-bottom: 1px solid var(--pe-border); font-weight: 600; }

.ctt-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-inline-end: 6px;
  vertical-align: middle;
  border: 1px solid #94a3b8;
  border-radius: 50%;
}

/* ───────── نکته و پرسش‌های متداول ───────── */
.ctt-note {
  margin: 12px 0;
  padding: 10px 14px;
  background: var(--pe-note-bg);
  border-right: 4px solid #f39c12;
  border-radius: 8px;
  color: var(--pe-note-text);
}

.ctt-note b,
.ctt-note a.ctt-edu { color: var(--pe-note-link); }
.ctt-note b { font-weight: 800; }

.ctt-faq details {
  margin: 8px 0;
  padding: 8px 14px;
  background: var(--pe-soft);
  border: 1px solid var(--pe-border);
  border-radius: 10px;
}

.ctt-faq summary { cursor: pointer; color: var(--pe-head); font-weight: 800; }
.ctt-faq details p { margin: 6px 0 0; }

/* ───────── واکنش‌گرا و دسترسی ───────── */
@media (max-width: 767px) {
  body.power-page > .ui.container { padding-inline: 4px !important; }
  body.power-page .card-power-edu { padding: 16px 12px !important; }
  .ctt-calc .cc-eq { flex-direction: column; }
  .ctt-calc .cc-op { min-height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .ctt-item,
  .ctt-calc .cc-box { transition: none; }
}
