/* ==========================================================================
   Yasas Sri Wickramasinghe — Academic Platform app styles
   Builds on the site design system in ../assets/css/redesign.css
   ========================================================================== */

.app-main { min-height: 70vh; padding: 48px 0 80px; }

.app-crumb { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.app-crumb a { color: var(--accent); font-weight: 600; }

.app-head { max-width: 720px; margin-bottom: 36px; }
.app-head h1 { font-size: clamp(30px, 4.5vw, 48px); letter-spacing: -0.02em; line-height: 1.08; }
.app-head p { margin-top: 14px; color: var(--ink-soft); font-size: clamp(15px, 1.5vw, 17px); }

/* ---------- Hub cards ---------- */
.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.hub-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.hub-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.hub-card .ic {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: 6px;
}
.hub-card h3 { font-size: 18px; }
.hub-card p { font-size: 14px; color: var(--ink-soft); flex: 1; }
.hub-card .go { font-size: 14px; font-weight: 600; color: var(--accent); }

.identity-band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 44px 0 8px; }
.identity {
  border-left: 3px solid var(--accent); padding: 4px 0 4px 18px;
}
.identity b { display: block; font-size: 15px; }
.identity span { font-size: 13.5px; color: var(--ink-soft); }

/* ---------- Panels, cards, generic ---------- */
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
}
.panel + .panel { margin-top: 20px; }
.panel h2 { font-size: 22px; margin-bottom: 6px; }
.panel h3 { margin-bottom: 6px; }
.panel .sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 18px; }

.two-col { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px; align-items: start; }
.grid-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.notice {
  border: 1px solid var(--line-strong); border-left: 4px solid var(--accent);
  background: var(--accent-soft); border-radius: var(--radius-sm);
  padding: 14px 18px; font-size: 14px; color: var(--ink-soft); margin-bottom: 24px;
}
.notice b { color: var(--ink); }
.notice.warn { border-left-color: #d97706; background: #fef7ec; }
.notice.ok { border-left-color: #16a34a; background: #f0fdf4; }

.empty {
  text-align: center; padding: 48px 20px; color: var(--muted); font-size: 14.5px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
}

/* ---------- Type selection cards (consultations) ---------- */
.type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 28px; }
.type-card {
  text-align: left; cursor: pointer; background: var(--card);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 20px; font-family: var(--sans); transition: border-color .25s, background .25s;
}
.type-card:hover { border-color: var(--line-strong); }
.type-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.type-card h3 { font-size: 16px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.type-card .dur { font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.type-card p { font-size: 13.5px; color: var(--ink-soft); margin-top: 6px; }
.type-card .prep { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field label small { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line-strong); background: var(--bg);
  font-family: var(--sans); font-size: 14.5px; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring);
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field .count { font-size: 12px; color: var(--muted); margin-top: 4px; text-align: right; }
.hp-field { position: absolute !important; left: -9999px !important; opacity: 0; height: 0; overflow: hidden; }

.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-msg { font-size: 14px; font-weight: 500; }
.form-msg.err { color: #dc2626; }
.form-msg.ok { color: #16a34a; }

button.btn { font-family: var(--sans); }
.btn.small { padding: 8px 16px; font-size: 13px; }
.btn.danger { border-color: #fca5a5; color: #dc2626; }
.btn.danger:hover { border-color: #dc2626; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- Badges / status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: var(--bg-soft); color: var(--ink-soft);
  border: 1px solid var(--line);
}
.badge.pending   { background: #fef7ec; color: #b45309; border-color: #fde5c0; }
.badge.approved, .badge.accepted, .badge.published, .badge.subscribed { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.badge.declined, .badge.cancelled { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge.completed { background: var(--accent-soft); color: var(--accent-dark); border-color: #c7d8ff; }
.badge.draft, .badge.discussing { background: var(--bg-soft); color: var(--ink-soft); }
.badge.cat { background: var(--accent-soft); color: var(--accent-dark); border-color: transparent; }

/* ---------- Lists (requests, threads, posts) ---------- */
.list { display: grid; gap: 12px; }
.list-item {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 20px; transition: border-color .25s, box-shadow .25s;
}
a.list-item:hover, .list-item.clickable:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.list-item .li-main { min-width: 0; flex: 1; }
.list-item h3 { font-size: 15.5px; margin-bottom: 3px; }
.list-item .meta { font-size: 12.5px; color: var(--muted); }
.list-item .desc { font-size: 13.5px; color: var(--ink-soft); margin-top: 4px; }
.list-item .li-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }

/* ---------- Blog ---------- */
.post-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.post-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.post-card .pmeta { font-size: 12.5px; color: var(--muted); }
.post-card h3 { font-size: 19px; }
.post-card p { font-size: 14px; color: var(--ink-soft); flex: 1; }

.article { max-width: 760px; margin: 0 auto; }
.article-header { margin-bottom: 32px; }
.article-header h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.12; margin: 12px 0; }
.article-header .pmeta { font-size: 13.5px; color: var(--muted); }
.article-summary {
  font-size: 16.5px; color: var(--ink-soft); border-left: 3px solid var(--accent);
  padding-left: 18px; margin: 20px 0 8px; line-height: 1.6;
}
.prose { font-size: 16.5px; line-height: 1.75; color: var(--ink); }
.prose h2 { font-size: 26px; margin: 36px 0 14px; }
.prose h3 { font-size: 20px; margin: 28px 0 10px; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 18px 24px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--accent); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote {
  border-left: 3px solid var(--accent); padding: 4px 0 4px 20px;
  color: var(--ink-soft); font-style: italic; margin: 0 0 18px;
}
.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em; background: var(--bg-soft); border: 1px solid var(--line);
  padding: 2px 6px; border-radius: 6px;
}
.prose pre {
  background: #10151f; color: #e7ecf5; border-radius: var(--radius-sm);
  padding: 18px 20px; overflow-x: auto; margin: 0 0 20px; font-size: 13.5px; line-height: 1.6;
}
.prose pre code { background: none; border: none; padding: 0; color: inherit; }
.prose img { border-radius: var(--radius-sm); margin: 0 0 18px; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }

/* ---------- Speaker page ---------- */
.topic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.topic-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 22px;
}
.topic-card h3 { font-size: 16px; margin-bottom: 6px; }
.topic-card p { font-size: 13.5px; color: var(--ink-soft); }
.topic-card .tmeta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tmeta .chip {
  font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink-soft);
}

.engagement { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.engagement:last-child { border-bottom: none; }
.engagement .when { font-size: 12.5px; font-weight: 700; color: var(--accent); white-space: nowrap; min-width: 90px; padding-top: 2px; }
.engagement h3 { font-size: 15px; }
.engagement p { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- Forum ---------- */
.cat-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 22px; transition: border-color .25s, box-shadow .25s;
}
.cat-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.cat-row .ic {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.cat-row h3 { font-size: 15.5px; }
.cat-row p { font-size: 13px; color: var(--ink-soft); }
.cat-row .lock { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

.thread-post {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 20px 22px;
}
.thread-post + .thread-post { margin-top: 12px; }
.thread-post .tp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #7aa2ff);
  color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.tp-head .who b { font-size: 14px; display: block; line-height: 1.2; }
.tp-head .who span { font-size: 12px; color: var(--muted); }
.tp-head .tp-actions { margin-left: auto; display: flex; gap: 8px; }
.tp-body { font-size: 14.5px; line-height: 1.65; color: var(--ink); }
.tp-body p { margin-bottom: 10px; }
.tp-body p:last-child { margin-bottom: 0; }
.report-btn { background: none; border: none; color: var(--muted); font-size: 12px; cursor: pointer; font-family: var(--sans); }
.report-btn:hover { color: #dc2626; }

/* ---------- Auth / account ---------- */
.auth-box { max-width: 440px; margin: 0 auto; }
.auth-tabs { display: flex; gap: 4px; background: var(--bg-soft); padding: 4px; border-radius: 999px; margin-bottom: 22px; }
.auth-tabs button {
  flex: 1; padding: 9px 0; border: none; border-radius: 999px; cursor: pointer;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--ink-soft); background: transparent;
}
.auth-tabs button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-google { width: 100%; justify-content: center; }

.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip .info b { display: block; font-size: 14px; line-height: 1.2; }
.user-chip .info span { font-size: 12px; color: var(--muted); }

/* ---------- Admin ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.tabs button {
  padding: 9px 18px; border-radius: 999px; cursor: pointer; font-family: var(--sans);
  font-size: 13.5px; font-weight: 600; border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--ink-soft); transition: all .25s;
}
.tabs button.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 20px;
}
.stat b { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; display: block; }
.stat span { font-size: 12.5px; color: var(--muted); }

.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; font-size: 13.5px; margin: 12px 0; }
.detail-grid dt { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.detail-grid dd { margin: 0 0 8px; word-break: break-word; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 500;
  padding: 12px 22px; border-radius: 999px; box-shadow: var(--shadow);
  opacity: 0; transition: all .35s var(--ease); z-index: 1200; pointer-events: none;
  max-width: min(92vw, 560px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Loading ---------- */
.loading { display: flex; justify-content: center; padding: 60px 0; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hub-grid, .identity-band { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .hub-grid, .identity-band, .type-grid, .post-grid, .topic-grid, .grid-cards, .form-row { grid-template-columns: 1fr; }
  .list-item { flex-direction: column; }
  .list-item .li-side { flex-direction: row; align-items: center; }
  .detail-grid { grid-template-columns: 1fr; }
}
