/* styles.css — ebpro teaching catalog (shared) */
:root {
  --bg: #f8fafc; --surface: #ffffff; --text: #1e293b; --text-muted: #64748b;
  --primary: #3b82f6; --primary-hover: #2563eb; --success: #22c55e;
  --error: #ef4444; --warning: #f59e0b; --border: #e2e8f0;
  --radius: 12px; --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12); --max-w: 1200px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#0f172a; --surface:#1e293b; --text:#f1f5f9; --text-muted:#94a3b8; --border:#334155; --shadow:0 1px 3px rgba(0,0,0,0.3); --shadow-md:0 4px 12px rgba(0,0,0,0.4); }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font: 16px/1.6 -apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Landing page */
.landing { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem; padding: 2rem; text-align: center; }
.landing h1 { font-size: 2.5rem; }
.landing p { color: var(--text-muted); max-width: 500px; }
.landing-buttons { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.landing-btn { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 2rem 3rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; font-size: 1.1rem; font-weight: 600; }
.landing-btn:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); text-decoration: none; }
.landing-btn .icon { font-size: 3rem; }
.landing-stats { color: var(--text-muted); font-size: 0.9rem; }

/* Header (profile pages) */
header { position: sticky; top: 0; z-index: 100; background: var(--surface); border-bottom: 1px solid var(--border); padding: 1rem 2rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
header h1 { font-size: 1.3rem; white-space: nowrap; }
header h1 span { opacity: 0.6; font-weight: 400; }
.search { flex: 1; min-width: 200px; max-width: 400px; padding: 0.5rem 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 0.95rem; }
.search:focus { outline: none; border-color: var(--primary); }
.back-link { font-size: 0.9rem; color: var(--text-muted); }

/* Stats bar (teacher) */
.stats-bar { display: flex; gap: 1.5rem; padding: 0.75rem 2rem; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 0.9rem; color: var(--text-muted); flex-wrap: wrap; }
.stat strong { color: var(--text); }
.stat-green strong { color: var(--success); }
.stat-red strong { color: var(--error); }

/* Filter chips */
.filter-chips { display: flex; gap: 0.5rem; padding: 1rem 2rem; flex-wrap: wrap; }
.chip { padding: 0.4rem 1rem; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 0.85rem; transition: all .15s; }
.chip:hover { border-color: var(--primary); }
.chip.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Content */
main { max-width: var(--max-w); margin: 0 auto; padding: 1rem 2rem 4rem; }
.section-title { font-size: 1.4rem; margin: 2rem 0 1rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.empty { text-align: center; padding: 4rem; color: var(--text-muted); font-size: 1.2rem; }

/* Card (web component) */
repo-card { display: block; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow .2s; overflow: hidden; }
repo-card:hover { box-shadow: var(--shadow-md); }
.card-inner { padding: 1.5rem; }
.card-header-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.status-dot { font-size: 0.8rem; }
.card-icon { font-size: 2rem; }
.card-title { font-size: 1.1rem; font-weight: 600; margin: 0.5rem 0; }
.card-title a { color: var(--text); }
.card-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-topics { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 1rem; }
.badge { padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.75rem; background: var(--bg); border: 1px solid var(--border); }
.badge-area { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.badge-status { background: #dcfce7; color: #166534; border-color: #86efac; }

/* CTA buttons */
.card-cta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.cta { padding: 0.5rem 1rem; border-radius: 8px; font-size: 0.85rem; font-weight: 500; text-align: center; transition: all .15s; }
.cta-primary { background: var(--primary); color: white; }
.cta-primary:hover { background: var(--primary-hover); text-decoration: none; }
.cta-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.cta-secondary:hover { border-color: var(--primary); text-decoration: none; }
.cta-disabled { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); opacity: 0.5; cursor: not-allowed; }

/* Branches (teacher) */
.card-branches { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.75rem; }
.branch-link { padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; background: var(--bg); border: 1px solid var(--border); color: var(--text); }
.branch-link:hover { border-color: var(--primary); text-decoration: none; }
.branch-chip { padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; background: var(--bg); color: var(--text-muted); }
.card-footer { margin-top: 0.75rem; font-size: 0.8rem; color: var(--text-muted); }
.ci-link { margin-left: auto; font-size: 1rem; }

/* Student: hide teacher-only elements (safety net) */
[data-profile="student"] .card-topics,
[data-profile="student"] .card-branches,
[data-profile="student"] .card-footer,
[data-profile="student"] .stats-bar,
[data-profile="student"] .ci-link { display: none; }

/* Responsive */
@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
  header { padding: 0.75rem 1rem; }
  main { padding: 1rem; }
  .landing-buttons { flex-direction: column; }
  .landing-btn { width: 100%; max-width: 300px; }
}
