/* ── Component: TrainingPanel ──
 * Class prefix: training-
 */

/* ── Training Mode — Amber/Gold Theme ──────────────────────────────── */

.training-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgba(20, 16, 8, 0.95);
  overflow-y: auto;
}

.training-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.08));
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  flex-shrink: 0;
}

.training-header-icon {
  font-size: 1.4rem;
}

.training-header-title {
  flex: 1;
  font-weight: 600;
  font-size: 1rem;
  color: #f5c542;
  letter-spacing: 0.02em;
}

.training-exit-btn {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #f5c542;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.training-exit-btn:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.5);
}

/* ── Input Section ───────────────────────────────────────────── */

.training-input-section {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.training-textarea {
  width: 100%;
  min-height: 100px;
  padding: 14px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 12px;
  color: #e5e5e5;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.training-textarea:focus {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.1);
}

.training-textarea::placeholder {
  color: rgba(245, 158, 11, 0.4);
}

.training-char-count {
  text-align: right;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.training-char-count.near-limit {
  color: #f59e0b;
}

/* ── Scope Toggle ────────────────────────────────────────────── */

.training-scope-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.training-scope-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-right: 4px;
}

.training-scope-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  border: 1px solid rgba(245, 158, 11, 0.2);
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s;
}

.training-scope-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #f5c542;
}

.training-scope-btn:hover:not(.active) {
  border-color: rgba(245, 158, 11, 0.3);
  color: rgba(255, 255, 255, 0.7);
}

/* ── Save Button ─────────────────────────────────────────────── */

.training-save-btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  cursor: pointer;
  transition: all 0.2s;
  align-self: flex-start;
}

.training-save-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  transform: translateY(-1px);
}

.training-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Status Message ──────────────────────────────────────────── */

.training-status {
  padding: 0 20px;
  font-size: 0.8rem;
  min-height: 1.2em;
}

.training-status.success {
  color: #34d399;
}

.training-status.error {
  color: #f87171;
}

/* ── Entries Section ─────────────────────────────────────────── */

.training-entries-section {
  flex: 1;
  padding: 0 20px 20px;
  overflow-y: auto;
}

.training-entries-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.training-entries-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.training-empty {
  text-align: center;
  padding: 24px 16px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.82rem;
}

.training-entry {
  padding: 12px 14px;
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.12);
  border-radius: 10px;
  transition: border-color 0.2s;
}

.training-entry:hover {
  border-color: rgba(245, 158, 11, 0.25);
}

.training-entry-text {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.training-entry-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.training-entry-scope {
  font-size: 0.72rem;
  color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
}

.training-entry-delete {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.training-entry-delete:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

/* ── Training mode indicator on sidebar ──────────────────────── */

.training-mode-active .sv-avatar-ring {
  --agent-color: #f59e0b !important;
}

.training-mode-active .sv-agent-name {
  color: #f5c542;
}

.training-mode-active .sv-agent-role {
  color: #f59e0b !important;
}

.training-mode-active .sv-sidebar {
  border-right-color: rgba(245, 158, 11, 0.2);
}

/* ── Profile card action buttons (contact-card style) ────────── */

.sv-profile-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.sv-profile-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 64px;
}

.sv-profile-action:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
}

.sv-profile-action-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.sv-profile-action-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Training active state on the train action button */
.training-mode-active .sv-profile-action:first-child {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #f5c542;
}

/* ── Actions Row (Save + Upload) ────────────────────────────── */

.training-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.training-upload-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
  color: #f5c542;
  cursor: pointer;
  transition: all 0.2s;
}

.training-upload-btn:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.5);
}

.training-upload-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.training-upload-btn svg {
  flex-shrink: 0;
}

/* ── Upload Progress ────────────────────────────────────────── */

.training-upload-progress {
  padding: 0 20px;
  margin-bottom: 4px;
}

.training-upload-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 8px;
}

.training-upload-label {
  font-size: 0.8rem;
  color: #f5c542;
  flex: 1;
}

.training-upload-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(245, 158, 11, 0.2);
  border-top-color: #f5c542;
  border-radius: 50%;
  animation: training-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes training-spin {
  to { transform: rotate(360deg); }
}

/* ── Document entries ───────────────────────────────────────── */

.training-docs-section {
  flex: none;
}

.training-doc-entry {
  padding: 10px 14px;
}

.training-doc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.training-doc-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.training-doc-name {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
