/* =========================================================
   SHARESHED — STYLESHEET
   Tokens, layout, components, animations, dark mode, responsive
   ========================================================= */

:root {
  --bg: #f3f5f1;
  --surface: #ffffff;
  --surface-soft: #eef2ea;
  --text: #1c2620;
  --text-soft: #5b6a60;
  --primary: #2f5d3a;
  --primary-dark: #1f4029;
  --primary-light: #4a8a57;
  --accent: #c97c3d;
  --accent-dark: #a8602a;
  --accent-soft: #f6e4cd;
  --border: #dee5dc;
  --shadow: 0 4px 14px rgba(31, 64, 41, 0.10);
  --shadow-lg: 0 14px 34px rgba(31, 64, 41, 0.16);
  --danger: #c0392b;
  --success: #2f7d4f;
  --radius: 14px;
  --radius-sm: 8px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html[data-theme="dark"] {
  --bg: #111813;
  --surface: #1a221c;
  --surface-soft: #202b22;
  --text: #e7efe6;
  --text-soft: #9fb0a4;
  --primary: #52b06a;
  --primary-dark: #2f5d3a;
  --primary-light: #6cc983;
  --accent: #e2954f;
  --accent-dark: #c97c3d;
  --accent-soft: #2b2118;
  --border: #2a352c;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 38px rgba(0, 0, 0, 0.55);
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.4s ease, color 0.4s ease;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); }
img { max-width: 100%; display: block; }
a { color: inherit; }
section { padding: 56px 6vw; max-width: 1280px; margin: 0 auto; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}
h2 {
  font-size: clamp(24px, 3vw, 32px);
  margin-bottom: 22px;
  border-left: 5px solid var(--primary);
  padding-left: 12px;
}

/* ---------- Reveal-on-scroll base ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* =========================================================
   TOAST
   ========================================================= */
.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 999;
  background: var(--success);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 600;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.toast.error { background: var(--danger); }
.toast.show { transform: translateX(0); opacity: 1; }

/* =========================================================
   HEADER
   ========================================================= */
header {
  background: var(--primary-dark);
  color: #fff;
  padding: 16px 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  height: 46px; width: 46px;
  border-radius: 12px;
  background: #fff;
  color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand h1 { font-size: 23px; color: #fff; letter-spacing: -0.01em; }
.tagline { font-size: 13px; color: #cfe6d0; font-family: var(--font-mono); min-height: 16px; }
.tagline::after { content: '|'; animation: blink 1s step-end infinite; }
.tagline.done::after { display: none; }

.student-card {
  text-align: right;
  font-size: 12.5px;
  background: rgba(255,255,255,0.08);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.15);
}
.student-card p { color: #e3f0e2; }
.student-card span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: #9fc3a2; }

/* =========================================================
   NAVIGATION
   ========================================================= */
nav { background: var(--primary); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,0.12); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 0 5vw; max-width: 1280px; margin: 0 auto; }
nav ul { display: flex; list-style: none; flex-wrap: wrap; }
.nav-link {
  display: block; padding: 14px 18px; color: #fff; text-decoration: none;
  font-size: 14px; font-weight: 500; position: relative; transition: background 0.25s ease, color 0.25s ease;
}
.nav-link::after {
  content: ''; position: absolute; left: 18px; right: 18px; bottom: 6px; height: 2px;
  background: var(--accent); transform: scaleX(0); transition: transform 0.25s ease; transform-origin: left;
}
.nav-link:hover { background: var(--primary-light); }
.nav-link.active { color: #ffe6cb; }
.nav-link.active::after { transform: scaleX(1); }

.nav-toggle { display: none; background: none; border: none; color: #fff; cursor: pointer; padding: 10px; }
.nav-utils { display: flex; align-items: center; gap: 10px; }
.clock { font-family: var(--font-mono); font-size: 13px; color: #e3f0e2; background: rgba(255,255,255,0.1); padding: 6px 10px; border-radius: 20px; white-space: nowrap; }

.icon-btn, .theme-toggle {
  background: rgba(255,255,255,0.12); border: none; color: #fff; width: 36px; height: 36px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer;
  position: relative; transition: transform 0.25s ease, background 0.25s ease;
}
.icon-btn:hover, .theme-toggle:hover { background: rgba(255,255,255,0.25); transform: translateY(-2px); }
.theme-toggle svg { transition: transform 0.4s ease; }
.theme-toggle:active svg { transform: rotate(25deg); }

.badge {
  position: absolute; top: -4px; right: -4px; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; animation: pulse 2s ease-in-out infinite;
}
.badge.zero { display: none; }

.notif-wrap { position: relative; }
.notif-panel {
  position: absolute; top: 50px; right: 0; width: 320px; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  opacity: 0; visibility: hidden; transform: translateY(-10px); transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 60; overflow: hidden;
}
.notif-panel.open { opacity: 1; visibility: visible; transform: translateY(0); }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.notif-head h4 { font-size: 14px; color: var(--text); }
.text-btn { background: none; border: none; color: var(--primary); font-size: 12px; font-weight: 600; cursor: pointer; }
.text-btn:hover { text-decoration: underline; }
.notif-list { list-style: none; max-height: 320px; overflow-y: auto; }
.notif-list li { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-soft); transition: background 0.2s ease; }
.notif-list li:last-child { border-bottom: none; }
.notif-list li:hover { background: var(--surface-soft); }
.notif-list li svg { color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.notif-list li p { font-size: 12.5px; color: var(--text); margin: 0; }
.notif-list li time { font-size: 11px; color: var(--text-soft); }
.notif-list li.unread { background: var(--accent-soft); }
.notif-list li.unread::before { content: ''; }

/* =========================================================
   WELCOME BANNER
   ========================================================= */
.welcome { background: var(--surface); }
.pegboard {
  background-image: radial-gradient(var(--border) 1.4px, transparent 1.4px);
  background-size: 22px 22px;
  border-radius: var(--radius);
}
.welcome-inner { animation: fadeSlideIn 0.9s ease both; }
.hero-title { font-size: clamp(28px, 4vw, 42px); margin-bottom: 12px; }
.lede { font-size: 16px; color: var(--text-soft); max-width: 640px; margin-bottom: 28px; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.info-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.info-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.info-card h4 { font-size: 14px; color: var(--primary); margin-bottom: 8px; }
.info-card p { font-size: 13.5px; color: var(--text-soft); }

/* =========================================================
   DASHBOARD STATS
   ========================================================= */
.stats { display: flex; gap: 18px; flex-wrap: wrap; }
.stat-card {
  background: var(--surface); border-radius: var(--radius); padding: 22px 18px; flex: 1; min-width: 150px;
  text-align: center; box-shadow: var(--shadow); border-top: 4px solid var(--primary);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.stat-card:hover { transform: translateY(-6px) scale(1.03); box-shadow: var(--shadow-lg); }
.stat-icon { display: inline-flex; color: var(--accent); margin-bottom: 8px; }
.stat-card h3 { font-family: var(--font-mono); font-size: 26px; color: var(--primary); }
.stat-card p { font-size: 13px; color: var(--text-soft); margin-top: 5px; }

.progress-block { margin-top: 26px; max-width: 460px; }
.progress-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-soft); margin-bottom: 6px; }
.progress-pct { font-family: var(--font-mono); color: var(--primary); font-weight: 600; }
.progress-track { height: 10px; background: var(--surface-soft); border-radius: 20px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 20px; transition: width 1.4s cubic-bezier(.22,.85,.32,1); }

/* =========================================================
   FEATURES / SERVICES CARD GRIDS
   ========================================================= */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.feature-card, .service-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  opacity: 0; transform: translateY(18px) scale(0.97); animation: cardIn 0.6s ease forwards;
}
.card-grid.in-view .feature-card, .card-grid.in-view .service-card { opacity: 1; transform: none; }
.feature-card:hover, .service-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.feature-icon { display: inline-flex; color: #fff; background: var(--primary); padding: 10px; border-radius: 10px; margin-bottom: 12px; transition: transform 0.4s ease; }
.feature-card:hover .feature-icon { transform: rotate(8deg) scale(1.1); }
.feature-card h4, .service-card h4 { font-size: 15px; margin-bottom: 6px; }
.feature-card p, .service-card p { font-size: 13px; color: var(--text-soft); }
.service-no { font-family: var(--font-mono); font-size: 22px; color: var(--accent); font-weight: 700; }

/* =========================================================
   SLIDER
   ========================================================= */
.slider { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); height: 260px; }
.slides { position: relative; height: 100%; }
.slide {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #fff; padding: 20px; opacity: 0; transform: scale(1.05);
  transition: opacity 0.7s ease, transform 0.7s ease; pointer-events: none;
}
.slide.active { opacity: 1; transform: scale(1); pointer-events: auto; }
.slide svg { margin-bottom: 12px; }
.slide h3 { color: #fff; font-size: 22px; margin-bottom: 6px; }
.slide p { font-size: 14px; color: rgba(255,255,255,0.9); max-width: 360px; }
.slide--power { background: linear-gradient(135deg, #2f5d3a, #1f4029); }
.slide--ladder { background: linear-gradient(135deg, #c97c3d, #a8602a); }
.slide--garden { background: linear-gradient(135deg, #3c7a49, #234a2c); }
.slide--paint { background: linear-gradient(135deg, #4a8a57, #2f5d3a); }

.slide-btn {
  position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.2);
  border: none; color: #fff; width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background 0.25s ease, transform 0.25s ease; z-index: 5;
}
.slide-btn:hover { background: rgba(255,255,255,0.4); transform: translateY(-50%) scale(1.1); }
.slide-btn.prev { left: 14px; } .slide-btn.next { right: 14px; }
.dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; z-index: 5; }
.dots button { width: 9px; height: 9px; border-radius: 50%; border: none; background: rgba(255,255,255,0.5); cursor: pointer; transition: background 0.25s ease, transform 0.25s ease; }
.dots button.active { background: #fff; transform: scale(1.25); }

/* =========================================================
   TICKER (Latest Updates)
   ========================================================= */
.ticker { background: var(--accent-soft); border-radius: var(--radius-sm); overflow: hidden; padding: 12px 0; }
.ticker-track { display: flex; gap: 50px; white-space: nowrap; animation: ticker 22s linear infinite; }
.ticker-track span { font-weight: 600; color: var(--primary-dark); font-size: 14px; }

/* =========================================================
   FORM
   ========================================================= */
form { background: var(--surface); padding: 26px; border-radius: var(--radius); max-width: 600px; box-shadow: var(--shadow); }
form label { display: block; margin-top: 14px; font-size: 13.5px; font-weight: 600; color: var(--text); }
form input, form select, form textarea {
  width: 100%; padding: 10px; margin-top: 5px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; background: var(--bg); color: var(--text); transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
form input:focus, form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,93,58,0.15); }
form input.invalid, form textarea.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(192,57,43,0.12); }
form input.valid, form textarea.valid { border-color: var(--success); }
.field-error { display: block; min-height: 16px; font-size: 12px; color: var(--danger); margin-top: 4px; }
.radio-group { margin-top: 6px; display: flex; gap: 20px; flex-wrap: wrap; }
.radio-option { display: flex; align-items: center; gap: 6px; }
.radio-option input[type="radio"] { width: auto; margin: 0; }
.radio-option label { display: inline; margin: 0; font-weight: normal; }
.btn-row { margin-top: 22px; display: flex; gap: 10px; }

.btn {
  padding: 11px 26px; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface-soft); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; padding: 10px 25px; border-radius: var(--radius-sm); font-size: 14px; }

/* =========================================================
   TABLE
   ========================================================= */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: var(--surface); min-width: 560px; }
table th, table td { border: 1px solid var(--border); padding: 12px; text-align: left; font-size: 13.5px; }
table th { background: var(--primary); color: #fff; }
table tr:nth-child(even) { background: var(--surface-soft); }
table tr:hover td { background: var(--accent-soft); }

/* =========================================================
   CONTACT
   ========================================================= */
.contact-info { background: var(--surface); padding: 22px; border-radius: var(--radius); box-shadow: var(--shadow); }
.contact-info p { margin: 8px 0; display: flex; align-items: center; gap: 10px; color: var(--text-soft); font-size: 14.5px; }
.contact-info p svg { color: var(--primary); flex-shrink: 0; }
.social-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.social-row a {
  display: flex; align-items: center; gap: 6px; text-decoration: none; color: var(--primary);
  font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 20px; background: var(--surface-soft);
  transition: background 0.25s ease, transform 0.25s ease;
}
.social-row a:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }

/* =========================================================
   FOOTER
   ========================================================= */
footer { background: var(--primary-dark); color: #d8ecd8; text-align: center; padding: 24px 20px; font-size: 14px; margin-top: 20px; }
.footer-social { display: flex; justify-content: center; gap: 14px; margin-top: 12px; }
.footer-social a { color: #d8ecd8; background: rgba(255,255,255,0.08); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background 0.25s ease, transform 0.25s ease; }
.footer-social a:hover { background: var(--accent); transform: translateY(-3px); }

/* =========================================================
   SCROLL TO TOP
   ========================================================= */
.scroll-top {
  position: fixed; bottom: 26px; right: 26px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none; display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, background 0.25s ease; z-index: 70;
}
.scroll-top.show { opacity: 1; visibility: visible; animation: bounceIn 0.5s ease; }
.scroll-top:hover { background: var(--primary-dark); transform: translateY(-4px); }

/* =========================================================
   KEYFRAME ANIMATIONS (7 distinct types)
   ========================================================= */
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: translateY(0); } } /* fade + slide */
@keyframes cardIn { to { opacity: 1; transform: none; } } /* zoom/scale-in */
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } } /* pulse */
@keyframes blink { 50% { opacity: 0; } } /* typing cursor blink */
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } } /* continuous slide */
@keyframes bounceIn { 0% { transform: translateY(30px) scale(0.6); opacity: 0; } 60% { transform: translateY(-8px) scale(1.05); opacity: 1; } 100% { transform: translateY(0) scale(1); } } /* bounce */
@keyframes spin { to { transform: rotate(360deg); } } /* rotating icon, used below */
.rotating { animation: spin 1.4s linear infinite; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-inner { flex-wrap: wrap; padding: 10px 5vw; }
  #navMenu {
    flex-direction: column; width: 100%; max-height: 0; overflow: hidden;
    transition: max-height 0.35s ease; order: 3;
  }
  #navMenu.open { max-height: 400px; }
  .nav-link { padding: 12px 10px; }
  .nav-utils { order: 2; }
  .student-card { text-align: left; }
  header { flex-direction: column; align-items: flex-start; }
  .notif-panel { right: -10px; width: 280px; }
}

@media (max-width: 540px) {
  section { padding: 40px 5vw; }
  .stats { gap: 12px; }
  .stat-card { min-width: 130px; padding: 16px 10px; }
  .slider { height: 300px; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
