/* style.css - Premium Modern SaaS & Smartphone Simulator Styles */

:root {
  /* Vibrant SaaS Color Palette */
  --primary: #4f46e5;         /* Deep Indigo */
  --primary-light: #e0e7ff;
  --primary-dark: #3730a3;
  --success: #10b981;         /* Emerald Green */
  --success-light: #d1fae5;
  --warning: #f59e0b;         /* Amber */
  --warning-light: #fef3c7;
  --danger: #ef4444;          /* Soft Coral Red */
  --danger-light: #fee2e2;
  --info: #06b6d4;            /* Cyan */
  --info-light: #cffaff;

  /* Surfaces & Backgrounds */
  --bg-color: #f1f5f9;
  --surface-color: #ffffff;
  --surface-hover: #f8fafc;
  
  /* Text */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #ffffff;
  
  /* Borders & Shadows */
  --border-color: #e2e8f0;
  --rounded-sm: 8px;
  --rounded: 12px;
  --rounded-lg: 20px;
  --rounded-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  --shadow-float: 0 20px 40px -15px rgba(79, 70, 229, 0.25);

  --sidebar-w: 260px;
  --nav-h: 70px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Typography */
h1, h2, h3, h4, h5 {
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: -0.02em;
}
p { color: var(--text-muted); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--rounded-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-success { background: var(--success-light); color: #047857; }
.badge-warning { background: var(--warning-light); color: #b45309; }
.badge-danger  { background: var(--danger-light); color: #b91c1c; }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-info    { background: var(--info-light); color: #0891b2; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--rounded);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  outline: none;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(79, 70, 229, 0.5);
}
.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.35);
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(16, 185, 129, 0.5);
}
.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
}
.btn-outline {
  background: white;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background: var(--surface-hover);
  border-color: #cbd5e1;
}
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; border-radius: var(--rounded-sm); }
.btn-block { width: 100%; }

/* Input Groups & Forms */
.input-group { margin-bottom: 1.1rem; }
.input-group label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrapper i {
  position: absolute;
  left: 0.9rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}
.input-wrapper input, .input-wrapper select, .input-wrapper textarea {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.6rem;
  border: 1px solid var(--border-color);
  border-radius: var(--rounded);
  background: var(--surface-color);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-wrapper textarea { padding-left: 1rem; min-height: 80px; resize: vertical; }
.input-wrapper input:focus, .input-wrapper select:focus, .input-wrapper textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

/* Glass Panels & Cards */
.card {
  background: var(--surface-color);
  border-radius: var(--rounded);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}
.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: var(--shadow-lg);
  border-radius: var(--rounded-lg);
}

/* Login Screen */
#login-screen {
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at 10% 20%, #e0e7ff 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, #d1fae5 0%, transparent 40%);
  background-color: var(--bg-color);
}
.login-card {
  width: 100%;
  max-width: 440px;
  padding: 2.5rem;
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-header { text-align: center; margin-bottom: 1.75rem; }
.login-header i { font-size: 3.2rem; color: var(--primary); margin-bottom: 0.5rem; }

/* Main App Layout */
#app-screen { display: flex; height: 100vh; width: 100vw; overflow: hidden; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface-color);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}
.logo-box {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: var(--rounded);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.sidebar-header h2 { font-size: 1.15rem; }
.mobile-close { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

.sidebar-nav {
  flex: 1;
  padding: 1.25rem 0.75rem;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--rounded);
  font-weight: 500;
  font-size: 0.925rem;
  margin-bottom: 0.25rem;
  transition: all 0.2s;
}
.nav-item i { font-size: 1.25rem; }
.nav-item:hover { background: var(--surface-hover); color: var(--text-main); }
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-hover);
}
.user-profile { display: flex; align-items: center; gap: 0.75rem; }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--rounded-full);
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.user-info strong { display: block; font-size: 0.85rem; }
.user-info small { color: var(--text-muted); font-size: 0.75rem; }
.btn-logout { background: none; border: none; color: var(--danger); font-size: 1.3rem; cursor: pointer; }

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-color);
}
.top-nav {
  height: var(--nav-h);
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.top-nav-left { display: flex; align-items: center; gap: 1rem; }
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.top-nav-right { display: flex; align-items: center; gap: 1rem; }

/* View Mode Selector (Web Admin | Parent App | Teacher App) */
.view-mode-selector {
  display: flex;
  background: var(--bg-color);
  padding: 0.25rem;
  border-radius: var(--rounded-full);
  border: 1px solid var(--border-color);
}
.mode-btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--rounded-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}
.mode-btn.active {
  background: var(--surface-color);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.view-container {
  flex: 1;
  padding: 1.75rem;
  overflow-y: auto;
}

/* Dashboard Analytics Grid */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--surface-color);
  border-radius: var(--rounded);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
  user-select: none;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.chart-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--rounded);
  padding: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.chart-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--rounded);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}
.bg-blue   { background: var(--primary-light); color: var(--primary); }
.bg-green  { background: var(--success-light); color: var(--success); }
.bg-yellow { background: var(--warning-light); color: var(--warning); }
.bg-red    { background: var(--danger-light);  color: var(--danger); }
.bg-purple { background: #f3e8ff; color: #9333ea; }

.stat-info h3 { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.stat-info p  { font-size: 1.5rem; font-weight: 700; color: var(--text-main); margin-top: 0.1rem; }

/* Quick Access Modules */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
.module-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--rounded);
  padding: 1.25rem;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  user-select: none;
}
.module-card i { font-size: 2.2rem; color: var(--primary); margin-bottom: 0.5rem; display: block; }
.module-card h3 { font-size: 0.95rem; color: var(--text-main); font-weight: 600; }
.module-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow); }

/* Custom SVG Charts */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}
.chart-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--rounded);
  padding: 1.5rem;
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--rounded);
  border: 1px solid var(--border-color);
  background: var(--surface-color);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}
.data-table th {
  background: var(--surface-hover);
  padding: 0.9rem 1.2rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}
.data-table td {
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}
.data-table tbody tr:hover { background: var(--surface-hover); }

/* --- Mobile Application Simulator --- */
.mobile-simulator-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1rem;
  min-height: calc(100vh - 120px);
}
.smartphone-frame {
  width: 390px;
  height: 780px;
  background: #0f172a;
  border-radius: 44px;
  padding: 12px;
  box-shadow: var(--shadow-float);
  position: relative;
  border: 4px solid #334155;
}
.smartphone-notch {
  width: 130px;
  height: 24px;
  background: #0f172a;
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  z-index: 100;
}
.smartphone-screen {
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  border-radius: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.mobile-status-bar {
  height: 38px;
  background: var(--primary);
  color: white;
  padding: 0 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  padding-top: 6px;
}
.mobile-app-header {
  background: var(--primary);
  color: white;
  padding: 0.85rem 1.2rem 1.25rem 1.2rem;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  box-shadow: var(--shadow);
}
.mobile-app-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  padding-bottom: 70px;
}
.mobile-nav-bar {
  height: 60px;
  background: white;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 80;
}
.mobile-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
}
.mobile-tab i { font-size: 1.3rem; }
.mobile-tab.active { color: var(--primary); }

/* Mobile Cards */
.mobile-card {
  background: white;
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-color);
}
.mobile-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-box {
  background: white;
  border-radius: var(--rounded-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-float);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.modal-header {
  padding: 1.25rem 1.5rem;
  background: var(--surface-hover);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body { padding: 1.5rem; max-height: 80vh; overflow-y: auto; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--surface-hover);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.toast {
  background: var(--text-main);
  color: white;
  padding: 0.85rem 1.25rem;
  border-radius: var(--rounded);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  animation: slideLeft 0.3s ease;
}
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideLeft {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Responsive Rules */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .mobile-close { display: block; }
  .menu-toggle { display: block; }
  .view-container { padding: 1rem; }
  .mode-btn span { display: none; }
}

/* Print Styles */
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { position: absolute; left: 0; top: 0; width: 100%; }
}
