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

:root {
  --primary: #1e3a8a;
  --primary-light: #3b82f6;
  --secondary: #10b981;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.07), 0 4px 6px -4px rgb(0 0 0 / 0.07);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --navbar-height: 64px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Nunito', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  color: var(--primary);
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary);
}

/* Accessibility (a11y): Focus visible outline for keyboard navigation */
:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 6px;
}

/* Layout Containers */
.layout-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling (Admin) */
.sidebar {
  width: 260px;
  background-color: var(--primary);
  color: #ffffff;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
  transition: var(--transition);
}

.sidebar h2 {
  color: #ffffff;
  font-size: 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
}

.sidebar-nav a {
  color: #93c5fd;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-nav a:hover {
  background-color: rgb(255 255 255 / 0.1);
  color: #ffffff;
  transform: translateX(4px);
}

.sidebar-nav li.active a {
  background-color: rgb(255 255 255 / 0.15);
  color: #ffffff;
  border-left: 4px solid #ffffff;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding-left: 1.25rem;
}

.sidebar-footer {
  margin-top: auto;
}

.sidebar-footer a {
  color: #f87171;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  font-weight: 600;
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  padding: 2rem;
  overflow-y: auto;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Header Navbar (Guru/Siswa) */
.navbar {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 2rem;
  height: var(--navbar-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

.navbar-brand {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
  display: flex;
  align-items: center;
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.navbar-menu a {
  color: var(--text-muted);
  font-weight: 600;
}

.navbar-menu li.active a,
.navbar-menu a:hover {
  color: var(--primary);
}

/* Custom button logout */
.btn-logout-navbar {
  color: #ef4444 !important;
  background-color: #fef2f2;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-logout-navbar:hover {
  background-color: #fee2e2;
  color: #b91c1c !important;
  transform: translateY(-1px);
}

/* Profile dropdown switcher anim */
.profile-dropdown-animated {
  position: absolute;
  right: 0;
  top: 120%;
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 230px;
  z-index: 100;
  padding: 0.5rem 0;
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-dropdown-animated.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Mobile Bottom Navigation (Siswa) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--card-bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgb(0 0 0 / 0.05);
  z-index: 50;
}

.mobile-nav-items {
  display: flex;
  justify-content: space-around;
  list-style: none;
  padding: 0.5rem 0;
}

.mobile-nav-items a {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  gap: 0.25rem;
}

.mobile-nav-items li.active a,
.mobile-nav-items a:hover {
  color: var(--primary);
}

.mobile-nav-items svg {
  width: 24px;
  height: 24px;
}

/* UI Elements: Cards */
.card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  margin-bottom: 1.5rem;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-title {
  margin-bottom: 1rem;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Forms controls */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  font-size: 1rem;
  min-height: 48px; /* Touch-friendly size */
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #172554;
}

.btn-secondary {
  background-color: var(--secondary);
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: #065f46;
}

.btn-accent {
  background-color: var(--accent);
  color: #ffffff;
}

.btn-accent:hover {
  background-color: #d97706;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background-color: var(--bg);
}

.btn-danger {
  background-color: #ef4444;
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-block {
  width: 100%;
}

/* Utility classes */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.alert-danger {
  background-color: #fef2f2;
  border: 1px solid #fee2e2;
  color: #991b1b;
}

.alert-success {
  background-color: #f0fdf4;
  border: 1px solid #dcfce7;
  color: #166534;
}

/* Login Page Layout */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 40%, #06b6d4 70%, #10b981 100%);
  position: relative;
  overflow: hidden;
}

/* Decorative floating shapes */
.login-wrapper::before,
.login-wrapper::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.12;
  pointer-events: none;
}

.login-wrapper::before {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #ffffff 0%, transparent 70%);
  top: -100px;
  right: -80px;
  animation: float-shape 8s ease-in-out infinite;
}

.login-wrapper::after {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #fbbf24 0%, transparent 70%);
  bottom: -60px;
  left: -60px;
  animation: float-shape 10s ease-in-out infinite reverse;
}

@keyframes float-shape {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

/* Entrance animation */
@keyframes slide-up-fade {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

.login-card {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  padding: 2.5rem;
  position: relative;
  z-index: 1;
  animation: slide-up-fade 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

/* Education-themed icon cluster above logo */
.login-header-icons {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.5rem;
  animation: slide-up-fade 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.login-logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.login-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.25rem;
}

.login-tabs {
  display: flex;
  border-radius: 10px;
  background-color: #f1f5f9;
  padding: 0.3rem;
  margin-bottom: 1.5rem;
}

.login-tab-btn {
  flex: 1;
  text-align: center;
  padding: 0.65rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.login-tab-btn:hover {
  color: var(--primary);
}

.login-tab-btn.active {
  background-color: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.12);
  transform: scale(1.02);
}

.login-form-panel {
  display: none;
}

.login-form-panel.active {
  display: block;
  animation: slide-up-fade 0.35s ease-out both;
}

/* Weather Widget styling */
.weather-widget {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.weather-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.weather-temp {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.weather-aqi {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
}

.aqi-good { background-color: var(--secondary); }
.aqi-moderate { background-color: var(--accent); }
.aqi-unhealthy { background-color: #ef4444; }

.weather-message {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 0.25rem;
}

/* QR Scanner styling */
.qr-scanner-box {
  background-color: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  aspect-ratio: 4/3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

#reader {
  width: 100%;
  height: 100%;
}

/* Progress Bar Dashboard Siswa */
.progress-container {
  background-color: #e2e8f0;
  border-radius: 9999px;
  height: 12px;
  width: 100%;
  overflow: hidden;
  margin: 0.5rem 0 1.5rem;
}

.progress-bar-siswa {
  background: linear-gradient(90deg, var(--primary-light) 0%, var(--secondary) 100%);
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease-out;
}

/* Child-friendly Student Mission Cards */
.misi-card-child {
  display: flex;
  background-color: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 1.25rem;
  position: relative;
}

.misi-card-child:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: rgba(59, 130, 246, 0.3);
}

.misi-status-block {
  width: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  position: relative;
  padding: 1rem 0.5rem;
}

.misi-status-icon {
  font-size: 2rem;
  margin-bottom: 0.35rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.misi-status-text {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  line-height: 1.2;
}

/* Status variants */
.misi-status-locked { background-color: #64748b; }
.misi-status-active { background-color: #f59e0b; }
.misi-status-done { background-color: #10b981; }
.misi-status-pending { background-color: #3b82f6; }

.misi-content-block {
  flex-grow: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.misi-slot-info {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.misi-title-child {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.misi-desc-child {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.misi-footer-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: auto;
}

.misi-author {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Custom enhanced weather widget background */
.weather-widget-enhanced {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  border: none;
  box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
  color: #ffffff !important;
}

.weather-widget-enhanced .weather-temp,
.weather-widget-enhanced .weather-message {
  color: #ffffff !important;
}

/* Sidebar toggle button (Mobile only) */
.admin-sidebar-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 99;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.admin-sidebar-toggle:hover {
  background-color: var(--primary-light);
}

/* Sidebar overlay */
.admin-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 97;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.admin-sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .layout-container {
    flex-direction: column;
  }

  .admin-layout {
    flex-direction: row;
  }

  .admin-layout .main-content {
    padding-top: 4.5rem;
  }
  
  .admin-sidebar-toggle {
    display: flex;
  }
  
  .admin-sidebar-overlay {
    display: block;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    z-index: 98;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }
  
  .sidebar-nav {
    flex-direction: column;
    flex-wrap: nowrap;
  }
  
  .main-content {
    padding: 1rem;
    margin-bottom: 60px; /* Spacer for mobile bottom nav */
  }
  
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  
  .navbar-menu {
    display: none; /* Handled by bottom nav on mobile */
  }
  
  .mobile-bottom-nav {
    display: block;
  }
}

/* SECTION 5 CLEANUP UTILITY CLASSES */
.text-muted-sm {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-dashboard-stat {
  margin-bottom: 0 !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-number {
  font-weight: 800;
  margin: 0.5rem 0;
}
.stat-number.primary { color: var(--primary); font-size: 1.75rem; }
.stat-number.secondary { color: var(--secondary); font-size: 2rem; }
.stat-number.accent { color: var(--accent); font-size: 1.75rem; }

.progress-container-sm {
  width: 100%;
  height: 8px;
  background-color: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.btn-stat-action {
  min-height: 40px !important;
}

.truncate-2 {
  line-clamp: 2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.flex-grow-1 {
  flex-grow: 1;
}

.card-no-margin {
  margin-bottom: 0 !important;
}

.badge-slot {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  display: inline-block;
  color: #ffffff;
}

.card-accent-left {
  border-left: 5px solid var(--primary);
}

/* Semantic status badges (non-AQI) */
.badge-status-done {
  background-color: var(--secondary);
  color: #ffffff;
}

.badge-status-active {
  background-color: var(--accent);
  color: #ffffff;
}

.badge-status-pending {
  background-color: var(--primary-light);
  color: #ffffff;
}

.badge-status-locked {
  background-color: var(--text-muted);
  color: #ffffff;
}

/* Shimmer loading skeleton effect */
.skeleton {
  position: relative;
  overflow: hidden;
  background-color: rgba(226, 232, 240, 0.4);
  color: transparent !important;
  border-color: transparent !important;
  border-radius: 4px;
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 20%,
    rgba(255, 255, 255, 0.6) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* Weather icon animate */
.weather-animate {
  animation: weather-spin 8s linear infinite;
  display: inline-block;
}

@keyframes weather-spin {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(15deg) scale(1.1); }
  100% { transform: rotate(0deg); }
}

.weather-widget-enhanced {
  transition: opacity 0.5s ease-in-out;
}

/* Teacher Workspace Section 8 CSS */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
}

.workspace-left-panel {
  border-right: 1px solid var(--border);
  padding-right: 1.5rem;
}

.misi-card-teacher {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  margin-bottom: 1.25rem;
}

.misi-card-teacher:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(59, 130, 246, 0.25);
}

.misi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.misi-card-tagihan-block {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  background-color: var(--bg);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border-left: 3px solid var(--primary-light);
}

.misi-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.25rem;
  border-top: 1px dashed var(--border);
  padding-top: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Dark Theme Variables */
.dark-theme,
:root.dark-theme {
  --primary: #60a5fa;
  --primary-light: #93c5fd;
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
}

/* Specific elements adjustments for Dark Theme */
.dark-theme .login-card {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  color: #f8fafc;
}

.dark-theme .login-logo {
  color: var(--primary-light);
}

.dark-theme .login-subtitle {
  color: var(--text-muted);
}

.dark-theme .login-tabs {
  background-color: #0f172a;
}

.dark-theme .login-tab-btn {
  color: var(--text-muted);
}

.dark-theme .login-tab-btn.active {
  background-color: #1e293b;
  color: var(--primary-light);
}

.dark-theme .login-tab-btn:hover {
  color: var(--primary-light);
}

/* Ensure child mission cards elements stand out in dark mode */
.dark-theme .misi-card-child {
  border-color: var(--border);
}

.dark-theme .misi-card-child:hover {
  border-color: rgba(59, 130, 246, 0.5);
}

.dark-theme input, 
.dark-theme select, 
.dark-theme textarea {
  background-color: #0f172a;
  color: #f8fafc;
  border-color: #334155;
}

.dark-theme .btn-outline {
  color: var(--primary-light);
  border-color: var(--primary-light);
}

.dark-theme .btn-outline:hover {
  background-color: rgba(59, 130, 246, 0.1);
}

.dark-theme .weather-widget-enhanced {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

/* Sidebar navigation updates for dark theme */
.dark-theme .sidebar {
  background-color: #0f172a;
  border-right: 1px solid var(--border);
}

.dark-theme .sidebar-nav a {
  color: var(--text-muted);
}

.dark-theme .sidebar-nav a:hover,
.dark-theme .sidebar-nav li.active a {
  color: #ffffff;
}

/* Theme toggle button specific styling */
.theme-toggle-btn:hover {
  background-color: rgb(255 255 255 / 0.05) !important;
  color: #ffffff !important;
}

.theme-toggle-nav-btn {
  transition: transform 0.25s ease;
}

.theme-toggle-nav-btn:hover {
  transform: scale(1.15) rotate(12deg);
}

/* Child Voice Player & Voice Recorder Component */
.child-voice-player-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.child-voice-player-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15) !important;
}

@keyframes pulse-voice {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.voice-icon-pulse {
  animation: pulse-voice 2s infinite ease-in-out;
}

.dark-theme .child-voice-player-card {
  background: linear-gradient(135deg, #1e293b, #0f172a) !important;
  border-color: #3b82f6 !important;
}

/* Pin Toggle Buttons & Progress Bar CSS Helpers */
.btn-pin-toggle.pinned {
  border-color: #ef4444 !important;
  color: #ef4444 !important;
}
.btn-pin-toggle.unpinned {
  border-color: #10b981 !important;
  color: #10b981 !important;
}

.progress-container {
  width: 100%;
  height: 10px;
  background-color: var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-bar-siswa {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary), #10b981);
  border-radius: 10px;
  transition: width 0.4s ease;
  width: var(--progress-val, 0%);
}

/* Subject Badges Design System (BSKAP 046/2025) */
.badge-mapel {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.badge-mapel-indonesia { background-color: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.badge-mapel-matematika { background-color: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-mapel-ipas { background-color: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }
.badge-mapel-pancasila { background-color: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.badge-mapel-seni { background-color: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.badge-mapel-agama { background-color: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-mapel-pjok { background-color: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.badge-mapel-inggris { background-color: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }
.badge-mapel-ai { background-color: #cffafe; color: #0e7490; border: 1px solid #a5f3fc; }
.badge-mapel-mulok { background-color: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.badge-mapel-default { background-color: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

/* Visual Slot Picker Cards Design System */
.slot-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.slot-card-item {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  background: white;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}

.slot-card-item.available {
  border-color: #10b981;
  background: #f0fdf4;
  cursor: pointer;
}

.slot-card-item.available:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.15);
}

.slot-card-item.selected {
  border-color: var(--primary) !important;
  background: #eff6ff !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.slot-card-item.taken {
  border-color: #fca5a5;
  background: #fef2f2;
  opacity: 0.85;
  cursor: not-allowed;
}

.slot-card-item.mine {
  border-color: #93c5fd;
  background: #f0f9ff;
}

.slot-card-header {
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.slot-card-status {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 0.35rem;
}

.slot-card-item.available .slot-card-status { background: #dcfce7; color: #15803d; }
.slot-card-item.taken .slot-card-status { background: #fee2e2; color: #b91c1c; }
.slot-card-item.mine .slot-card-status { background: #dbeafe; color: #1e40af; }

.slot-card-info {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Accessibility: Animation Engineer prefers-reduced-motion optimization */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

