/* Somo Huru – Frontend Styles v1.0.0 */
:root {
  --shve-primary: #1a6b3a;
  --shve-primary-dark: #114d29;
  --shve-secondary: #f59e0b;
  --shve-accent: #2563eb;
  --shve-bg: #f8fafc;
  --shve-surface: #ffffff;
  --shve-border: #e2e8f0;
  --shve-text: #1e293b;
  --shve-text-muted: #64748b;
  --shve-radius: 12px;
  --shve-radius-sm: 6px;
  --shve-shadow: 0 2px 12px rgba(0,0,0,.08);
  --shve-shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --shve-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ========== BASE ========== */
.shve-main { background: var(--shve-bg); min-height: 60vh; }
.shve-container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem; }

/* ========== BUTTONS ========== */
.shve-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.25rem; border-radius: var(--shve-radius-sm);
  font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none;
  border: 2px solid transparent; transition: background .2s, color .2s, border-color .2s;
  font-family: var(--shve-font);
}
.shve-btn--primary   { background: var(--shve-primary); color: #fff; }
.shve-btn--primary:hover { background: var(--shve-primary-dark); color: #fff; }
.shve-btn--secondary { background: var(--shve-accent); color: #fff; }
.shve-btn--secondary:hover { background: #1d4ed8; color: #fff; }
.shve-btn--ghost     { background: transparent; color: var(--shve-primary); border-color: var(--shve-primary); }
.shve-btn--ghost:hover { background: var(--shve-primary); color: #fff; }
.shve-btn--download  { background: var(--shve-secondary); color: #fff; }
.shve-btn--download:hover { background: #d97706; color: #fff; }
.shve-btn--sm        { padding: .35rem .85rem; font-size: .82rem; }
.shve-btn--read-aloud { gap: .5rem; }

/* ========== TAGS / BADGES ========== */
.shve-tag {
  display: inline-block; padding: .2rem .6rem;
  border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: #e0f2e9; color: var(--shve-primary);
}
.shve-tag--subject { background: #dbeafe; color: var(--shve-accent); }
.shve-tag--term    { background: #fef3c7; color: #92400e; }
.shve-badge { display:inline-block; padding:.2rem .6rem; border-radius:4px; font-size:.75rem; font-weight:700; }
.shve-badge--green  { background:#d1fae5; color:#065f46; }
.shve-badge--yellow { background:#fef3c7; color:#92400e; }

/* ========== CARDS ========== */
.shve-resource-grid__inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.shve-card {
  background: var(--shve-surface); border: 1px solid var(--shve-border);
  border-radius: var(--shve-radius); overflow: hidden;
  box-shadow: var(--shve-shadow); transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.shve-card:hover { transform: translateY(-3px); box-shadow: var(--shve-shadow-lg); }

.shve-card__thumb { aspect-ratio: 16/9; overflow: hidden; background: #f1f5f9; }
.shve-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.shve-card__thumb--placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: #94a3b8;
}

.shve-card__body { padding: 1rem; display: flex; flex-direction: column; flex: 1; gap: .55rem; }
.shve-card__type-badge {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--shve-primary);
}
.shve-card__title { font-size: 1rem; font-weight: 700; margin: 0; line-height: 1.35; }
.shve-card__title a { color: var(--shve-text); text-decoration: none; }
.shve-card__title a:hover { color: var(--shve-primary); }
.shve-card__meta { display: flex; flex-wrap: wrap; gap: .35rem; }
.shve-card__excerpt { font-size: .85rem; color: var(--shve-text-muted); margin: 0; line-height: 1.5; }
.shve-card__actions { display: flex; gap: .5rem; margin-top: auto; flex-wrap: wrap; }

/* ========== AI TUTOR ========== */
.shve-ai-tutor {
  background: var(--shve-surface); border: 1px solid var(--shve-border);
  border-radius: var(--shve-radius); box-shadow: var(--shve-shadow);
  margin: 2rem 0; overflow: hidden;
}

.shve-ai-tutor__header {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--shve-primary) 0%, var(--shve-primary-dark) 100%);
  color: #fff;
}
.shve-ai-tutor__avatar { font-size: 2rem; line-height: 1; }
.shve-ai-tutor__title { margin: 0; font-size: 1.1rem; font-weight: 700; color: #fff; }
.shve-ai-tutor__subtitle { margin: .2rem 0 0; font-size: .85rem; opacity: .85; }

.shve-ai-tutor__chat {
  padding: 1rem 1.25rem;
  display: flex; flex-direction: column; gap: .75rem;
  max-height: 400px; overflow-y: auto;
  background: #f8fafc;
}

.shve-ai-bubble {
  padding: .75rem 1rem; border-radius: var(--shve-radius);
  max-width: 85%; font-size: .9rem; line-height: 1.65;
}
.shve-ai-bubble--assistant {
  background: var(--shve-surface); border: 1px solid var(--shve-border);
  align-self: flex-start;
}
.shve-ai-bubble--user {
  background: var(--shve-primary); color: #fff;
  align-self: flex-end; border-bottom-right-radius: 2px;
}
.shve-ai-bubble--thinking {
  color: var(--shve-text-muted); font-style: italic;
}

.shve-ai-tutor__form { padding: 1rem 1.25rem; border-top: 1px solid var(--shve-border); }
.shve-ai-tutor__input {
  width: 100%; padding: .75rem; border: 1px solid var(--shve-border);
  border-radius: var(--shve-radius-sm); resize: vertical;
  font-family: var(--shve-font); font-size: .9rem;
  transition: border-color .2s; box-sizing: border-box;
}
.shve-ai-tutor__input:focus { border-color: var(--shve-primary); outline: none; box-shadow: 0 0 0 3px rgba(26,107,58,.15); }
.shve-ai-tutor__actions { display: flex; gap: .75rem; margin-top: .75rem; flex-wrap: wrap; }
.shve-ai-tutor__disclaimer { font-size: .75rem; color: var(--shve-text-muted); margin-top: .5rem; }

/* ========== ASK A TEACHER ========== */
.shve-ask-teacher {
  background: var(--shve-surface); border: 1px solid var(--shve-border);
  border-radius: var(--shve-radius); padding: 1.5rem; margin: 2rem 0;
}
.shve-ask-teacher__title { font-size: 1.1rem; font-weight: 700; margin: 0 0 .5rem; }
.shve-ask-teacher__desc  { color: var(--shve-text-muted); font-size: .9rem; margin-bottom: 1rem; }

.shve-label   { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .9rem; }
.shve-textarea {
  width: 100%; padding: .75rem; border: 1px solid var(--shve-border);
  border-radius: var(--shve-radius-sm); resize: vertical; font-family: var(--shve-font);
  font-size: .9rem; box-sizing: border-box;
}
.shve-textarea:focus { border-color: var(--shve-accent); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

/* ========== NOTICES ========== */
.shve-notice {
  padding: .75rem 1rem; border-radius: var(--shve-radius-sm);
  margin-bottom: 1rem; font-size: .9rem;
}
.shve-notice--success { background: #d1fae5; border-left: 4px solid #059669; color: #065f46; }
.shve-notice--error   { background: #fee2e2; border-left: 4px solid #dc2626; color: #991b1b; }
.shve-login-notice    { background: #fef3c7; padding: .75rem 1rem; border-radius: var(--shve-radius-sm); border-left: 4px solid var(--shve-secondary); }

/* ========== BREADCRUMBS ========== */
.shve-breadcrumbs { font-size: .85rem; color: var(--shve-text-muted); margin-bottom: 1rem; }
.shve-breadcrumbs a { color: var(--shve-primary); text-decoration: none; }
.shve-archive-title { font-size: 1.75rem; font-weight: 800; margin-bottom: 1.25rem; color: var(--shve-text); }

/* ========== PAGINATION ========== */
.shve-pagination { display: flex; gap: .5rem; margin-top: 2rem; flex-wrap: wrap; }
.shve-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--shve-radius-sm);
  border: 1px solid var(--shve-border); color: var(--shve-text);
  text-decoration: none; font-size: .9rem;
}
.shve-pagination .current { background: var(--shve-primary); color: #fff; border-color: var(--shve-primary); }

/* ========== EMPTY STATE ========== */
.shve-empty-state { text-align: center; padding: 3rem; color: var(--shve-text-muted); font-size: 1.1rem; }

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
  .shve-resource-grid__inner { grid-template-columns: 1fr; }
  .shve-ai-bubble { max-width: 95%; }
  .shve-ai-tutor__header { flex-direction: column; align-items: flex-start; }
}

/* ========== SCREEN READER ONLY ========== */
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
