/* =====================
   RESET + BASE
===================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

:root {
  --bg-primary: #020617;
  --bg-secondary: #0f172a;
  --bg-card: #1e293b;
  --border-color: #334155;
  --text-primary: #ffffff;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-primary: #fb923c;
  --accent-secondary: #f97316;
  --accent-dark: #c2410c;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #facc15;
  --neon-glow: rgba(251, 146, 60, 0.6);
  --neon-glow-strong: rgba(251, 146, 60, 0.9);
}

body {
  background: linear-gradient(180deg, var(--bg-primary), var(--bg-secondary));
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.3s ease;
}

/* =====================
   DARK/LIGHT MODE
===================== */
body.light-mode {
  --bg-primary: #f8fafc;
  --bg-secondary: #e2e8f0;
  --bg-card: #ffffff;
  --border-color: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
}

.theme-toggle {
  position: fixed;
  top: 70px;
  left: 20px;
  width: 50px;
  height: 50px;
  background: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(251, 146, 60, 0.4), 0 0 20px var(--neon-glow);
  z-index: 999;
  transition: transform 0.3s, box-shadow 0.3s;
  font-size: 24px;
  animation: neonPulse 2s infinite;
}

@keyframes neonPulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(251, 146, 60, 0.4), 0 0 20px var(--neon-glow);
  }
  50% {
    box-shadow: 0 6px 20px rgba(251, 146, 60, 0.6), 0 0 30px var(--neon-glow-strong);
  }
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(251, 146, 60, 0.6), 0 0 40px var(--neon-glow-strong);
}

.theme-toggle:active {
  transform: scale(0.95);
}

/* =====================
   TOP BAR
===================== */
.topbar {
  height: 56px;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 2px solid var(--accent-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1), 0 0 15px var(--neon-glow);
}

.topbar span {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-primary);
  text-shadow: 0 0 10px var(--neon-glow);
}

.menu-btn {
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.2s, text-shadow 0.3s;
}

.menu-btn:hover {
  transform: scale(1.1);
  text-shadow: 0 0 15px var(--neon-glow-strong);
}

/* =====================
   PAGE CONTAINER
===================== */
.page {
  padding: 16px;
  max-width: 900px;
  margin: auto;
}

.center-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.center {
  text-align: center;
}

/* =====================
   BOX / CARD WITH NEON
===================== */
.box, .card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2), 0 0 20px rgba(251, 146, 60, 0.1);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.box h2, .card h2 {
  margin-bottom: 12px;
  font-size: 20px;
  color: var(--text-primary);
  text-shadow: 0 0 8px var(--neon-glow);
}

.box p, .card p {
  color: var(--text-secondary);
  line-height: 1.7;
}

.login-card {
  max-width: 400px;
  width: 100%;
}

.clickable {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.clickable:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0,0,0,.3), 0 0 30px var(--neon-glow-strong);
  border-color: var(--accent-primary);
}

/* =====================
   BALANCE WITH NEON
===================== */
.balance {
  font-size: 32px;
  font-weight: bold;
  color: var(--accent-primary);
  text-align: center;
  margin-top: 10px;
  text-shadow: 0 0 20px var(--neon-glow-strong), 0 0 40px var(--neon-glow);
  animation: balancePulse 2s infinite;
}

@keyframes balancePulse {
  0%, 100% {
    opacity: 1;
    text-shadow: 0 0 20px var(--neon-glow-strong), 0 0 40px var(--neon-glow);
  }
  50% {
    opacity: 0.9;
    text-shadow: 0 0 30px var(--neon-glow-strong), 0 0 60px var(--neon-glow-strong);
  }
}

/* =====================
   GRID
===================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.card h3 {
  margin-bottom: 8px;
  color: var(--text-primary);
}

.card p {
  font-size: 14px;
  color: var(--text-muted);
}

/* =====================
   INPUTS WITH NEON FOCUS
===================== */
input, select, textarea {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 12px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.1), 0 0 20px var(--neon-glow);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

.input {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 12px;
}

/* =====================
   BUTTON WITH NEON GLOW
===================== */
button, .main-btn {
  width: 100%;
  padding: 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 8px 0 var(--accent-dark), 0 0 20px var(--neon-glow);
  transition: transform 0.2s, box-shadow 0.2s;
  text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

button:hover, .main-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 var(--accent-dark), 0 0 30px var(--neon-glow-strong);
}

button:active, .main-btn:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 var(--accent-dark), 0 0 15px var(--neon-glow);
}

/* =====================
   MESSAGES
===================== */
.msg {
  text-align: center;
  margin-top: 10px;
  font-size: 14px;
  padding: 10px;
  border-radius: 8px;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.small-text {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.small-text a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s, text-shadow 0.3s;
}

.small-text a:hover {
  color: var(--accent-secondary);
  text-shadow: 0 0 10px var(--neon-glow);
}

/* =====================
   COPY BOX (CHARGE)
===================== */
.copy-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 2px dashed var(--accent-primary);
  border-radius: 16px;
  padding: 14px;
  margin-top: 10px;
  background: rgba(251, 146, 60, 0.05);
  box-shadow: 0 0 15px rgba(251, 146, 60, 0.2);
}

.copy-box span {
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 1px;
  color: var(--text-primary);
  text-shadow: 0 0 10px var(--neon-glow);
}

.copy-box button {
  width: auto;
  padding: 10px 18px;
  font-size: 14px;
  box-shadow: none;
}

/* =====================
   NOTE
===================== */
.note {
  margin-top: 10px;
  color: var(--warning);
  font-size: 14px;
  padding: 10px;
  background: rgba(250, 204, 21, 0.1);
  border-radius: 8px;
  border-right: 4px solid var(--warning);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.2);
}

/* =====================
   SUBJECT / TEACHER CARDS
===================== */
.subjects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.subject-card {
  background: #fff;
  color: var(--bg-primary);
  border-radius: 16px;
  padding: 14px;
  text-align: center;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 0 15px rgba(251, 146, 60, 0.3);
}

.subject-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2), 0 0 25px var(--neon-glow-strong);
}

.teacher-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 14px;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.teacher-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3), 0 0 25px var(--neon-glow);
  border-color: var(--accent-primary);
}

.teacher-card img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 10px;
}

.teacher-card h3 {
  margin-bottom: 6px;
  color: var(--text-primary);
}

.teacher-card p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* =====================
   SIDEBAR WITH NEON
===================== */
#sidebar, .sidebar {
  position: fixed;
  top: 0;
  right: -260px;
  width: 260px;
  height: 100%;
  background: var(--bg-primary);
  border-left: 2px solid var(--accent-primary);
  padding: 20px;
  transition: right 0.3s ease;
  z-index: 999;
  overflow-y: auto;
  box-shadow: -4px 0 15px rgba(0,0,0,0.2), 0 0 30px var(--neon-glow);
}

#sidebar.active, .sidebar.active {
  right: 0;
}

#sidebar a, .sidebar a {
  display: block;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
}

#sidebar a:hover, .sidebar a:hover {
  background: var(--bg-card);
  transform: translateX(-4px);
  box-shadow: 0 0 15px var(--neon-glow);
}

#sidebar a.active, .sidebar a.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 20px var(--neon-glow-strong);
}

/* =====================
   WHATSAPP BUTTON WITH NEON
===================== */
.whatsapp-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 60px;
  height: 60px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4), 0 0 20px rgba(37, 211, 102, 0.5);
  z-index: 1000;
  transition: transform 0.3s, box-shadow 0.3s;
  text-decoration: none;
  animation: whatsappPulse 2s infinite;
}

@keyframes whatsappPulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4), 0 0 20px rgba(37, 211, 102, 0.5);
  }
  50% {
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6), 0 0 30px rgba(37, 211, 102, 0.8);
  }
}

.whatsapp-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6), 0 0 40px rgba(37, 211, 102, 0.9);
  animation: shake 0.5s;
}

.whatsapp-btn:active {
  transform: scale(0.95);
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg) scale(1.1); }
  25% { transform: rotate(-10deg) scale(1.1); }
  75% { transform: rotate(10deg) scale(1.1); }
}

/* =====================
   HERO SECTION (INDEX)
===================== */
.hero {
  text-align: center;
  padding: 60px 20px;
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient 3s ease infinite;
  background-size: 200% 200%;
  text-shadow: 0 0 30px var(--neon-glow-strong);
}

@keyframes gradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero p {
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.btn-main {
  display: inline-block;
  padding: 16px 40px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  text-decoration: none;
  border-radius: 999px;
  font-weight: bold;
  font-size: 18px;
  box-shadow: 0 8px 0 var(--accent-dark), 0 0 25px var(--neon-glow-strong);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 var(--accent-dark), 0 0 35px var(--neon-glow-strong);
}

.btn-main:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 var(--accent-dark), 0 0 15px var(--neon-glow);
}

.section {
  padding: 40px 20px;
  margin: 20px 0;
  animation: fadeIn 1s ease-out;
}

.section.light {
  background: rgba(30, 41, 59, 0.3);
  border-radius: 20px;
}

.section h2 {
  text-align: center;
  font-size: 32px;
  margin-bottom: 30px;
  color: var(--accent-primary);
  text-shadow: 0 0 15px var(--neon-glow);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.card.white {
  background: white;
  color: var(--bg-primary);
}

.footer {
  text-align: center;
  padding: 40px 20px;
  margin-top: 60px;
  border-top: 2px solid var(--border-color);
  box-shadow: 0 -2px 15px rgba(251, 146, 60, 0.1);
}

.footer p {
  color: var(--text-muted);
  margin-bottom: 10px;
}

.footer strong {
  color: var(--accent-primary);
  font-size: 20px;
  text-shadow: 0 0 10px var(--neon-glow);
}

/* =====================
   LOADING SPINNER
===================== */
.spinner {
  border: 4px solid rgba(251, 146, 60, 0.2);
  border-top: 4px solid var(--accent-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
  box-shadow: 0 0 15px var(--neon-glow);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* =====================
   RESPONSIVE
===================== */
@media (max-width: 600px) {
  .page {
    padding: 12px;
  }
  
  .hero h1 {
    font-size: 32px;
  }
  
  .hero p {
    font-size: 16px;
  }
  
  .whatsapp-btn {
    width: 50px;
    height: 50px;
    bottom: 15px;
    left: 15px;
  }
  
  .whatsapp-btn svg {
    width: 24px !important;
    height: 24px !important;
  }
  
  .theme-toggle {
    width: 45px;
    height: 45px;
    top: 65px;
    left: 15px;
    font-size: 20px;
  }
  
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* =====================
   ACCESSIBILITY
===================== */
*:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

button:focus, a:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 4px;
}

/* =====================
   PRINT STYLES
===================== */
@media print {
  .topbar, .sidebar, .whatsapp-btn, .theme-toggle {
    display: none;
  }
}