/* =================================================================
   kiff-form-v18.css
   ================================================================= */

/* نابودی نسخه‌های قدیمی */
.kiff-v13-purpose, .kiff-v14-purpose, .kiff-v12-purpose, .kiff-v15-purpose, .kiff-v17-purpose,
.kiff-v13-type, .kiff-v14-type, .kiff-v15-type, .kiff-v17-type,
.kiff-v13-genre, .kiff-v14-genre, .kiff-v15-genre, .kiff-v17-genre,
.kiff-genre-v9-wrap, .kiff-genre-multi,
.kiff-v17-section-tree, .kiff-v17-details {
  display: none !important;
}

/* ═══ Purpose chips ═══ */
.kiff-v18-purpose {
  background: linear-gradient(145deg, rgba(30,50,70,0.55), rgba(20,35,50,0.75));
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 18px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.kiff-v18-purpose-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.88rem; font-weight: 800; color: #D4AF37;
  margin-bottom: 12px;
}
.kiff-v18-icon-spark { font-size: 1.1rem; }
.kiff-v18-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kiff-v18-chip {
  display: flex !important; align-items: center; gap: 10px;
  padding: 10px 14px !important; border-radius: 12px !important;
  border: 1.5px solid rgba(232,237,242,0.12) !important;
  background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)) !important;
  color: #E8EDF2 !important; font-family: inherit !important;
  cursor: pointer !important; transition: all 0.22s !important;
  text-align: right !important; min-height: 58px; width: 100%;
}
.kiff-v18-chip:hover { border-color: rgba(212,175,55,0.4) !important; transform: translateY(-2px); }
.kiff-v18-chip.active {
  background: linear-gradient(135deg, #D4AF37 0%, #C9A03D 100%) !important;
  border-color: #FFE08A !important; color: #0a121c !important;
  box-shadow: 0 8px 20px rgba(212,175,55,0.4) !important;
}
.kiff-v18-chip-ic { font-size: 1.4rem; flex-shrink: 0; }
.kiff-v18-chip-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.kiff-v18-chip-ttl { font-size: 0.9rem; font-weight: 800; }
.kiff-v18-chip-sub { font-size: 0.66rem; color: #9AA5B1; margin-top: 2px; }
.kiff-v18-chip.active .kiff-v18-chip-sub { color: rgba(10,18,28,0.7); }
.kiff-v18-chip-check {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(232,237,242,0.08); border: 1.5px solid rgba(232,237,242,0.15);
  display: flex; align-items: center; justify-content: center;
  color: transparent; font-size: 0.75rem; font-weight: 900; flex-shrink: 0;
}
.kiff-v18-chip.active .kiff-v18-chip-check { background: rgba(10,18,28,0.15); color: #0a121c; }

/* ═══ Type dropdown ═══ */
.kiff-v18-type { margin-bottom: 14px; position: relative; }
.kiff-v18-type-lbl { font-size: 0.82rem; font-weight: 700; color: #D4AF37; margin-bottom: 8px; }
.kiff-v18-req { color: #e74c6f; font-weight: 900; }
.kiff-v18-type-trigger {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(232,237,242,0.2); border-radius: 10px;
  color: #E8EDF2; font-size: 0.88rem; cursor: pointer; min-height: 44px;
  transition: all 0.2s;
}
.kiff-v18-type-trigger:hover { border-color: rgba(212,175,55,0.5); }
.kiff-v18-type-val { flex: 1; color: #9AA5B1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kiff-v18-type-val.has { color: #FFE08A; font-weight: 700; }
.kiff-v18-chev { color: #D4AF37; }
.kiff-v18-type-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: linear-gradient(160deg,#1e2f42,#172538);
  border: 1.5px solid rgba(212,175,55,0.5);
  border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,0.7);
  z-index: 1000; display: none; max-height: 320px; overflow: hidden;
}
.kiff-v18-type-panel.open { display: block; }
.kiff-v18-type-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.kiff-v18-type-list::-webkit-scrollbar { width: 5px; }
.kiff-v18-type-list::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.5); border-radius: 10px; }
.kiff-v18-type-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  cursor: pointer; color: #B8C5D4; font-size: 0.86rem; font-weight: 600;
}
.kiff-v18-type-opt:hover { background: rgba(212,175,55,0.12); color: #E8EDF2; }
.kiff-v18-type-opt input[type="radio"] { width: 17px; height: 17px; accent-color: #D4AF37; cursor: pointer; }
.kiff-v18-type-opt input:checked ~ span { color: #FFE08A; font-weight: 800; }

/* ═══ Genre dropdown ═══ */
.kiff-v18-genre { margin-bottom: 14px; position: relative; }
.kiff-v18-genre-lbl { font-size: 0.82rem; font-weight: 700; color: #D4AF37; margin-bottom: 8px; }
.kiff-v18-genre-trigger {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(232,237,242,0.2); border-radius: 10px;
  color: #E8EDF2; font-size: 0.88rem; cursor: pointer; min-height: 44px;
}
.kiff-v18-genre-val { flex: 1; color: #9AA5B1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kiff-v18-genre-val.has { color: #FFE08A; font-weight: 700; }
.kiff-v18-genre-count {
  background: linear-gradient(135deg,#D4AF37,#C9A03D); color: #0a121c;
  font-size: 0.66rem; font-weight: 900; padding: 2px 8px; border-radius: 20px;
  direction: ltr;
}
.kiff-v18-genre-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: linear-gradient(160deg,#1e2f42,#172538);
  border: 1.5px solid rgba(212,175,55,0.5);
  border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,0.7);
  z-index: 1000; display: none; max-height: 400px; flex-direction: column;
}
.kiff-v18-genre-panel.open { display: flex; }
.kiff-v18-genre-list { flex: 1; overflow-y: auto; padding: 8px; max-height: 320px; }
.kiff-v18-genre-list::-webkit-scrollbar { width: 5px; }
.kiff-v18-genre-list::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.5); border-radius: 10px; }
.kiff-v18-genre-group { margin-bottom: 4px; }
.kiff-v18-genre-parent {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: rgba(255,255,255,0.03);
  border-radius: 8px; cursor: pointer;
}
.kiff-v18-genre-parent:hover { background: rgba(212,175,55,0.12); }
.kiff-v18-genre-parent input { width: 17px; height: 17px; accent-color: #D4AF37; cursor: pointer; }
.kiff-v18-genre-parent span { font-size: 0.86rem; font-weight: 700; color: #E8EDF2; }
.kiff-v18-subs { padding: 4px 0 4px 20px; margin-right: 8px; border-right: 2px dashed rgba(212,175,55,0.3); display: none; }
.kiff-v18-sub {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; cursor: pointer; border-radius: 6px;
}
.kiff-v18-sub:hover { background: rgba(212,175,55,0.08); }
.kiff-v18-sub input { width: 15px; height: 15px; accent-color: #D4AF37; }
.kiff-v18-sub span { font-size: 0.8rem; color: #B8C5D4; font-weight: 600; }
.kiff-v18-genre-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: rgba(0,0,0,0.25);
  border-top: 1px solid rgba(232,237,242,0.08);
}
.kiff-v18-genre-hint { font-size: 0.7rem; color: #8B98A8; }
.kiff-v18-genre-clear {
  background: rgba(200,60,60,0.12); border: 1px solid rgba(200,60,60,0.35);
  color: #ff9b82; padding: 5px 12px; border-radius: 18px;
  font-family: inherit; font-size: 0.74rem; font-weight: 700; cursor: pointer;
}

/* ═══ درخت بخش‌ها (تب ۴) ═══ */
.kiff-v18-section-tree {
  display: flex; flex-direction: column; gap: 10px;
}
.kiff-v18-sec-group {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(232,237,242,0.1);
  border-radius: 12px; overflow: hidden;
}
.kiff-v18-sec-parent {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; cursor: pointer;
  background: rgba(212,175,55,0.04);
  border-bottom: 1px solid rgba(212,175,55,0.1);
  font-weight: 700; font-size: 0.9rem; color: #E8EDF2;
  transition: 0.2s;
}
.kiff-v18-sec-parent:hover { background: rgba(212,175,55,0.1); }
.kiff-v18-sec-parent input { width: 18px; height: 18px; accent-color: #D4AF37; cursor: pointer; }
.kiff-v18-sec-children {
  display: none; padding: 8px 16px 12px 32px;
}
.kiff-v18-sec-child {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; cursor: pointer; border-radius: 8px;
  transition: 0.15s;
}
.kiff-v18-sec-child:hover { background: rgba(255,255,255,0.03); }
.kiff-v18-sec-child input { width: 15px; height: 15px; accent-color: #D4AF37; }
.kiff-v18-sec-child span { font-size: 0.84rem; color: #B8C5D4; }

/* ═══ شمارنده لاگ‌لاین ═══ */
.kiff-v18-counter {
  font-size: 0.72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  background: rgba(255,255,255,0.04); color: #9AA5B1;
  direction: ltr; transition: 0.2s;
  font-family: monospace, 'Vazirmatn';
}
.kiff-v18-counter.ok { background: rgba(76,175,80,0.1); color: #6fcf8f; }
.kiff-v18-counter.warn { background: rgba(255,180,70,0.15); color: #ffb347; }
.kiff-v18-counter.danger { background: rgba(200,60,60,0.15); color: #e07070; }

/* ═══ موبایل ═══ */
@media (max-width: 640px) {
  .kiff-v18-chips { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kiff-v18-chip { min-height: 52px; padding: 8px 10px !important; }
  .kiff-v18-chip-ic { font-size: 1.15rem; }
  .kiff-v18-chip-ttl { font-size: 0.8rem; }
  .kiff-v18-chip-sub { display: none; }
}
/* ═══ Tips (جمله‌های تشویقی) ═══ */
.kiff-v18-tips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(212,175,55,.06), rgba(212,175,55,.02));
  border: 1px solid rgba(212,175,55,.2);
  border-radius: 12px;
}
.kiff-v18-tip-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #C5CED6;
}
.kiff-v18-tip-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(212,175,55,.4));
}
.kiff-v18-tip-text { flex: 1; }
@media (max-width: 480px) {
  .kiff-v18-tip-item { font-size: 0.76rem; gap: 8px; }
}