/* CourseOS · Courses Screen
   Four course cards with illustrated headers and five mini tabs each.
   Overview, Assignments, Syllabus, Materials, Agent tabs per course. */

/* Screen header */
.courses-header {
  padding: var(--space-md) var(--space-md) var(--space-sm);
}

.courses-title {
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--text-primary);
}

.courses-subtitle {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Course card */
.course-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: var(--border-width) solid var(--border-color);
  margin: 0 var(--space-md) var(--space-md);
  overflow: hidden;
}

/* Illustrated header banner */
.course-card-banner {
  padding: var(--space-md) var(--space-md) var(--space-sm);
  color: #fff;
  position: relative;
  min-height: 80px;
}

.course-card-banner-code {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.85;
}

.course-card-banner-name {
  font-size: var(--font-lg);
  font-weight: 700;
  margin-top: 4px;
  line-height: 1.2;
}

.course-card-banner-instructor {
  font-size: var(--font-sm);
  opacity: 0.9;
  margin-top: 4px;
}

/* Course info row below banner */
.course-card-info {
  padding: var(--space-sm) var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: var(--border-width) solid var(--border-color);
}

.course-card-schedule {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  line-height: 1.4;
}

.course-card-due-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* Five mini tabs */
.course-tabs {
  display: flex;
  border-bottom: var(--border-width) solid var(--border-color);
}

.course-tab {
  flex: 1;
  padding: 8px 0;
  text-align: center;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.course-tab.active {
  color: var(--text-primary);
  border-bottom-color: currentColor;
}

/* Tab content area */
.course-tab-content {
  padding: var(--space-md);
  min-height: 60px;
}

/* Overview tab */
.overview-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: var(--border-width) solid var(--gray-100);
  font-size: var(--font-sm);
}

.overview-row:last-child {
  border-bottom: none;
}

.overview-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.overview-value {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  max-width: 60%;
}

/* Assignments tab */
.assignment-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: 8px 0;
  border-bottom: var(--border-width) solid var(--gray-100);
}

.assignment-row:last-child {
  border-bottom: none;
}

.assignment-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.assignment-row-content {
  flex: 1;
}

.assignment-row-title {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.assignment-row-meta {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Syllabus tab */
.syllabus-section {
  margin-bottom: var(--space-md);
}

.syllabus-section-title {
  font-size: var(--font-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.syllabus-rule {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 4px 0;
}

.syllabus-rule.warning {
  color: var(--color-red);
  font-weight: 600;
}

/* Grade weight bars */
.grade-bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 6px;
}

.grade-bar-label {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  width: 90px;
  flex-shrink: 0;
}

.grade-bar-track {
  flex: 1;
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
}

.grade-bar-fill {
  height: 100%;
  border-radius: 4px;
}

.grade-bar-pct {
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--text-primary);
  width: 30px;
  text-align: right;
}

/* Materials tab */
.material-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 0;
  border-bottom: var(--border-width) solid var(--gray-100);
}

.material-item:last-child {
  border-bottom: none;
}

.material-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.material-info {
  flex: 1;
}

.material-title {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.material-detail {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  margin-top: 1px;
}

/* Agent tab · Chat UI */
.agent-restriction {
  font-size: var(--font-xs);
  color: var(--color-red);
  font-weight: 600;
  padding: 6px 10px;
  background: #FEF0F0;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  text-align: center;
}

.agent-chat {
  min-height: 180px;
  max-height: 300px;
  overflow-y: auto;
  padding: var(--space-sm) 0;
}

.agent-welcome {
  text-align: center;
  padding: var(--space-md) 0;
}

.agent-icon {
  font-size: 32px;
  margin-bottom: var(--space-xs);
}

.agent-welcome-text {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.agent-msg {
  display: flex;
  margin-bottom: var(--space-xs);
}

.agent-msg-user {
  justify-content: flex-end;
}

.agent-msg-bot {
  justify-content: flex-start;
}

.agent-msg-bubble {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  line-height: 1.5;
  word-wrap: break-word;
}

.agent-msg-user .agent-msg-bubble {
  background: var(--color-red);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.agent-msg-bot .agent-msg-bubble {
  background: var(--gray-100);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.agent-typing {
  color: var(--text-muted);
  font-style: italic;
}

.agent-input-bar {
  display: flex;
  gap: var(--space-xs);
  padding-top: var(--space-sm);
  border-top: var(--border-width) solid var(--gray-100);
}

.agent-input {
  flex: 1;
  padding: 8px 12px;
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.agent-input:focus {
  outline: none;
  border-color: var(--color-blue);
}

.agent-input::placeholder {
  color: var(--text-muted);
}

.agent-send-btn {
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: var(--font-sm);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* ── Messages Tab ──────────────────────────────────────────────────── */

.msg-item {
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xs);
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.1s ease;
}

.msg-item:active {
  background: var(--gray-100);
}

.msg-item.expanded {
  border-color: var(--color-purple);
  background: #FAFAFF;
}

.msg-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 12px;
}

.msg-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.msg-header-content {
  flex: 1;
  min-width: 0;
}

.msg-from {
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.msg-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-red);
  flex-shrink: 0;
}

.msg-subject {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.msg-date {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 1px;
}

.msg-chevron {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.msg-body {
  padding: 0 12px 12px;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  border-top: var(--border-width) solid var(--gray-100);
  padding-top: 10px;
  margin-top: 0;
}

.msg-attachments {
  padding: 8px 12px 12px;
}

.msg-attachments-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.msg-attachment-item {
  font-size: 11px;
  color: var(--color-blue);
  padding: 4px 0;
  border-bottom: var(--border-width) solid var(--gray-100);
}
