/* دمو T-Bot — الگوی کارت و مودال مشابه TBot.php */

.demo-tbot-info-card,
.demo-tbot-card-host .demo-tbot-info-card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,.08);
  overflow: hidden;
  margin-top: 8px;
}

.demo-tbot-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  border-bottom: 1px solid #e2e8f0;
}

.demo-tbot-card-ico {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.demo-tbot-card-title { font-weight: 900; font-size: .92rem; color: #0f172a; }
.demo-tbot-card-sub { font-size: .76rem; color: #64748b; margin-top: 2px; }

.demo-tbot-card-body { padding: 12px 16px; }

.demo-tbot-info-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: .82rem;
}
.demo-tbot-info-row:last-child { border-bottom: 0; }
.demo-tbot-info-k { color: #64748b; }
.demo-tbot-info-v { font-weight: 800; color: #0f172a; text-align: left; }

.demo-tbot-card-btn:hover { filter: brightness(1.05); }
.demo-tbot-card-btn--alt { margin-top: 0; background: linear-gradient(135deg, #475569, #334155); }
.demo-tbot-card-btn--ghost { background: #fff; color: #475569; border: 1.5px solid #e2e8f0; box-shadow: none; }
.demo-tbot-card-btn + .demo-tbot-card-btn { margin-top: 8px; }

.demo-tbot-flow-panel { margin-top: 6px; }
.demo-tbot-flow-panel .demo-tbot-info-card { max-width: 100%; }

.demo-tbot-form { display: grid; gap: 10px; }
.demo-tbot-label { font-size: .74rem; font-weight: 800; color: #64748b; }
.demo-tbot-label-inline { font-size: .72rem; color: #64748b; font-weight: 700; }
.demo-tbot-input, .demo-tbot-form select.demo-tbot-input {
  width: 100%; border: 1.5px solid #e2e8f0; border-radius: 12px;
  padding: 10px 12px; font: inherit; background: #f8fafc; box-sizing: border-box;
}
.demo-tbot-form-hint { font-size: .82rem; color: #475569; line-height: 1.6; }
.demo-tbot-field-error { color: #dc2626; font-size: .72rem; }
.demo-tbot-form-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.demo-tbot-modal-lead { margin: 0 0 12px; font-size: .84rem; }
.demo-tbot-check { display: flex; align-items: center; gap: 8px; font-size: .8rem; }

.demo-tbot-chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.demo-tbot-chip {
  border: 1.5px solid #e2e8f0; background: #f8fafc; color: #475569;
  border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .76rem; font-weight: 800; cursor: pointer;
}
.demo-tbot-chip--on { background: #6366f1; border-color: #6366f1; color: #fff; }

.demo-tbot-grade-inp { width: 52px; border: 1px solid #e2e8f0; border-radius: 8px; padding: 4px; text-align: center; font: inherit; }

.demo-att-pill {
  border: 1px solid #e2e8f0; background: #f8fafc; border-radius: 999px;
  padding: 4px 10px; font-size: .72rem; cursor: pointer; margin-left: 4px;
}
.demo-att-pill--on { background: #6366f1; color: #fff; border-color: #6366f1; }
.demo-att-pill--on[data-status="غایب"] { background: #ef4444; border-color: #ef4444; }
.demo-att-pill--on[data-status="تأخیر"] { background: #f59e0b; border-color: #f59e0b; }

.demo-disc-list { margin-bottom: 10px; }
.demo-disc-item { padding: 8px 0; border-bottom: 1px dashed #e2e8f0; font-size: .82rem; }

.demo-tbot-wizard .demo-wizard-steps {
  display: flex; gap: 8px; margin-bottom: 14px; font-size: .72rem; font-weight: 800; color: #94a3b8;
}
.demo-wizard-steps span.on { color: #6366f1; }

.demo-hwr-menu-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.demo-hwr-menu-btn {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  width: 100%; text-align: right; border: 1.5px solid #e2e8f0; background: #f8fafc;
  border-radius: 14px; padding: 10px 12px; font: inherit; cursor: pointer;
}
.demo-hwr-menu-btn:hover { background: #eef2ff; border-color: #c7d2fe; }
.demo-hwr-menu-title { font-weight: 800; font-size: .82rem; color: #0f172a; }
.demo-hwr-badge { font-size: .68rem; font-weight: 800; color: #6366f1; background: #eef2ff; padding: 3px 8px; border-radius: 999px; }
.demo-hwr-muted { font-size: .68rem; color: #64748b; }
.demo-hwr-empty { font-size: .78rem; color: #94a3b8; margin: 0; }

.demo-hwr-stats { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 10px; }
.demo-hwr-stat { font-size: .68rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.demo-hwr-stat.red { background: #fef2f2; color: #dc2626; }
.demo-hwr-stat.blue { background: #eff6ff; color: #2563eb; }
.demo-hwr-stat.green { background: #ecfdf5; color: #15803d; }

.demo-hwr-stu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 0 16px 14px; }
.demo-hwr-stu {
  border: 2px solid #e2e8f0; background: #fff; border-radius: 14px; padding: 10px;
  font: inherit; font-size: .78rem; font-weight: 800; cursor: pointer; text-align: center;
}
.demo-hwr-stu--red { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.demo-hwr-stu--blue { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.demo-hwr-stu--green { border-color: #bbf7d0; background: #ecfdf5; color: #15803d; }

.demo-hwr-q { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px dashed #e2e8f0; }
.demo-hwr-q-head { font-size: .8rem; font-weight: 800; margin-bottom: 6px; }
.demo-hwr-bank { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.demo-hwr-chip {
  font-size: .68rem; padding: 4px 10px; border-radius: 999px; background: #f1f5f9; color: #475569; cursor: pointer;
}

.demo-lp-phases { margin: 0; padding: 0 1.2rem 12px 0; font-size: .84rem; line-height: 1.8; }

.demo-tbot-card-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 14px;
  padding: 11px 14px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: #fff;
  font: inherit;
  font-weight: 900;
  font-size: .84rem;
  cursor: pointer;
}
.demo-tbot-card-btn:hover { filter: brightness(1.05); }

.demo-tbot-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.demo-tbot-modal[hidden] { display: none !important; }

.demo-tbot-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(3px);
}

.demo-tbot-modal-container {
  position: relative;
  width: min(560px, 100%);
  max-height: min(88vh, 720px);
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 20px 40px -12px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: demoTbotModalIn .28s ease both;
}
.demo-tbot-modal-container.wide { width: min(680px, 100%); }

@keyframes demoTbotModalIn {
  from { opacity: 0; transform: scale(.94) translateY(10px); }
  to { opacity: 1; transform: none; }
}

.demo-tbot-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.demo-tbot-modal-header h3 { margin: 0; font-size: 1rem; font-weight: 900; color: #0f172a; }
.demo-tbot-modal-header p { margin: 4px 0 0; font-size: .78rem; color: #64748b; }

.demo-tbot-modal-close {
  border: 0;
  background: #e2e8f0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  color: #475569;
  flex-shrink: 0;
}

.demo-tbot-modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  font-size: .86rem;
  line-height: 1.65;
}

.demo-tbot-table-wrap { overflow-x: auto; margin-bottom: 10px; }
.demo-tbot-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.demo-tbot-table-wrap th,
.demo-tbot-table-wrap td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: right;
}
.demo-tbot-table-wrap th {
  background: #f1f5f9;
  font-weight: 800;
  color: #475569;
}

.demo-tbot-demo-note {
  font-size: 0.72rem;
  color: #64748b;
  margin: 8px 0 0;
}

/* سؤالات تکلیف در مودال T-Bot */
.demo-hw-sheet--modal {
  margin-top: 0;
  padding: 0;
  background: transparent;
  border: 0;
}
.demo-tbot-modal-body .demo-hw-meta {
  font-size: 0.82rem;
  color: #6366f1;
  margin-bottom: 4px;
}
.demo-tbot-modal-body .demo-hw-submitted {
  font-size: 0.74rem;
  color: #64748b;
  margin-bottom: 12px;
  font-weight: 700;
}
.demo-tbot-modal-body .demo-hw-q-math {
  background: #eef2ff;
  color: #1e293b;
  border-color: #c7d2fe;
}

.demo-tbot-textarea {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  font: inherit;
  resize: vertical;
  min-height: 160px;
}

.demo-tbot-upload-fake {
  margin-top: 10px;
  padding: 20px;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  text-align: center;
  color: #64748b;
  background: #f8fafc;
}

body.demo-tbot-modal-open { overflow: hidden; }

.demo-tbot-class-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 0 12px 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  font-size: .82rem;
}
.demo-tbot-class-label { font-weight: 800; color: #475569; white-space: nowrap; }
.demo-tbot-class-select {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  background: #f8fafc;
}
.demo-tbot-class-sub { font-size: .74rem; color: #64748b; white-space: nowrap; }

body.theme-tbot .quick-bar {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 8px;
  padding-bottom: 4px;
}
body.theme-tbot .quick-bar .qbtn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.demo-class-pitch {
  position: relative;
  margin: 0 12px 8px;
  border-radius: 16px;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  box-shadow: 0 8px 24px rgba(99, 102, 241, .35);
  overflow: hidden;
  flex-shrink: 0;
  z-index: 4;
}
.demo-class-pitch[hidden] { display: none !important; }
.demo-class-pitch.is-visible { display: block; animation: demoPitchIn .35s ease both; }

.demo-class-pitch-main {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 12px 14px;
  cursor: pointer;
  text-align: right;
  font: inherit;
}
.demo-class-pitch-main strong { display: block; font-size: .88rem; font-weight: 900; }
.demo-class-pitch-main small { display: block; font-size: .72rem; opacity: .92; margin-top: 2px; }
.demo-class-pitch-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.demo-class-pitch-ico { font-size: 1.4rem; flex-shrink: 0; }

.demo-class-pitch-close {
  position: absolute;
  left: 8px;
  top: 8px;
  border: 0;
  background: rgba(255,255,255,.2);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

@keyframes demoPitchIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.demo-tbot-submenu { padding-right: 8px; margin-bottom: 4px; }
.demo-tbot-submenu .sb-item { font-size: .78rem; padding: 8px 10px 8px 28px; }
