/* Brokerr Training — Studio styles. Premium, preview-driven 3-pane builder. */

/* ---------- Course list ---------- */
.tr-course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 8px; }
.tr-course-card {
  display: flex; flex-direction: column; gap: 10px; padding: 22px;
  background: var(--color-surface, #fff); border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-xl, 16px); text-decoration: none; color: inherit;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.tr-course-card:hover { box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,.10)); transform: translateY(-2px); border-color: var(--color-primary, #4f46e5); }
.tr-course-card__top { display: flex; gap: 8px; }
.tr-course-card__title { font-size: var(--font-size-lg, 1.1rem); font-weight: var(--font-weight-semibold, 600); margin: 2px 0; }
.tr-course-card__desc { color: var(--color-text-secondary, #6b7280); font-size: var(--font-size-sm, .9rem); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tr-course-card__meta { display: flex; gap: 8px; color: var(--color-text-muted, #9ca3af); font-size: var(--font-size-sm, .85rem); margin-top: auto; }

/* ---------- Badges / chips ---------- */
.tr-badge { display: inline-block; padding: 3px 10px; border-radius: var(--radius-full, 999px); font-size: var(--font-size-xs, .72rem); font-weight: var(--font-weight-semibold, 600); letter-spacing: .02em; }
.tr-badge--live { background: var(--color-success-light, #dcfce7); color: var(--color-success, #16a34a); }
.tr-badge--draft { background: var(--color-gray-100, #f3f4f6); color: var(--color-gray-600, #4b5563); }
.tr-badge--mandatory { background: var(--color-warning-light, #fef3c7); color: var(--color-warning, #d97706); }
.tr-chip { padding: 2px 8px; border-radius: var(--radius-full, 999px); background: var(--color-gray-100, #f3f4f6); color: var(--color-gray-600, #4b5563); font-size: var(--font-size-xs, .72rem); }

/* ---------- Empty states ---------- */
.tr-empty { padding: 36px; text-align: center; color: var(--color-text-secondary, #6b7280); }
.tr-empty--error { color: var(--color-error, #dc2626); }
.tr-empty--cta { border: 1.5px dashed var(--color-border, #e5e7eb); border-radius: var(--radius-xl, 16px); grid-column: 1 / -1; }
.tr-empty__icon { font-size: 2.4rem; margin-bottom: 8px; }
.tr-empty--cta h3 { margin: 6px 0; } .tr-empty--cta p { margin: 0 0 16px; }

/* ================= 3-pane studio ================= */
.tr-studio { display: flex; flex-direction: column; height: calc(100vh - 120px); min-height: 560px; }
.tr-studio__bar {
  display: flex; align-items: center; gap: 16px; padding: 0 4px 14px;
  border-bottom: 1px solid var(--color-border, #e5e7eb); margin-bottom: 0;
}
.tr-back { color: var(--color-text-secondary, #6b7280); text-decoration: none; font-size: var(--font-size-sm, .9rem); white-space: nowrap; }
.tr-back:hover { color: var(--color-primary, #4f46e5); }
.tr-studio__title { display: flex; align-items: center; gap: 10px; font-weight: var(--font-weight-semibold, 600); font-size: var(--font-size-lg, 1.1rem); flex: 1; min-width: 0; }
.tr-studio__title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-studio__actions { display: flex; gap: 10px; }

.tr-studio__panes { display: grid; grid-template-columns: 260px 1fr 380px; gap: 0; flex: 1; min-height: 0; }
.tr-pane { overflow-y: auto; min-height: 0; }
.tr-pane--tree { border-right: 1px solid var(--color-border, #e5e7eb); padding: 16px 12px; }
.tr-pane--editor { padding: 22px 26px; }
.tr-pane--preview { border-left: 1px solid var(--color-border, #e5e7eb); padding: 18px; background: var(--color-gray-50, #f9fafb); display: flex; flex-direction: column; align-items: center; }

/* ---------- Left: curriculum tree ---------- */
.tr-tree__head { font-size: var(--font-size-xs, .72rem); text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted, #9ca3af); font-weight: 700; margin-bottom: 12px; padding: 0 6px; }
.tr-tree-module { margin-bottom: 8px; }
.tr-tree-module__head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 6px; }
.tr-tree-module__title { font-size: var(--font-size-sm, .88rem); font-weight: var(--font-weight-semibold, 600); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-tree-module__title b { color: var(--color-primary, #4f46e5); margin-right: 4px; }
.tr-tree-module__tools { display: flex; gap: 2px; opacity: 0; transition: opacity .15s ease; }
.tr-tree-module__head:hover .tr-tree-module__tools { opacity: 1; }
.tr-tree-lessons { display: flex; flex-direction: column; gap: 2px; padding-left: 4px; }
.tr-tree-lesson {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 8px 10px; border: none; background: none; border-radius: var(--radius-md, 8px);
  cursor: pointer; font-size: var(--font-size-sm, .88rem); color: var(--color-text, #111827);
  transition: background .12s ease;
}
.tr-tree-lesson:hover { background: var(--color-gray-100, #f3f4f6); }
.tr-tree-lesson--active { background: var(--color-primary-light, #eef2ff); color: var(--color-primary-dark, #3730a3); font-weight: 600; }
.tr-tree-lesson__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tr-tree-lesson__hidden { color: var(--color-text-muted, #9ca3af); }
.tr-tree-empty { color: var(--color-text-muted, #9ca3af); font-size: var(--font-size-xs, .78rem); padding: 4px 10px; font-style: italic; }
.tr-tree-add { width: 100%; margin-top: 10px; padding: 9px; border: 1px dashed var(--color-border, #d1d5db); background: none; border-radius: var(--radius-md, 8px); color: var(--color-text-secondary, #6b7280); cursor: pointer; font-size: var(--font-size-sm, .85rem); }
.tr-tree-add:hover { border-color: var(--color-primary, #4f46e5); color: var(--color-primary, #4f46e5); }
.tr-mini { border: none; background: var(--color-gray-100, #f3f4f6); color: var(--color-gray-600, #4b5563); width: 22px; height: 22px; border-radius: var(--radius-sm, 6px); cursor: pointer; font-size: .8rem; line-height: 1; }
.tr-mini:hover { background: var(--color-gray-200, #e5e7eb); }
.tr-mini--danger:hover { background: var(--color-error-light, #fee2e2); color: var(--color-error, #dc2626); }

/* ---------- Middle: editor ---------- */
.tr-editor { max-width: 640px; }
.tr-editor__row { display: flex; gap: 14px; }
.tr-editor__section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--color-gray-100, #f3f4f6); }
.tr-editor__section h4 { margin: 0 0 12px; font-size: var(--font-size-base, 1rem); }
.tr-editor__foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--color-gray-100, #f3f4f6); display: flex; align-items: center; justify-content: space-between; }
.tr-editor-empty { text-align: center; color: var(--color-text-secondary, #6b7280); padding: 60px 20px; }
.tr-editor-empty h3 { margin: 8px 0 6px; }

.tr-field { display: block; margin-bottom: 0; }
.tr-field--grow { flex: 1; }
.tr-field > span { display: block; font-size: var(--font-size-sm, .86rem); font-weight: var(--font-weight-medium, 500); margin-bottom: 5px; }
.tr-field em { color: var(--color-text-muted, #9ca3af); font-style: normal; }
.tr-field input, .tr-field textarea, .tr-field select { width: 100%; padding: 10px 12px; border: 1px solid var(--color-border, #e5e7eb); border-radius: var(--radius-md, 8px); font-family: inherit; font-size: var(--font-size-base, 1rem); box-sizing: border-box; }
.tr-field input:focus, .tr-field textarea:focus, .tr-field select:focus { outline: none; border-color: var(--color-primary, #4f46e5); box-shadow: 0 0 0 3px var(--color-primary-light, rgba(79,70,229,.15)); }
.tr-check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: var(--font-size-sm, .9rem); }
.tr-hint { color: var(--color-text-muted, #9ca3af); font-size: var(--font-size-xs, .75rem); font-weight: 400; }
.btn-sm { padding: 6px 12px; font-size: var(--font-size-sm, .85rem); }

/* Media segmented control */
.tr-media-switch { display: inline-flex; gap: 4px; padding: 4px; background: var(--color-gray-100, #f3f4f6); border-radius: var(--radius-full, 999px); margin-bottom: 14px; }
.tr-seg { border: none; background: none; padding: 7px 16px; border-radius: var(--radius-full, 999px); cursor: pointer; font-size: var(--font-size-sm, .86rem); color: var(--color-text-secondary, #6b7280); }
.tr-seg--on { background: var(--color-surface, #fff); color: var(--color-text, #111827); font-weight: 600; box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.08)); }

/* Dropzone + progress */
.tr-dropzone { display: block; border: 1.5px dashed var(--color-border, #d1d5db); border-radius: var(--radius-lg, 12px); padding: 26px; text-align: center; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.tr-dropzone:hover, .tr-dropzone--over { border-color: var(--color-primary, #4f46e5); background: var(--color-primary-light, #eef2ff); }
.tr-dropzone__icon { font-size: 2rem; }
.tr-dropzone__text { font-weight: 600; margin: 8px 0 4px; }
.tr-progress { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.tr-progress__bar { flex: 1; height: 8px; background: var(--color-gray-200, #e5e7eb); border-radius: 999px; overflow: hidden; position: relative; }
.tr-progress__bar::after { content: ''; }
#tr-progress-bar { height: 100%; width: 0%; background: var(--color-primary, #4f46e5); border-radius: 999px; transition: width .2s ease; }
.tr-progress { position: relative; }
.tr-progress #tr-progress-bar { position: absolute; left: 0; top: 0; }
.tr-record { padding: 8px 0; }
.tr-rec-controls { display: flex; gap: 8px; margin: 8px 0; }
#tr-rec-preview { width: 100%; margin-top: 10px; }
.tr-status { font-size: var(--font-size-sm, .9rem); color: var(--color-text-secondary, #6b7280); margin: 0 0 8px; }

.tr-att-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.tr-att-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; background: var(--color-gray-50, #f9fafb); border-radius: var(--radius-md, 8px); font-size: var(--font-size-sm, .9rem); }
.tr-save-state { font-size: var(--font-size-xs, .78rem); color: var(--color-text-muted, #9ca3af); }
.tr-save-state--warn { color: var(--color-warning, #d97706); }

/* ---------- Right: phone live preview ---------- */
.tr-preview-label { font-size: var(--font-size-xs, .72rem); text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-muted, #9ca3af); font-weight: 700; margin-bottom: 14px; text-align: center; }
.tr-phone { width: 300px; max-width: 100%; height: 600px; background: #0b0b0f; border-radius: 34px; padding: 12px; box-shadow: var(--shadow-xl, 0 24px 64px rgba(0,0,0,.24)); }
.tr-phone__screen { width: 100%; height: 100%; background: #fff; border-radius: 24px; overflow-y: auto; }
.tr-lp { display: flex; flex-direction: column; min-height: 100%; }
.tr-lp-top { padding: 14px 16px; font-size: .75rem; font-weight: 700; color: var(--color-text-muted, #9ca3af); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--color-gray-100, #f3f4f6); }
.tr-lp-video { width: 100%; aspect-ratio: 16/9; background: #000; display: block; }
.tr-lp-media-empty { width: 100%; aspect-ratio: 16/9; background: var(--color-gray-100, #f3f4f6); display: flex; align-items: center; justify-content: center; color: var(--color-text-muted, #9ca3af); font-size: .85rem; }
.tr-lp-audio { padding: 20px 16px; text-align: center; }
.tr-lp-audio__art { font-size: 2.6rem; margin-bottom: 10px; }
.tr-lp-audio audio { width: 100%; }
.tr-lp-title { font-size: 1.15rem; margin: 14px 16px 6px; }
.tr-lp-desc { margin: 0 16px 12px; color: var(--color-text-secondary, #6b7280); font-size: .88rem; line-height: 1.5; }
.tr-lp-atts { margin: 0 16px 12px; display: flex; flex-direction: column; gap: 6px; }
.tr-lp-att { padding: 9px 12px; background: var(--color-gray-50, #f9fafb); border: 1px solid var(--color-gray-100, #f3f4f6); border-radius: var(--radius-md, 8px); font-size: .82rem; }
.tr-lp-cta { margin: auto 16px 16px; padding: 12px; border: none; border-radius: var(--radius-md, 10px); background: var(--color-primary, #4f46e5); color: #fff; font-weight: 600; cursor: default; }
.tr-lp-empty, .tr-lp-media-empty { }
.tr-lp-empty { padding: 40px 20px; text-align: center; color: var(--color-text-muted, #9ca3af); font-size: .85rem; }

/* ---------- Modal ---------- */
.tr-modal-overlay { position: fixed; inset: 0; background: rgba(17,24,39,.5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 1000; backdrop-filter: blur(2px); }
.tr-modal { background: var(--color-surface, #fff); border-radius: var(--radius-xl, 16px); width: 100%; max-width: 460px; box-shadow: var(--shadow-xl, 0 24px 64px rgba(0,0,0,.24)); max-height: 90vh; display: flex; flex-direction: column; }
.tr-modal__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--color-border, #e5e7eb); }
.tr-modal__head h2 { margin: 0; font-size: var(--font-size-lg, 1.15rem); }
.tr-modal__close { border: none; background: none; font-size: 1.1rem; cursor: pointer; color: var(--color-text-muted, #9ca3af); }
.tr-modal__body { padding: 22px; overflow-y: auto; }
.tr-modal__body .tr-field { margin-bottom: 14px; }
.tr-modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--color-border, #e5e7eb); }
.btn-danger { background: var(--color-error, #dc2626); color: #fff; border: none; }
.btn-danger:hover { background: #b91c1c; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .tr-studio__panes { grid-template-columns: 240px 1fr; }
  .tr-pane--preview { display: none; }
}
@media (max-width: 720px) {
  .tr-course-grid { grid-template-columns: 1fr; }
  .tr-studio { height: auto; }
  .tr-studio__panes { grid-template-columns: 1fr; }
  .tr-pane--tree { border-right: none; border-bottom: 1px solid var(--color-border, #e5e7eb); }
  .tr-studio__bar { flex-wrap: wrap; }
}
