/* ============================================================================
   Workhub — Form styles
   ============================================================================ */

.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

label.form-label {
  display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text);
}
label.form-label .required { color: var(--danger); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; }
.form-input.has-error, .form-select.has-error, .form-textarea.has-error { border-color: var(--danger); }

.form-checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.form-checkbox-row input { width: 16px; height: 16px; accent-color: var(--accent); }

/* Dropzone for screenshots / videos / logs */
.tf-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color .15s ease, background .15s ease;
}
.tf-dropzone:hover, .tf-dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.tf-dropzone i { font-size: 24px; margin-bottom: 8px; display: block; }
.tf-dropzone input[type="file"] { display: none; }

.tf-file-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 6px 10px; border-radius: var(--radius-sm); font-size: 12.5px; margin: 4px 6px 0 0;
}
.tf-file-chip button { background: none; border: none; color: var(--text-muted); cursor: pointer; }

/* Tag / label multi-select input */
.tf-tag-input {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
}
.tf-tag-input input { border: none; outline: none; background: transparent; flex: 1; min-width: 100px; font-size: 13px; color: var(--text); }
.tf-tag-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent);
  padding: 3px 9px; border-radius: 100px; font-size: 12px; font-weight: 600;
}
.tf-tag-chip button { background: none; border: none; color: inherit; cursor: pointer; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }

/* Rich text editor (used by the Content composer) */
.tf-richtext-toolbar {
  display: flex; flex-wrap: wrap; gap: 2px;
  border: 1px solid var(--border); border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--surface-2); padding: 6px;
}
.tf-richtext-btn {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: var(--radius-sm);
  color: var(--text); cursor: pointer; font-size: 13px;
}
.tf-richtext-btn:hover { background: var(--surface); }
.tf-richtext-btn.active { background: var(--accent-soft); color: var(--accent); }
.tf-richtext-sep { width: 1px; background: var(--border); margin: 4px 4px; }
.tf-richtext-editor {
  width: 100%; min-height: 220px; max-height: 420px; overflow-y: auto;
  padding: 12px; border: 1px solid var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 14px; font-family: var(--font-body); line-height: 1.6;
}
.tf-richtext-editor:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tf-richtext-editor ul, .tf-richtext-editor ol { padding-left: 22px; margin: 6px 0; }
.tf-richtext-editor h2 { font-size: 18px; font-weight: 700; margin: 10px 0 4px; }
.tf-richtext-editor h3 { font-size: 15px; font-weight: 700; margin: 8px 0 4px; }
.tf-richtext-editor blockquote { border-left: 3px solid var(--accent); padding-left: 10px; color: var(--text-muted); margin: 6px 0; }
.tf-richtext-editor a { color: var(--accent); text-decoration: underline; }
.tf-richtext-editor:empty:before { content: attr(data-placeholder); color: var(--text-muted); }

/* Study / exam list builder (used by the Content composer for study_list type) */
.tf-studylist-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); margin-bottom: 8px;
}
.tf-studylist-num {
  flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 4px;
}
.tf-studylist-fields { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tf-studylist-fields input, .tf-studylist-fields textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 13.5px; font-family: var(--font-body); resize: vertical;
}
.tf-studylist-fields input:focus, .tf-studylist-fields textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tf-studylist-actions { flex: none; display: flex; flex-direction: column; gap: 2px; }
.tf-studylist-actions button {
  width: 26px; height: 22px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: 4px;
}
.tf-studylist-actions button:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.tf-studylist-actions button:disabled { opacity: .3; cursor: default; }
.tf-studylist-actions button.tf-studylist-remove:hover { color: var(--danger); }
.tf-studylist-add {
  width: 100%; padding: 10px; border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer;
}
.tf-studylist-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}
