/* portal/styles.css - Portal-specific styles (extends shared/styles.css) */

/* Portal layout */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: rgba(0,0,0,0.2); position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; letter-spacing: .5px; }
main#app { padding: 16px; max-width: 1100px; margin: 0 auto; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }

/* Portal-specific button variants */
.btn.warn { background: var(--warning); color: #0b0f14; border-color: var(--warning); }
.btn.link {
  background: transparent;
  border-color: var(--border);
}
.btn.link:hover {
  border-color: var(--accent-2);
  background: rgba(57,255,136,.05);
}

/* Portal form inputs (align with shared styles) */
input, select, textarea {
  background: var(--input-bg); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px); padding: 8px 10px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(106, 169, 255, 0.2);
}

/* Keyboard shortcut display */
.kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background:var(--nav-active-bg); border:1px solid var(--border); padding:2px 6px; border-radius:6px; }

/* Thread/discussion styles */
.thread { border-left: 3px solid var(--border); margin: 10px 0; padding-left: 10px; }
.thread div, .card div { line-height: 1.5; }
blockquote { margin: 8px 0; padding-left: 10px; border-left: 2px solid var(--border); color: var(--muted); }
small.muted { color: var(--muted); }

/* Details/summary in dark UI */
details > summary {
  cursor: pointer;
  color: var(--nav-text);
}
details[open] > summary { color: var(--nav-hover); }

/* Portal navigation */
#nav { display: flex; align-items: center; gap: 12px; }
#nav a { color: var(--link); text-decoration: none; margin-right: 14px; }
#nav a.active { color: var(--accent); font-weight: 700; }
#nav a[data-route] { text-decoration: none; color: var(--nav-text); }
#nav a[data-route]:hover { color: var(--nav-hover); }
.nav-spacer { flex: 1; }

/* User badge */
.user-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px; border: 1px solid var(--border); background: var(--nav-bg); color: var(--text);
  border-radius: 6px; font-size: 12px; letter-spacing: .02em;
}
.user-badge .role {
  font-size: 11px; text-transform: capitalize; letter-spacing: .04em; opacity: .7;
  border-left: 1px solid var(--border); padding-left: 8px; margin-left: 4px;
}

/* ===== Submissions modal ===== */
.modal-overlay {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55); z-index: 1000; backdrop-filter: blur(2px);
}
.modal {
  width: min(960px, 96vw); max-height: 86vh; overflow: hidden;
  background: var(--nav-bg); border: 1px solid var(--border); border-radius: var(--radius-lg, 12px);
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  display: flex; flex-direction: column;
}
.modal-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-bottom: 1px solid var(--border); background: var(--nav-active-bg);
}
.modal-head h3 { margin: 0; font-size: 16px; color: var(--text); }
.modal-head .spacer { flex: 1; }
.modal-body {
  padding: 12px; overflow: auto; color: var(--text);
}

/* Split view */
.subs-split { display: grid; grid-template-columns: 320px 1fr; gap: 12px; min-height: 360px; }
.subs-list {
  border-right: 1px solid var(--border); overflow: auto; padding-right: 8px;
}
.subs-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px; border: 1px solid var(--surface-border); border-radius: 8px; margin-bottom: 8px;
  background: var(--surface-bg);
}
.subs-row:hover { border-color: var(--accent-2); box-shadow: 0 0 0 2px rgba(57,255,136,.08); }
.subs-primary { display: flex; flex-direction: column; gap: 2px; }
.subs-name { font-weight: 600; }
.subs-time { font-size: 12px; opacity: .7; }
.subs-actions { display: flex; align-items: center; gap: 8px; }

.subs-detail { overflow: auto; padding: 4px; }
.subs-pre {
  background: var(--nav-active-bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; white-space: pre-wrap;
}

.checkline { display: flex; align-items: center; gap: 8px; padding: 2px 0; }

/* ===== Roster list ===== */
.roster-list {
  display: flex; flex-direction: column; gap: 6px; margin: 8px 0;
}
.roster-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border: 1px solid var(--surface-border); border-radius: 8px;
  background: var(--surface-bg);
}
.roster-row:hover {
  border-color: var(--accent-2); box-shadow: 0 0 0 2px rgba(57,255,136,.08);
}

/* ===== View Notes Modal ===== */
.notes-filters {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  padding: 12px; background: var(--nav-active-bg); border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 12px;
}
.filter-group {
  display: flex; flex-direction: column; gap: 4px;
}
.filter-group label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
}
.filter-group select, .filter-group input {
  min-width: 140px;
}
.filter-actions {
  display: flex; gap: 8px; align-items: center; margin-left: auto;
}

.notes-list {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 400px; overflow-y: auto; padding-right: 4px;
}

.note-card {
  background: var(--surface-bg); border: 1px solid var(--surface-border); border-radius: 8px;
  padding: 12px; border-left: 3px solid var(--border);
}
.note-card.sentiment-positive { border-left-color: var(--accent-2); }
.note-card.sentiment-negative { border-left-color: var(--danger); }
.note-card.sentiment-neutral { border-left-color: var(--accent); }

.note-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; flex-wrap: wrap; gap: 8px;
}
.note-header-left {
  display: flex; flex-direction: column; gap: 2px;
}
.note-student {
  font-weight: 600; color: var(--text);
}
.note-class {
  font-size: 12px;
}
.note-meta {
  display: flex; gap: 8px; align-items: center; font-size: 12px;
}
.note-sentiment {
  padding: 2px 6px; border-radius: 4px; text-transform: capitalize;
  font-size: 11px; font-weight: 500;
}
.note-sentiment.sentiment-positive { background: rgba(139,255,176,.15); color: var(--accent-2); }
.note-sentiment.sentiment-negative { background: rgba(255,106,106,.15); color: var(--danger); }
.note-sentiment.sentiment-neutral { background: rgba(106,169,255,.15); color: var(--accent); }

.note-category {
  padding: 2px 6px; background: var(--surface-border); border-radius: 4px;
  font-size: 11px; color: var(--muted);
}
.note-value {
  padding: 2px 6px; background: var(--surface-border); border-radius: 4px;
  font-size: 11px; color: var(--warning);
}

.note-content {
  color: var(--text-light); line-height: 1.5; white-space: pre-wrap;
  margin-bottom: 8px;
}

.note-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 8px; border-top: 1px solid var(--surface-border);
}
.note-footer-left {
  display: flex; flex-direction: column; gap: 2px;
}
.note-author {
  font-size: 12px; font-style: italic;
}
.note-date {
  font-size: 11px;
}
.note-actions {
  display: flex; gap: 6px; align-items: center;
}

/* Note modification indicator */
.note-card.modified {
  border-left-color: var(--warning);
}
.note-modified {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; margin: 8px 0;
  background: rgba(255,211,106,.1); border: 1px solid rgba(255,211,106,.3);
  border-radius: 6px; font-size: 12px;
}
.note-modified-badge {
  background: var(--warning); color: #0a0a0a;
  padding: 2px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: .05em;
}

/* ===== School Documents ===== */

/* Document card grid */
.doc-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.doc-card {
  background: var(--card, var(--card-bg, #151a21));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 16px;
  transition: border-color var(--transition-fast, 0.15s ease), box-shadow var(--transition-fast, 0.15s ease);
}
.doc-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(106, 169, 255, 0.15);
}

/* Document reader view */
.doc-reader {
  background: #fafafa;
  color: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
}
.doc-reader-header {
  padding: 32px 48px 24px;
  border-bottom: 1px solid #e0e0e0;
}
.doc-reader-header h1 {
  color: #1a1a1a;
}
.doc-reader-header p {
  color: #666;
}
.doc-reader-body {
  padding: 32px 48px 48px;
  max-width: 800px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.75;
  color: #2a2a2a;
}
.doc-reader-body h1, .doc-reader-body h2, .doc-reader-body h3,
.doc-reader-body h4, .doc-reader-body h5, .doc-reader-body h6 {
  color: #1a1a1a;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}
.doc-reader-body h1 { font-size: 24px; }
.doc-reader-body h2 { font-size: 20px; }
.doc-reader-body h3 { font-size: 18px; }
.doc-reader-body p { margin-bottom: 1em; }
.doc-reader-body ul, .doc-reader-body ol {
  margin-bottom: 1em;
  padding-left: 1.5em;
}
.doc-reader-body li { margin-bottom: 0.25em; }
.doc-reader-body blockquote {
  border-left: 3px solid #ccc;
  margin: 1em 0;
  padding: 0.5em 1em;
  color: #555;
  background: #f0f0f0;
}
.doc-reader-body a { color: #2563eb; }
.doc-reader-body img { max-width: 100%; height: auto; border-radius: 4px; }

/* Responsive adjustments */
@media (max-width: 600px) {
  .doc-reader-header { padding: 20px 16px 16px; }
  .doc-reader-body { padding: 20px 16px 32px; }
  .doc-card-grid { grid-template-columns: 1fr; }
}
