/* ============================================
   NEO-BRUTALISM DESIGN SYSTEM — LearnChain LMS
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Syne:wght@700;800&display=swap');

/* ---- TOKENS ---- */
:root {
  --black:     #0a0a0a;
  --white:     #FAFAF9;
  --yellow:    #FFD600;
  --pink:      #FF2D78;
  --blue:      #00C2FF;
  --purple:    #9B5DE5;
  --teal:      #00F5D4;
  --orange:    #FF6B35;
  --green:     #06D6A0;
  --red:       #EF233C;

  --bg:        #F5F2E8;
  --surface:   #FFFFFF;
  --border:    #0a0a0a;
  --border-w:  3px;
  --shadow:    5px 5px 0px var(--black);
  --shadow-lg: 8px 8px 0px var(--black);
  --shadow-sm: 3px 3px 0px var(--black);
  --radius:    4px;

  --font-body:  'Inter', sans-serif;
  --font-head:  'Syne', sans-serif;

  --sidebar-w: 260px;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--black);
  line-height: 1.6;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }

.text-sm   { font-size: 0.85rem; }
.text-xs   { font-size: 0.75rem; }
.text-lg   { font-size: 1.125rem; }
.text-xl   { font-size: 1.3rem; }
.fw-bold   { font-weight: 700; }
.fw-black  { font-weight: 800; }
.text-muted{ color: #666; }
.text-center { text-align: center; }

/* ---- LAYOUT ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 1.5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

/* ---- COMPONENTS ---- */

/* CARD */
.card {
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.card-flat  { box-shadow: none; }
.card-yellow{ background: var(--yellow); }
.card-pink  { background: var(--pink); color: var(--white); }
.card-blue  { background: var(--blue); }
.card-teal  { background: var(--teal); }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  border: var(--border-w) solid var(--black);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s, box-shadow 0.1s;
  background: var(--white);
  color: var(--black);
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  justify-content: center;
}
.btn:hover  { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--black); }
.btn:active { transform: translate(1px, 1px);   box-shadow: 2px 2px 0 var(--black); }

.btn-yellow { background: var(--yellow); }
.btn-pink   { background: var(--pink); color: #fff; }
.btn-blue   { background: var(--blue); }
.btn-teal   { background: var(--teal); }
.btn-black  { background: var(--black); color: #fff; }
.btn-green  { background: var(--green); }
.btn-red    { background: var(--red); color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-ghost  { background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--bg); }

.btn-lg { padding: 0.9rem 2rem; font-size: 1rem; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-xs { padding: 0.25rem 0.6rem; font-size: 0.72rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 0.5rem; aspect-ratio: 1; }

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  border: 2px solid var(--black);
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-success   { background: var(--green); }
.badge-warning   { background: var(--yellow); }
.badge-danger    { background: var(--red); color: #fff; }
.badge-secondary { background: #ddd; }
.badge-blue      { background: var(--blue); }
.badge-pink      { background: var(--pink); color: #fff; }
.badge-purple    { background: var(--purple); color: #fff; }

/* FORM ELEMENTS */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
}
.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  border: var(--border-w) solid var(--black);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--black);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
  outline: none;
}
.form-control:focus {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--black);
}
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* TABLE */
.table-wrap { overflow-x: auto; border: var(--border-w) solid var(--black); border-radius: var(--radius); box-shadow: var(--shadow); }
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}
.table th {
  background: var(--black);
  color: var(--white);
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-body);
}
.table td {
  padding: 0.85rem 1rem;
  border-bottom: 2px solid #eee;
  font-size: 0.875rem;
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fffbe0; }
.table tr:hover td:first-child { border-left: 4px solid var(--yellow); padding-left: calc(1rem - 4px); }

/* ALERTS */
.alert {
  padding: 0.85rem 1.1rem;
  border: var(--border-w) solid var(--black);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.alert-success { background: var(--green); }
.alert-error   { background: var(--red); color: #fff; }
.alert-warning { background: var(--yellow); }
.alert-info    { background: var(--blue); }

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,10,10,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border: var(--border-w) solid var(--black);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  padding: 2rem;
  width: 90%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.2s;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; padding-bottom: 1rem;
  border-bottom: 3px solid var(--black);
}
.modal-title { font-family: var(--font-head); font-size: 1.4rem; font-weight: 800; }

/* PROGRESS BAR */
.progress-wrap {
  background: #e0e0e0;
  border: 2px solid var(--black);
  border-radius: 2px;
  height: 12px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--yellow);
  transition: width 0.4s ease;
}
.progress-bar.green  { background: var(--green); }
.progress-bar.blue   { background: var(--blue); }
.progress-bar.pink   { background: var(--pink); }

/* TABS */
.tabs { display: flex; border-bottom: 3px solid var(--black); margin-bottom: 2rem; gap: 0; }
.tab-btn {
  padding: 0.7rem 1.4rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.875rem;
  border: none; background: transparent; cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  color: #666;
  transition: all 0.15s;
}
.tab-btn:hover     { color: var(--black); background: #f0ede3; }
.tab-btn.active    { color: var(--black); border-bottom-color: var(--black); background: var(--yellow); }
.tab-content       { display: none; }
.tab-content.active{ display: block; }

/* AVATAR */
.avatar {
  width: 40px; height: 40px;
  border: 2px solid var(--black);
  border-radius: 50%;
  background: var(--yellow);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem;
  flex-shrink: 0;
}
.avatar-lg { width: 60px; height: 60px; font-size: 1.5rem; }
.avatar-sm { width: 30px; height: 30px; font-size: 0.75rem; border-width: 2px; }

/* STAT CARD */
.stat-card {
  background: var(--surface);
  border: var(--border-w) solid var(--black);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.stat-card .stat-icon {
  font-size: 2rem; margin-bottom: 0.5rem;
}
.stat-card .stat-value {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
}
.stat-card .stat-change {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.5rem;
}
.stat-change.up   { color: var(--green); }
.stat-change.down { color: var(--red); }

/* UTILITY */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.p-0  { padding: 0; }
.p-1  { padding: 0.5rem; }
.p-2  { padding: 1rem; }
.p-3  { padding: 1.5rem; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.rounded { border-radius: var(--radius); }
.divide-y > * + * { border-top: 2px solid #eee; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--black); border-radius: 0; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hide-mobile { display: none !important; }
}
