/* ================================================================
   TTU Student Cloud — UI Components
================================================================ */

/* ════════════════════════
   BUTTONS
════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 9px 18px;
  border-radius: var(--r); font-weight: 700; font-size: 13.5px;
  min-height: 40px; transition: all var(--t); cursor: pointer;
  white-space: nowrap; border: none;
}
.btn i { font-size: 17px; }
.btn-primary   { background: var(--primary); color: white; box-shadow: 0 4px 14px rgba(10,42,122,.3); }
.btn-primary:hover { background: var(--primary-mid); box-shadow: 0 6px 20px rgba(10,42,122,.4); transform: translateY(-1px); }
.btn-primary:active { transform: none; box-shadow: none; }
.btn-accent    { background: var(--accent); color: var(--primary-dark); box-shadow: 0 4px 14px rgba(255,193,7,.3); }
.btn-accent:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-ghost     { background: var(--surface-2); color: var(--text-2); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--border); }
.btn-danger    { background: var(--crimson-light); color: var(--crimson); border: 1.5px solid #fecdd3; }
.btn-danger:hover { background: #fecdd3; }
.btn-outline   { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-success   { background: var(--success-light); color: var(--success); border: 1.5px solid #a7f3d0; }
.btn-sm { padding: 6px 14px; font-size: 12.5px; min-height: 32px; border-radius: var(--r-sm); }
.btn-sm i { font-size: 15px; }
.btn-lg { padding: 12px 24px; font-size: 15px; min-height: 46px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ════════════════════════
   CARDS
════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 15px; font-weight: 800; letter-spacing: -.2px; }
.card-body  { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* Stat card */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 16px;
  transition: box-shadow var(--t), transform var(--t);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-icon {
  width: 48px; height: 48px; border-radius: var(--r);
  display: grid; place-items: center; font-size: 22px; flex-shrink: 0;
}
.si-blue   { background: var(--primary-light); color: var(--primary); }
.si-green  { background: var(--success-light); color: var(--success); }
.si-orange { background: var(--warning-light); color: var(--warning); }
.si-red    { background: var(--crimson-light); color: var(--crimson); }
.si-yellow { background: var(--warning-light); color: var(--accent-dark); }
.si-purple { background: #f3e8ff; color: #7c3aed; }
.stat-val  { font-size: 26px; font-weight: 900; font-family: var(--font-display); letter-spacing: -.5px; }
.stat-label{ font-size: 12px; color: var(--text-3); font-weight: 600; margin-top: 2px; }
.stat-delta {
  font-size: 11.5px; font-weight: 700; margin-top: 4px;
  display: flex; align-items: center; gap: 3px;
}
.delta-up   { color: var(--success); }
.delta-down { color: var(--crimson); }

/* Course card */
.course-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm);
  cursor: pointer; transition: all var(--t2);
  display: flex; flex-direction: column;
}
.course-card:hover {
  box-shadow: var(--shadow-md); transform: translateY(-3px);
  border-color: var(--border-2);
}
.course-thumb {
  height: 130px; position: relative;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 12px 14px;
}
.course-thumb.afst { background: var(--grad-afst); }
.course-thumb.comm { background: var(--grad-comm); }
.course-thumb.comp { background: var(--grad-comp); }
.course-thumb.math { background: var(--grad-math); }
.course-thumb.eng  { background: var(--grad-eng); }
.course-code {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,.7); background: rgba(0,0,0,.25);
  padding: 3px 8px; border-radius: var(--r-xs);
}
.course-videos-badge {
  font-size: 11px; font-weight: 700; color: white;
  background: rgba(0,0,0,.35); padding: 3px 8px;
  border-radius: var(--r-xs); display: flex; align-items: center; gap: 4px;
}
.course-body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }
.course-name { font-weight: 800; font-size: 15px; letter-spacing: -.2px; margin-bottom: 3px; }
.course-lecturer { font-size: 12.5px; color: var(--text-3); margin-bottom: 12px; flex: 1; }
.course-prog-label { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 700; color: var(--text-2); margin-bottom: 5px; }
.prog-track { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; }
.prog-fill  { height: 100%; border-radius: 99px; transition: width .4s ease; }
.fill-blue   { background: var(--primary); }
.fill-green  { background: var(--success); }
.fill-orange { background: var(--warning); }
.fill-accent { background: var(--accent); }

/* Video grid card */
.vid-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm);
  cursor: pointer; transition: all var(--t2);
}
.vid-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.vid-thumb {
  height: 172px; position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.vid-thumb.afst { background: var(--grad-afst); }
.vid-thumb.comm { background: var(--grad-eng); }
.vid-thumb.comp { background: var(--grad-comp); }
.vid-thumb.math { background: var(--grad-math); }
.vid-play-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.2);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--t);
}
.vid-card:hover .vid-play-overlay { opacity: 1; }
.play-circle {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.92); display: grid; place-items: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.play-circle i { font-size: 24px; color: var(--primary); margin-left: 3px; }
.vid-dur {
  position: absolute; bottom: 9px; right: 9px;
  background: rgba(0,0,0,.78); color: white;
  font-size: 11.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 6px; font-family: var(--font-mono);
}
.vid-watched {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); display: grid; place-items: center;
}
.vid-watched i { font-size: 14px; color: var(--primary-dark); }
.vid-info { padding: 12px 14px 14px; }
.vid-title { font-weight: 700; font-size: 14px; line-height: 1.35; margin-bottom: 4px; }
.vid-meta  { font-size: 12px; color: var(--text-3); }

/* ════════════════════════
   FORMS
════════════════════════ */
.field { margin-bottom: 16px; }
.field-label {
  display: block; font-size: 12px; font-weight: 700;
  letter-spacing: .3px; color: var(--text-2);
  margin-bottom: 6px;
}
.input {
  width: 100%; padding: 10px 13px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r); font-size: 13.5px; color: var(--text);
  outline: none; transition: border-color var(--t), box-shadow var(--t);
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}
.input::placeholder { color: var(--text-3); }
.input.error { border-color: var(--crimson); }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A97B5' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px;
}
textarea.input { resize: vertical; min-height: 90px; line-height: 1.5; }

/* Toggle switch */
.switch { position: relative; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-rail {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--border-2); border-radius: 99px; transition: .25s;
}
.switch-rail::after {
  content: ''; position: absolute;
  height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: .25s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.switch input:checked + .switch-rail { background: var(--primary); }
.switch input:checked + .switch-rail::after { transform: translateX(20px); }

/* Chip */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px; border-radius: var(--r-full);
  font-size: 12.5px; font-weight: 700;
  background: var(--surface-2); border: 1.5px solid var(--border);
  color: var(--text-2); cursor: pointer; transition: all var(--t);
  white-space: nowrap;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); color: white; border-color: var(--primary); }
.chip i { font-size: 14px; }

/* Badge / tag */
.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 99px; font-size: 11px; font-weight: 700;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-accent  { background: var(--warning-light); color: var(--accent-dark); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--crimson-light); color: var(--crimson); }
.badge-info    { background: var(--info-light); color: var(--info); }
.badge-gray    { background: var(--surface-3); color: var(--text-3); }

/* ════════════════════════
   TABS
════════════════════════ */
.tabs {
  display: flex; border-bottom: 2px solid var(--border);
  gap: 2px; margin-bottom: 24px;
}
.tab-btn {
  padding: 10px 18px; font-size: 13.5px; font-weight: 700;
  color: var(--text-3); border-bottom: 2.5px solid transparent;
  margin-bottom: -2px; transition: all var(--t); cursor: pointer;
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.tab-btn i { font-size: 16px; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-color: var(--primary); }
[data-theme="dark"] .tab-btn.active { color: #7ba7ff; border-color: #7ba7ff; }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: pageFade .2s ease; }

/* ════════════════════════
   TABLES
════════════════════════ */
.table-wrap {
  overflow: auto; border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); font-size: 13.5px;
}
.data-table th {
  text-align: left; padding: 12px 16px;
  background: var(--surface-2); color: var(--text-3);
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--t); }
.data-table tbody tr:hover td { background: var(--surface-2); }

/* ════════════════════════
   MODAL / DIALOG
════════════════════════ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
  z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 24px;
}
.modal-backdrop.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column;
  animation: scaleIn .22s cubic-bezier(.34,1.56,.64,1);
}
@keyframes scaleIn { from { opacity:0; transform:scale(.94); } to { opacity:1; transform:scale(1); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 17px; font-weight: 800; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); transition: all var(--t);
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-close i { font-size: 18px; }
.modal-body { flex: 1; overflow-y: auto; padding: 22px; }
.modal-footer {
  padding: 16px 22px; border-top: 1px solid var(--border);
  background: var(--surface-2); display: flex; gap: 10px; justify-content: flex-end;
}

/* ════════════════════════
   NOTIFICATIONS PANEL
════════════════════════ */
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 360px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); z-index: 200;
  display: none; flex-direction: column;
  max-height: 480px; overflow: hidden;
  animation: scaleIn .18s ease;
}
.notif-panel.open { display: flex; }
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.notif-panel-title { font-weight: 800; font-size: 14px; }
.notif-panel-body  { flex: 1; overflow-y: auto; }
.notif-item {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  transition: background var(--t); cursor: default;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2); }
.notif-priority {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .6px; margin-bottom: 4px;
  display: flex; align-items: center; gap: 4px;
}
.prio-urgent { color: var(--crimson); }
.prio-high   { color: var(--warning); }
.prio-normal { color: var(--success); }
.notif-item-title { font-size: 13.5px; font-weight: 700; margin-bottom: 3px; }
.notif-item-body  { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }

/* ════════════════════════
   TOAST
════════════════════════ */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: #0f172a; color: white;
  padding: 12px 20px; border-radius: var(--r-full);
  font-size: 13.5px; font-weight: 700;
  opacity: 0; transition: all .28s cubic-bezier(.34,1.56,.64,1);
  z-index: 9999; pointer-events: none;
  white-space: nowrap; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 9px;
}
#toast i { font-size: 17px; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
[data-theme="dark"] #toast { background: #e2e8f0; color: #0f172a; }

/* ════════════════════════
   SKELETON
════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--surface-2) 50%, var(--border) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
  border-radius: var(--r);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ════════════════════════
   EMPTY STATE
════════════════════════ */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 56px 24px;
}
.empty-state i  { font-size: 56px; color: var(--text-3); margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.empty-state p  { font-size: 14px; color: var(--text-3); max-width: 300px; line-height: 1.5; }

/* ════════════════════════
   SECTION HEADERS
════════════════════════ */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap; gap: 10px;
}
.section-title { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.section-action { font-size: 13px; font-weight: 700; color: var(--primary); cursor: pointer; }
.section-action:hover { text-decoration: underline; }

/* ════════════════════════
   PROGRESS
════════════════════════ */
.prog-row { display: flex; align-items: center; gap: 10px; }
.prog-pct  { font-size: 12px; font-weight: 700; color: var(--text-2); min-width: 36px; text-align: right; }

/* ════════════════════════
   SETTINGS ROWS
════════════════════════ */
.settings-list {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}
.settings-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  transition: background var(--t);
}
.settings-row:last-child { border-bottom: none; }
.settings-row.clickable { cursor: pointer; }
.settings-row.clickable:hover { background: var(--surface-2); }
.settings-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; font-size: 19px; flex-shrink: 0;
}
.settings-text { flex: 1; min-width: 0; }
.settings-label { font-size: 14px; font-weight: 600; }
.settings-desc  { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.settings-arrow i { font-size: 20px; color: var(--text-3); }

/* ════════════════════════
   VIDEO PLAYER CARD
════════════════════════ */
.video-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.video-player { width: 100%; display: block; background: #000; aspect-ratio: 16/9; max-height: 460px; object-fit: contain; }
.video-info { padding: 16px 18px 0; }
.video-title { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.video-meta  { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 12px; }
.video-meta i { font-size: 15px; }
.video-controls {
  padding: 12px 18px 16px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  border-top: 1px solid var(--border); margin-top: 12px;
}
.vid-prog-wrap { margin: 8px 18px 0; }
.speed-select {
  padding: 6px 22px 6px 10px; background: var(--surface-2);
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 700; color: var(--text-2);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A97B5' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center;
  min-height: 32px; cursor: pointer;
}

/* ════════════════════════
   MATERIAL LIST ITEM
════════════════════════ */
.mat-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px; border-bottom: 1px solid var(--border);
  transition: background var(--t);
}
.mat-item:last-child { border-bottom: none; }
.mat-item:hover { background: var(--surface-2); }
.mat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center; font-size: 21px; flex-shrink: 0;
}
.mat-icon.pdf   { background: #fee2e2; color: #dc2626; }
.mat-icon.ppt   { background: var(--info-light); color: var(--info); }
.mat-icon.audio { background: var(--warning-light); color: var(--warning); }
.mat-icon.doc   { background: var(--success-light); color: var(--success); }
.mat-icon.other { background: var(--surface-3); color: var(--text-3); }
.mat-info { flex: 1; min-width: 0; }
.mat-title { font-weight: 700; font-size: 13.5px; }
.mat-meta  { font-size: 12px; color: var(--text-3); display: flex; gap: 10px; align-items: center; margin-top: 3px; }
.mat-actions { display: flex; gap: 7px; flex-shrink: 0; }
.mat-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text-2); font-size: 17px;
  transition: all var(--t);
}
.mat-btn:hover { background: var(--border); }
/* ════════════════════════
   RESPONSIVE OVERRIDES
════════════════════════ */
@media (max-width: 900px) {
  .rg-2col, .rg-2col-rev { grid-template-columns: 1fr !important; }
}
@media (max-width: 520px) {
  .rg-3col { grid-template-columns: repeat(3, 1fr) !important; gap: 6px !important; }
  .mat-item { flex-wrap: wrap; }
  .mat-info { flex-basis: 100%; order: 1; }
  .mat-actions { order: 2; margin-left: 58px; }
  .playlist-item { flex-wrap: wrap; }
}

@media (max-width: 700px) {
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab-btn { flex-shrink: 0; }
  .grid-auto { grid-template-columns: 1fr; }
  #cd-tabs + div .card-header,
  .card-header { flex-wrap: wrap; gap: 8px; }
  .video-controls { flex-wrap: wrap; }
  #cd-module-select { min-width: 0 !important; width: 100% !important; flex-basis: 100%; }
  .modal-backdrop { padding: 10px; }
  .modal-body, .modal-footer { padding: 16px; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; }
  .data-table th, .data-table td { padding: 10px; font-size: 12.5px; }
}

/* ════════════════════════
   ANNOUNCEMENT BANNER
════════════════════════ */
.ann-banner {
  background: linear-gradient(135deg, #0A2A7A 0%, #1e40af 100%);
  border-radius: var(--r-xl); padding: 22px 26px;
  color: white; position: relative; overflow: hidden;
  cursor: pointer; box-shadow: var(--shadow-md);
  margin-bottom: 28px;
}
.ann-banner::before {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 180px; height: 180px;
  background: rgba(255,193,7,.12); border-radius: 50%;
}
.ann-banner::after {
  content: ''; position: absolute; right: 60px; bottom: -50px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,.05); border-radius: 50%;
}
.ann-label {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .7px; color: var(--accent); margin-bottom: 6px;
  display: flex; align-items: center; gap: 5px;
}
.ann-title { font-size: 17px; font-weight: 900; margin: 0 0 5px; }
.ann-body  { font-size: 13.5px; opacity: .85; margin: 0; }

/* ════════════════════════
   COMMENT
════════════════════════ */
.comment-item {
  padding: 15px 18px; border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: white;
  display: grid; place-items: center; font-weight: 800; font-size: 12px; flex-shrink: 0;
}
.comment-author { font-weight: 700; font-size: 13px; flex: 1; }
.comment-time   { font-size: 11.5px; color: var(--text-3); }
.comment-body   { font-size: 14px; color: var(--text-2); line-height: 1.55; }
.comment-footer { display: flex; gap: 16px; margin-top: 10px; }
.comment-action { font-size: 12.5px; color: var(--text-3); font-weight: 600; display: flex; align-items: center; gap: 4px; transition: color var(--t); }
.comment-action:hover { color: var(--primary); }
.comment-action i { font-size: 14px; }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border-2); border-radius: var(--r-lg);
  padding: 40px 24px; text-align: center;
  cursor: pointer; transition: all var(--t2); background: var(--surface-2);
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-50); }
.upload-zone i { font-size: 48px; color: var(--text-3); margin-bottom: 12px; display: block; }
.upload-zone h4 { font-size: 15px; font-weight: 700; margin-bottom: 5px; }
.upload-zone p  { font-size: 13px; color: var(--text-3); }
.upload-prog-track { height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.upload-prog-fill  { height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s; }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 0; }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }

@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px)  { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }


/* ================================================================
   Additional components (continue-watching, playlist, etc.)
================================================================ */

/* Continue Watching items */
.cw-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--t);
}
.cw-item:last-child { border-bottom: none; }
.cw-item:hover { background: var(--surface-2); }
.cw-thumb {
  width: 54px; height: 42px; border-radius: var(--r-sm);
  display: grid; place-items: center; flex-shrink: 0;
}
.cw-thumb.afst { background: var(--grad-afst); }
.cw-thumb.comm { background: var(--grad-comm); }
.cw-thumb.comp { background: var(--grad-comp); }
.cw-thumb.math { background: var(--grad-math); }
.cw-thumb i { font-size: 20px; color: rgba(255,255,255,.85); }
.cw-info { flex: 1; min-width: 0; }
.cw-title { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-meta  { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.cw-pct   { font-size: 12px; font-weight: 800; color: var(--text-3); flex-shrink: 0; }

/* Recent Materials items */
.rm-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--t);
}
.rm-item:last-child { border-bottom: none; }
.rm-item:hover { background: var(--surface-2); }
.rm-info { flex: 1; min-width: 0; }
.rm-title { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-meta  { font-size: 11.5px; color: var(--text-3); margin-top: 3px; display: flex; align-items: center; gap: 6px; }

/* Video playlist sidebar */
.playlist-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--t);
}
.playlist-item:last-child { border-bottom: none; }
.playlist-item:hover { background: var(--surface-2); }
.playlist-item.active { background: var(--primary-50); }
[data-theme="dark"] .playlist-item.active { background: rgba(10,42,122,.25); }
.playlist-thumb {
  width: 40px; height: 32px; border-radius: var(--r-xs);
  display: grid; place-items: center; flex-shrink: 0;
}
.playlist-thumb.afst { background: var(--grad-afst); }
.playlist-thumb.comm { background: var(--grad-comm); }
.playlist-thumb.comp { background: var(--grad-comp); }
.playlist-thumb.math { background: var(--grad-math); }
.playlist-thumb i { font-size: 16px; color: rgba(255,255,255,.9); }
.playlist-info { flex: 1; min-width: 0; }
.playlist-title { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playlist-dur   { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* Page content scrollable area */
#page-content {
  overflow-y: auto;
  overflow-x: hidden;
}
#page-content::-webkit-scrollbar { width: 5px; }
#page-content::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
