/* ============================================================
   DBA Doubt Board — style.css
   Place in: public_html/doubtboard/css/style.css
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary:       #1e3a8a;
  --primary-light: #eff6ff;
  --success:       #16a34a;
  --success-light: #f0fdf4;
  --warning:       #d97706;
  --warning-light: #fffbeb;
  --danger:        #dc2626;
  --danger-light:  #fef2f2;
  --border:        #e2e8f0;
  --bg:            #f1f5f9;
  --text:          #0f172a;
  --text-muted:    #94a3b8;
  --gray:          #64748b;
  --radius:        10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 16px; border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #1e40af; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-ai { background: #7c3aed; color: #fff; }
.btn-ai:hover { background: #6d28d9; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Forms ── */
.form-group { margin-bottom: 14px; }
label { display: block; font-size: 12px; font-weight: 500; color: var(--gray); margin-bottom: 5px; }
input, textarea, select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit;
  background: #fff; color: var(--text);
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); }
textarea { resize: vertical; min-height: 70px; line-height: 1.5; }

/* ── Header ── */
.header {
  background: var(--primary); padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.header-title { color: #fff; font-size: 16px; font-weight: 600; }
.header-sub   { color: #93c5fd; font-size: 12px; margin-top: 2px; }
.header-right { display: flex; align-items: center; gap: 10px; }
.user-badge { background: rgba(255,255,255,0.15); color: #fff; padding: 4px 10px; border-radius: 20px; font-size: 12px; }

/* ── Session bar ── */
.session-bar {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 10px 20px; display: flex; align-items: center; justify-content: space-between;
  font-size: 13px;
}
.session-active { color: var(--success); font-weight: 500; }
.session-none   { color: var(--text-muted); }

/* ── Stats ── */
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; padding: 14px 20px 0;
}
.stat-card {
  background: #fff; border-radius: var(--radius); padding: 12px 14px;
  border: 1px solid var(--border); display: flex; align-items: center; gap: 10px;
}
.stat-value { font-size: 22px; font-weight: 600; }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.stat-blue    { border-left: 3px solid #2563eb; }
.stat-warning { border-left: 3px solid var(--warning); }
.stat-success { border-left: 3px solid var(--success); }
.stat-danger  { border-left: 3px solid var(--danger); }

/* ── Search ── */
.search-row { padding: 12px 20px 0; }
.search-row input { max-width: 360px; }

/* ── Main layout ── */
.main { display: flex; gap: 14px; padding: 12px 20px 24px; align-items: flex-start; }

/* ── Card grid ── */
.grid { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.grid.panel-open { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }

/* ── Student card ── */
.card {
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  cursor: pointer; transition: all 0.18s; position: relative;
}
.card:hover  { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,0.1); }
.card.selected        { box-shadow: 0 0 0 2px var(--primary); }
.card.status-pending  { border-color: #fcd34d; background: #fffbeb; }
.card.status-critical { border-color: #fca5a5; background: var(--danger-light); }
.card.status-resolved { border-color: #86efac; background: var(--success-light); }

.card-badge { position: absolute; top: 8px; right: 8px; font-size: 9px; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.badge-you  { background: #eff6ff; color: #1e40af; }
.badge-help { background: #fee2e2; color: var(--danger); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 13px; margin-bottom: 10px; }
.card-name  { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.card-topic { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.4; }
.doubt-counts { display: flex; gap: 5px; flex-wrap: wrap; }
.count-badge  { font-size: 10px; padding: 2px 7px; border-radius: 20px; font-weight: 500; }
.count-pending  { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.count-resolved { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.count-none     { color: var(--text-muted); font-size: 11px; }

/* ── Side panel ── */
.panel { width: 400px; flex-shrink: 0; background: #fff; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.panel-header { padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--bg); display: flex; justify-content: space-between; align-items: flex-start; }
.panel-user   { display: flex; align-items: center; gap: 10px; }
.panel-name   { font-weight: 600; font-size: 15px; }
.panel-topic  { color: var(--text-muted); font-size: 12px; }
.panel-close  { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 18px; padding: 2px 6px; }
.panel-body   { padding: 14px 16px; max-height: 520px; overflow-y: auto; }

/* ── Filters ── */
.filter-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.filter-tab  { padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border); background: none; font-size: 11px; font-weight: 500; cursor: pointer; color: var(--gray); font-family: inherit; }
.filter-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Add doubt ── */
.add-doubt-box { background: var(--primary-light); border: 1px solid #bfdbfe; border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.add-doubt-box h4 { font-size: 13px; color: #1e3a8a; margin-bottom: 10px; }

/* ── Doubt items ── */
.doubt-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.doubt-item.pending  { border-color: #fde68a; background: #fffbeb; }
.doubt-item.resolved { border-color: #a7f3d0; background: var(--success-light); }
.doubt-meta     { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.doubt-status   { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.status-pending  { background: #fee2e2; color: var(--danger); }
.status-resolved { background: #d1fae5; color: var(--success); }
.doubt-time     { font-size: 11px; color: var(--text-muted); }
.doubt-question { font-size: 13px; line-height: 1.6; margin-bottom: 8px; }
.doubt-answer   { background: #fff; border-radius: 8px; padding: 10px; border: 1px solid #a7f3d0; font-size: 12px; color: #374151; line-height: 1.6; }
.doubt-answer-label { font-size: 11px; font-weight: 600; color: var(--success); margin-bottom: 5px; }
.teacher-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tip-box { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 9px 12px; font-size: 12px; color: #1e40af; margin-bottom: 12px; }
.empty-state { text-align: center; padding: 32px 16px; color: var(--text-muted); }
.empty-icon  { font-size: 34px; margin-bottom: 10px; }

/* ── Login page ── */
.login-page  { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card  { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); padding: 32px; width: 100%; max-width: 400px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.login-logo  { text-align: center; margin-bottom: 24px; }
.login-logo h1 { font-size: 20px; color: var(--primary); }
.login-logo p  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.tabs    { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn { flex: 1; padding: 10px; background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--gray); font-family: inherit; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.error-msg   { color: var(--danger); font-size: 12px; margin-top: 8px; }
.success-msg { color: var(--success); font-size: 12px; margin-top: 8px; }

/* ── Session modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal         { background: #fff; border-radius: var(--radius); padding: 24px; width: 100%; max-width: 440px; }
.modal h3      { font-size: 16px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

.hidden { display: none !important; }
