/* ===========================================================
   BubbleFocus Master Stylesheet
   Cleaned & Consolidated – Dark/Light Theme Support
   =========================================================== */

/* === BRAND TOKENS === */
:root {
  --bf-teal: #14B8A6;
  --bf-purple: #7C3AED;

  --bf-teal-soft: rgba(20, 184, 166, 0.18);
  --bf-purple-soft: rgba(124, 58, 237, 0.18);

  --bf-surface: rgba(255, 255, 255, 0.06);
  --bf-surface-2: rgba(255, 255, 255, 0.09);
  --bf-border: rgba(255, 255, 255, 0.16);

  --bf-shadow-sm: 0 10px 30px rgba(0,0,0,0.22);
  --bf-shadow-md: 0 16px 50px rgba(0,0,0,0.32);

  --bf-radius: 18px;
}

/* === GLOBAL STYLES === */
body {
  margin: 0;
  min-height: 100vh;

  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #e0e0e0;

  /* BubbleFocus global background */
  background:
    radial-gradient(1200px 600px at 15% 10%, rgba(20,184,166,0.35), transparent 60%),
    radial-gradient(1200px 600px at 85% 30%, rgba(124,58,237,0.35), transparent 60%),
    linear-gradient(135deg, #0b1f2a, #1a1a3a);

  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;

  transition:
    background-color 0.4s ease,
    color 0.4s ease;
}
.dashboard-container,
.container,
.visualisation-container,
.chart-card,
.data-panel {
  background: transparent;
}


a {
  color: #61dafb;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* === NAVBAR === */
.navbar {
  background-color: #2a2a3c;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: background-color 0.25s ease;
}

.nav-title {
  color: #ffffff;
  font-size: 1.5em;
  font-weight: bold;
}
.nav-title.active {
  text-decoration: underline;
}

/* === DROPDOWN (PROFILE MENU) === */
.dropdown {
  position: relative;
  display: inline-block;
}
.profile-icon {
  font-size: 1.5rem;
  cursor: pointer;
  color: #ffffff;
  user-select: none;
}
.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: #2c2f3a;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 6px;
  z-index: 1;
  min-width: 160px;
}
.dropdown:hover .dropdown-content {
  display: block;
}
.dropdown-content a {
  color: #00bcd4;
  padding: 8px 12px;
  text-decoration: none;
  display: block;
}
.dropdown-content a:hover {
  background-color: #3a3d4d;
}
.dropdown-content a.active {
  background: #111827;
  color: #ffffff;
}

/* === BUTTONS & ICONS === */
.icon-button {
  background-color: #1f2937;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px;
  margin: 6px 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-button:hover {
  background-color: #374151;
  transform: translateY(-1px);
}
.icon-button .icon {
  width: 20px;
  height: 20px;
}

/* === MAIN CONTAINER === */
.container {
  max-width: 960px;
  margin: 40px auto;
  background-color: #2e2e42;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

/* === DASHBOARD TILES (BUBBLE STYLE) === */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 12px 0 24px;
}

/* Bubble-card base */
.tile {
  position: relative;
  overflow: hidden;
  display: block;

  padding: 18px 16px;
  text-decoration: none;

  color: #e0e0e0;

  background: radial-gradient(900px 320px at 20% 10%, rgba(20,184,166,0.18), transparent 55%),
              radial-gradient(720px 320px at 95% 35%, rgba(124,58,237,0.18), transparent 55%),
              rgba(255,255,255,0.05);

  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 22px;

  box-shadow: var(--bf-shadow-sm);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, filter .14s ease;
}

.tile::before,
.tile::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(0px);
  opacity: 0.85;
}

/* Soft bubble highlights */
.tile::before {
  width: 180px;
  height: 180px;
  left: -40px;
  top: -55px;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.35), rgba(255,255,255,0.06) 55%, transparent 70%);
}

.tile::after {
  width: 160px;
  height: 160px;
  right: -55px;
  bottom: -65px;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.22), rgba(255,255,255,0.05) 55%, transparent 70%);
}

.tile:hover,
.tile:focus {
  transform: translateY(-3px);
  box-shadow: var(--bf-shadow-md);
  border-color: rgba(255,255,255,0.22);
}

.tile:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(20,184,166,0.30), var(--bf-shadow-md);
}

/* Headings and copy inside tiles */
.tile h4 {
  margin: 10px 0 6px;
  font-size: 1.05rem;
  font-weight: 800;
  color: rgba(255,255,255,0.95);
}

.tile p {
  margin: 0;
  color: rgba(255,255,255,0.78);
  font-size: 0.95rem;
  line-height: 1.35;
}

/* Icon bubble badge */
.tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;

  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), rgba(255,255,255,0.10) 55%, transparent 70%),
              linear-gradient(135deg, rgba(20,184,166,0.55), rgba(124,58,237,0.55));

  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}

/* Slight per-tile accent (optional) */
.tile:hover .tile-icon {
  filter: brightness(1.05);
}

/* === TABLES (PUPILS, ADMIN) === */
.table-wrap table,
.table-wrap th,
.table-wrap td {
  color: #f5f5f5 !important;
  background-color: #1f1f2a !important;
}
.table-wrap th {
  color: #ffffff !important;
  font-weight: 600;
}
.table-wrap td {
  border-color: #333;
}
.table-wrap tr:nth-child(even) td {
  background-color: #2a2a35 !important;
}
.save-btn {
  background-color: #2563eb;
  color: white;
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}
.save-btn:hover {
  background-color: #1d4ed8;
}

/* Make the superadmin panel span full container width */
.tile--full {
  width: 100%;
}

/* Optional: spacing so it clearly sits as the next row */
.superadmin-tile {
  margin-top: 18px;
}

/* Layout inside the superadmin tile */
.superadmin-head {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
}

.superadmin-school {
  display: flex;
  gap: 10px;
  align-items: center;
}

.superadmin-school select,
.superadmin-school button,
.superadmin-search input,
.superadmin-search button {
  border-radius: 10px;
}

/* Search row */
.superadmin-search {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.superadmin-search input {
  flex: 1;
  min-width: 260px;
}

/* Results table */
.superadmin-results {
  margin-top: 14px;
  overflow-x: auto;
}

.superadmin-results table {
  width: 100%;
  border-collapse: collapse;
}

.superadmin-results th,
.superadmin-results td {
  padding: 10px 8px;
}

.superadmin-results tr + tr {
  border-top: 1px solid rgba(255,255,255,0.12);
}

.superadmin-results td.right {
  text-align: right;
}

.btn-impersonate {
  padding: 8px 12px;
  border-radius: 10px;
}

/* Empty state */
.superadmin-empty {
  margin-top: 10px;
  opacity: 0.8;
}


/* === CRITERIA CARDS === */
#criteria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px 14px;
}
.criteria-item {
  background: #1e1e2b;
  border: 1px solid #2f2f3a;
  border-radius: 8px;
  padding: 10px 12px;
}
.criteria-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e5e7eb;
  cursor: pointer;
  user-select: none;
}
.criteria-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
  cursor: pointer;
}

/* === LIGHT THEME (Unified) === */
body.light-theme {
  color: #111827;

  background:
    radial-gradient(1200px 600px at 15% 10%, rgba(20,184,166,0.18), transparent 60%),
    radial-gradient(1200px 600px at 85% 30%, rgba(124,58,237,0.18), transparent 60%),
    linear-gradient(135deg, #f8fafc, #eef2ff);
}


/* Navbar */
body.light-theme .navbar {
  background-color: #ffffff;
  color: #111827;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
body.light-theme .navbar a {
  color: #1f2937;
}
body.light-theme .navbar a:hover {
  color: #2563eb;
}

/* Dropdown */
body.light-theme .dropdown-content {
  background-color: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
body.light-theme .dropdown-content a {
  color: #111827;
}
body.light-theme .dropdown-content a:hover {
  background-color: #f3f4f6;
}

/* Container / panels */
body.light-theme .container,
body.light-theme .criteria-item,
body.light-theme .visualisation-container,
body.light-theme .chart-card,
body.light-theme .data-panel {
  background-color: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Tiles (light theme bubble version) */
body.light-theme .tile {
  color: #111827;
  background: radial-gradient(900px 320px at 20% 10%, rgba(20,184,166,0.16), transparent 55%),
              radial-gradient(720px 320px at 95% 35%, rgba(124,58,237,0.14), transparent 55%),
              rgba(255,255,255,0.95);
  border: 1px solid rgba(17,24,39,0.10);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
body.light-theme .tile h4 {
  color: #111827;
}
body.light-theme .tile p {
  color: rgba(17,24,39,0.75);
}
body.light-theme .tile:hover,
body.light-theme .tile:focus {
  border-color: rgba(20,184,166,0.35);
  box-shadow: 0 16px 50px rgba(0,0,0,0.12);
}

/* Buttons */
body.light-theme .btn,
body.light-theme button,
body.light-theme .theme-toggle {
  background-color: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
}
body.light-theme button:hover,
body.light-theme .btn:hover {
  background-color: #f3f4f6;
}

/* Scrollbars */
body.light-theme ::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
}
body.light-theme ::-webkit-scrollbar-track {
  background-color: #f3f4f6;
}

/* ===========================================================
   FIXES — Light Theme Visibility for Tables, Dropdown, Icons
   =========================================================== */

/* 1. Tables in light theme */
body.light-theme .table-wrap table,
body.light-theme .table-wrap th,
body.light-theme .table-wrap td {
  background-color: #ffffff !important;
  color: #111827 !important;
  border-color: #e5e7eb !important;
}

body.light-theme .table-wrap th {
  background-color: #f3f4f6 !important;
  font-weight: 600;
}

body.light-theme .table-wrap tr:nth-child(even) td {
  background-color: #f9fafb !important;
}

body.light-theme .table-wrap tr:hover td {
  background-color: #e5e7eb !important;
}

/* 2. Value box input (fix unreadable text / border) */
body.light-theme .value-box .crit-input {
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #d1d5db !important;
}

body.light-theme .value-box .crit-input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25) !important;
}

/* 3. Profile menu icon (hamburger ☰) */
body.light-theme .profile-icon {
  color: #111827 !important;
}

/* 4. Dropdown active/selected link fix */
body.light-theme .dropdown-content a.active {
  background: #e5e7eb !important;
  color: #111827 !important;
}

/* ===========================================================
   THEMED SCROLLBARS — Dark & Light Modes
   =========================================================== */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background-color: #1e1e2f;
}

::-webkit-scrollbar-thumb {
  background-color: #3a3a46;
  border-radius: 6px;
  border: 2px solid #1e1e2f;
  transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #56566b;
}

/* Firefox scrollbar (modern spec) */
* {
  scrollbar-color: #3a3a46 #1e1e2f;
  scrollbar-width: thin;
}

body.light-theme ::-webkit-scrollbar-track {
  background-color: #f3f4f6;
}

body.light-theme ::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
  border: 2px solid #f3f4f6;
}

body.light-theme ::-webkit-scrollbar-thumb:hover {
  background-color: #9ca3af;
}

body.light-theme {
  scrollbar-color: #d1d5db #f3f4f6;
}

/* ===========================================================
   Smooth theme transition
   =========================================================== */

html, body,
.navbar,
.container,
.table-wrap,
.tile,
.dropdown-content,
.panel,
.modal,
.scrollable,
input,
textarea,
button {
  transition:
    background-color 0.4s ease,
    color 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease,
    fill 0.4s ease,
    stroke 0.4s ease;
}

body.theme-switching * {
  transition-duration: 0.25s !important;
}

/* ===========================================================
   NAVBAR TOGGLE ICON — Theme-Aware Styling
   =========================================================== */

.profile-icon {
  font-size: 1.8rem;
  color: #ffffff;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.2s ease;
}

.profile-icon:hover {
  color: #93c5fd;
  transform: scale(1.1);
}

body.light-theme .profile-icon {
  color: #111827;
}

body.light-theme .profile-icon:hover {
  color: #2563eb;
}

/* ===========================================================
   THEME TOGGLE CHIP (Dropdown Button)
   =========================================================== */

.theme-toggle {
  background-color: #2f2f3c;
  color: #f5f5f5;
  border: 1px solid #3e3e4a;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: background-color 0.3s ease, color 0.3s ease,
              border-color 0.3s ease, box-shadow 0.3s ease;
}

.theme-toggle:hover {
  background-color: #3b3b4a;
  box-shadow: 0 3px 10px rgba(0,0,0,0.35);
  transform: translateY(-1px);
}

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

body.light-theme .theme-toggle {
  background-color: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

body.light-theme .theme-toggle:hover {
  background-color: #f3f4f6;
  border-color: #d1d5db;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.theme-toggle span {
  transition: color 0.3s ease;
}

/* ===========================================================
   GLASS-EFFECT NAVBAR & DROPDOWN
   =========================================================== */

.navbar {
  backdrop-filter: blur(8px);
  background-color: rgba(30, 30, 47, 0.85);
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

body.light-theme .navbar {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
}

.dropdown-content {
  backdrop-filter: blur(10px);
  background-color: rgba(45, 45, 60, 0.9);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

body.light-theme .dropdown-content {
  background-color: rgba(255, 255, 255, 0.95);
}

.navbar-right {
  gap: 1rem;
}

.navbar .dropdown {
  margin-left: 0.5rem;
}

.profile-icon {
  cursor: pointer;
  font-size: 1.5rem;
  color: inherit;
}
/* Dashboard welcome panel (matches BubbleFocus bubble style) */
.dashboard-welcome {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.dashboard-welcome p {
  opacity: 0.85;
}

/* Optional: per-tile accent behaviour */
.tile--teal:hover { border-color: rgba(20,184,166,0.50); }
.tile--purple:hover { border-color: rgba(124,58,237,0.50); }
.tile--neutral:hover { border-color: rgba(255,255,255,0.22); }

body.light-theme .dashboard-welcome {
  border-color: rgba(17,24,39,0.10);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
