/**
 * static/css/modules/admin_coaching.css
 * ──────────────────────────────────────
 * Teacher & Coaching Hub: 3-Frame Master-Detail & Inspector Layout
 */

/* ── Main Workspace ── */
.coaching-workspace {
  display: flex;
  flex: 1;
  height: calc(100vh - 60px);
  overflow: hidden;
  position: relative;
  background: var(--bg1, #121214);
}

/* ── FRAME 1: Students Directory ── */
.coaching-frame-students {
  width: 280px;
  min-width: 260px;
  max-width: 320px;
  background: var(--bg2, #18181b);
  border-right: 1px solid var(--border, #27272a);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.coaching-frame-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #27272a);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg2, #18181b);
}

.coaching-frame-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text1, #f4f4f5);
  display: flex;
  align-items: center;
  gap: 6px;
}

.coaching-search-wrap {
  position: relative;
  width: 100%;
}

.coaching-search-input {
  width: 100%;
  padding: 7px 12px;
  font-size: 12.5px;
  background: var(--bg1, #121214);
  border: 1px solid var(--border, #27272a);
  border-radius: 6px;
  color: var(--text1, #fff);
  outline: none;
  transition: border-color 0.15s ease;
}

.coaching-search-input:focus {
  border-color: var(--accent, #a855f7);
}

.coaching-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.coaching-chip {
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  background: var(--bg3, #222226);
  border: 1px solid var(--border, #27272a);
  color: var(--text2, #a1a1aa);
  cursor: pointer;
  transition: all 0.15s ease;
}

.coaching-chip:hover {
  background: var(--border, #27272a);
  color: var(--text1, #fff);
}

.coaching-chip.active {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--accent, #a855f7);
  color: #c084fc;
}

.coaching-students-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Student List Cards ── */
.coaching-student-card {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg1, #121214);
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.coaching-student-card:hover {
  background: var(--bg3, #222226);
  border-color: var(--border, #27272a);
}

.coaching-student-card.active {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.4);
}

.coaching-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.coaching-card-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg3, #27272a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.coaching-card-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.coaching-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text1, #f4f4f5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coaching-card-sub {
  font-size: 11px;
  color: var(--text3, #71717a);
  display: flex;
  align-items: center;
  gap: 6px;
}

.coaching-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.coaching-dot.online { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.4); }
.coaching-dot.recent { background: #eab308; }
.coaching-dot.inactive { background: #71717a; }

.coaching-fail-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  white-space: nowrap;
}

/* ── FRAME 2: Selected Student Dashboard ── */
.coaching-frame-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg1, #121214);
}

.coaching-student-banner {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border, #27272a);
  background: var(--bg2, #18181b);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.coaching-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.coaching-status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: capitalize;
}

.coaching-status-pill.online {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.coaching-status-pill.recent {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.coaching-status-pill.inactive {
  background: rgba(113, 113, 122, 0.15);
  color: #a1a1aa;
  border: 1px solid rgba(113, 113, 122, 0.3);
}

/* ── Tabs Bar ── */
.coaching-tabs-bar {
  display: flex;
  border-bottom: 1px solid var(--border, #27272a);
  background: var(--bg2, #18181b);
  padding: 0 24px;
  gap: 8px;
}

.coaching-tab-btn {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text3, #71717a);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.coaching-tab-btn:hover {
  color: var(--text1, #fff);
}

.coaching-tab-btn.active {
  color: var(--accent, #c084fc);
  border-bottom-color: var(--accent, #a855f7);
}

.coaching-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  flex-direction: column;
  gap: 24px;
}

.coaching-tab-content.active {
  display: flex;
}

.coaching-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  color: var(--text1, #f4f4f5);
  margin-bottom: 12px;
}

.coaching-count-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ── Cycle Cards ── */
.coaching-cycles-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.coaching-cycle-card {
  padding: 12px 14px;
  background: var(--bg2, #18181b);
  border: 1px solid var(--border, #27272a);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.coaching-cycle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.coaching-cycle-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text1, #fff);
}

.coaching-cycle-status {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.coaching-cycle-status.completed {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.coaching-cycle-status.in_progress {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.coaching-cycle-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text3, #a1a1aa);
}

.coaching-cycle-stat-val {
  font-weight: 600;
  color: var(--text1, #fff);
}

/* ── Tables ── */
.coaching-table-wrap {
  border: 1px solid var(--border, #27272a);
  border-radius: 8px;
  background: var(--bg2, #18181b);
  overflow: hidden;
}

.coaching-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.coaching-table th {
  padding: 10px 14px;
  background: var(--bg3, #222226);
  color: var(--text3, #a1a1aa);
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid var(--border, #27272a);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.coaching-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, #27272a);
  color: var(--text2, #d4d4d8);
}

.coaching-table tr:last-child td {
  border-bottom: none;
}

.coaching-table tr.clickable {
  cursor: pointer;
  transition: background 0.15s ease;
}

.coaching-table tr.clickable:hover {
  background: rgba(168, 85, 247, 0.08);
}

.coaching-table tr.selected {
  background: rgba(168, 85, 247, 0.15);
}

/* ── Timeline Feed ── */
.coaching-timeline-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.coaching-timeline-item {
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--bg2, #18181b);
  border: 1px solid var(--border, #27272a);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.coaching-timeline-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--bg3, #27272a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.coaching-timeline-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.coaching-timeline-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text1, #f4f4f5);
}

.coaching-timeline-meta {
  font-size: 11.5px;
  color: var(--text3, #71717a);
}

/* ── FRAME 3: Interactive Inspector ── */
.coaching-frame-inspector {
  width: 340px;
  min-width: 320px;
  max-width: 380px;
  background: var(--bg2, #18181b);
  border-left: 1px solid var(--border, #27272a);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.coaching-inspector-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #27272a);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.coaching-inspector-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.coaching-board-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.coaching-cg-board {
  width: 280px;
  height: 280px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border, #3f3f46);
}

.coaching-board-turn-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--bg3, #27272a);
  color: var(--text2, #d4d4d8);
  border: 1px solid var(--border, #3f3f46);
}

.coaching-stepper-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 0;
}

.coaching-inspector-card {
  padding: 12px 14px;
  background: var(--bg1, #121214);
  border: 1px solid var(--border, #27272a);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.coaching-card-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text3, #a1a1aa);
  letter-spacing: 0.04em;
}

.coaching-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.coaching-info-label {
  color: var(--text3, #a1a1aa);
}

.coaching-info-val {
  font-weight: 600;
  color: var(--text1, #f4f4f5);
}

.coaching-info-val.wrong {
  color: #ef4444;
  font-family: 'IBM Plex Mono', monospace;
  background: rgba(239, 68, 68, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

.coaching-info-val.solution {
  color: #22c55e;
  font-family: 'IBM Plex Mono', monospace;
  background: rgba(34, 197, 94, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

.coaching-placeholder-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 40px 20px;
}

.coaching-loading {
  padding: 24px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text3, #71717a);
}

/* ── Responsive adjustments ── */
@media (max-width: 992px) {
  .coaching-frame-inspector {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.6);
    transform: translateX(100%);
    transition: transform 0.2s ease;
  }
  .coaching-frame-inspector.open {
    transform: translateX(0);
  }
}
