/* =============================================================================
   LearnWell Student Portal — v2 Demo Stylesheet
   ============================================================================= */

:root {
  --navy:   #003057;
  --blue:   #0066CC;
  --light:  #EBF3FB;
  --bg:     #F7F7F7;
  --text:   #3F3F3F;
  --border: #DEDEDE;
  --white:  #FFFFFF;
  --green:  #43a047;
  --red:    #d32f2f;
  --amber:  #f9a825;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Header / Nav ---- */
header {
  background: var(--navy);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-mark {
  width: 32px; height: 32px;
  background: var(--white);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: var(--navy);
}

.logo-text { color: #fff; font-size: 16px; font-weight: 600; }
.logo-sub  { color: rgba(255,255,255,0.6); font-size: 10px; font-weight: 300; letter-spacing: 1px; text-transform: uppercase; display: block; margin-top: -2px; }

nav a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 13px;
  margin-left: 20px;
}
nav a:hover { color: #fff; }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  color: white;
  padding: 44px 32px 36px;
}
.hero h1 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.hero p  { font-size: 14px; opacity: 0.8; max-width: 560px; line-height: 1.6; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase;
  margin-bottom: 12px;
}

/* ---- Layout ---- */
main { flex: 1; }
.container { max-width: 1100px; margin: 0 auto; padding: 28px 32px; }
.narrow   { max-width: 520px; }

/* ---- Status bar ---- */
.status-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 20px;
  display: flex; align-items: center; gap: 24px;
  margin-bottom: 24px; font-size: 13px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  display: inline-block; margin-right: 6px;
}

/* ---- Cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card h3 { font-size: 15px; font-weight: 600; color: var(--navy); margin-bottom: 8px; }
.card p  { font-size: 13px; color: #666; line-height: 1.5; margin-bottom: 12px; }
.stat    { font-size: 32px; font-weight: 700; color: var(--blue); margin: 8px 0; }

/* ---- Section titles ---- */
.section-title {
  font-size: 18px; font-weight: 600; color: var(--navy);
  margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 2px solid var(--light);
}

/* ---- Tables ---- */
table {
  width: 100%; border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
  font-size: 13px;
}
th {
  background: var(--navy); color: white;
  padding: 10px 14px; text-align: left;
  font-weight: 600; font-size: 12px; letter-spacing: 0.5px; text-transform: uppercase;
}
td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--light); }

/* ---- Method badges ---- */
.method {
  display: inline-block; padding: 2px 8px; border-radius: 3px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
}
.get  { background: #e8f5e9; color: #2e7d32; }
.post { background: #fff3e0; color: #e65100; }
.put  { background: #e3f2fd; color: #1565c0; }

a.endpoint {
  color: var(--blue); text-decoration: none;
  font-family: 'Courier New', monospace; font-size: 12px;
}
a.endpoint:hover { text-decoration: underline; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  background: var(--blue); color: white;
  padding: 8px 16px; border-radius: 4px;
  font-size: 13px; font-weight: 600;
  text-decoration: none; border: none; cursor: pointer;
}
.btn:hover { background: var(--navy); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--blue);
  color: var(--blue);
}
.btn-outline:hover { background: var(--light); }

/* ---- Forms ---- */
.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}
label {
  display: block; font-weight: 600; font-size: 13px;
  margin-bottom: 4px; margin-top: 12px; color: var(--navy);
}
label:first-child { margin-top: 0; }
input[type="text"], input[type="email"], input[type="password"], select, textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 4px;
  font-size: 14px; font-family: inherit;
}
textarea { resize: vertical; }
.form-card .btn { margin-top: 16px; }

.inline-form {
  display: flex; gap: 8px; align-items: flex-end;
}
.inline-form input { flex: 1; }

.toolbar {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 20px;
}

/* ---- Alerts ---- */
.alert {
  padding: 12px 16px; border-radius: 4px;
  margin-bottom: 16px; font-size: 13px;
}
.alert-error   { background: #fce4ec; color: var(--red); border: 1px solid #ef9a9a; }
.alert-warning { background: #fff8e1; color: #e65100;    border: 1px solid #ffe082; }
.alert-success { background: #e8f5e9; color: #2e7d32;    border: 1px solid #a5d6a7; }

/* ---- Badges ---- */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.badge-active    { background: #e8f5e9; color: #2e7d32; }
.badge-inactive  { background: #fce4ec; color: var(--red); }
.badge-suspended { background: #fff8e1; color: #e65100; }
.badge-admin     { background: #e3f2fd; color: #1565c0; }
.badge-instructor { background: #f3e5f5; color: #7b1fa2; }
.badge-viewer    { background: #f5f5f5; color: #616161; }

/* ---- Comments ---- */
.comments-section { margin-bottom: 20px; }
.comment {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 8px;
}
.comment-meta { font-size: 12px; color: #888; margin-bottom: 4px; }
.comment-body { font-size: 14px; line-height: 1.5; }

/* ---- Debug / Output ---- */
.debug-box {
  background: #f5f5f5;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
}
.debug-box code { font-family: 'Courier New', monospace; font-size: 12px; color: var(--red); }

/* ---- Educational feedback ---- */
.educational-box {
  background: #fff3e0;
  border: 2px solid #ff9800;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.6;
}
.educational-box h4 {
  color: #e65100;
  margin-bottom: 8px;
  font-size: 15px;
}
.educational-box p { margin-bottom: 6px; }
.educational-box ul { margin: 4px 0 8px 20px; }
.educational-box li { margin-bottom: 2px; }
.educational-box code {
  background: rgba(0,0,0,0.06);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

.output-box {
  background: #263238; color: #e0e0e0;
  padding: 16px; border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px; line-height: 1.5;
  overflow-x: auto; white-space: pre-wrap;
  margin-bottom: 20px;
}

/* ---- Description lists ---- */
dl { margin: 0; }
dt { font-weight: 600; font-size: 12px; color: #888; margin-top: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
dd { font-size: 14px; margin-left: 0; }

.small { font-size: 12px; color: #888; }
.muted { color: #999; font-style: italic; }

/* ---- Footer ---- */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 16px;
  font-size: 12px;
  margin-top: 40px;
}
footer a { color: rgba(255,255,255,0.7); text-decoration: none; }
