@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* --- Design Variables --- */
:root {
  --primary: #0066C8;
  --primary-rgb: 0, 102, 200;
  --primary-hover: #0050A0;
  --primary-light: #EBF5FF;
  
  --accent: #00D2C4;
  --accent-rgb: 0, 210, 196;
  --accent-hover: #00B3A7;
  --accent-light: #E0FAF8;
  
  --dark-bg: #0F172A;
  --dark-surface: #1E293B;
  --light-bg: #F8FAFC;
  --white: #FFFFFF;
  
  --text-main: #1E293B;
  --text-muted: #64748B;
  --text-white: #FFFFFF;
  
  --border-color: rgba(15, 23, 42, 0.08);
  --border-focus: rgba(0, 102, 200, 0.4);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 12px 24px -6px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 20px rgba(0, 210, 196, 0.25);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* --- Dark Mode Variable Overrides --- */
[data-theme="dark"] {
  --dark-bg: #F8FAFC;            /* Swap text headings to light */
  --dark-surface: #0F172A;       /* Deep slate background */
  --light-bg: #0B0F19;           /* Very dark blue/slate page background */
  --white: #1E293B;              /* Dark slate surface/card background */
  
  --text-main: #F1F5F9;          /* Light gray primary text */
  --text-muted: #94A3B8;         /* Gray muted text */
  --border-color: rgba(255, 255, 255, 0.08); /* Transparent light border */
  
  --primary-light: rgba(0, 102, 200, 0.2);
  --accent-light: rgba(0, 210, 196, 0.2);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 24px -6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, 0.4);
}

/* --- Smooth Theme Transition --- */
body, 
header, 
footer, 
aside, 
main, 
section, 
div, 
h1, h2, h3, h4, h5, h6, 
p, 
span, 
a, 
button, 
input, 
select, 
textarea, 
table, 
th, 
td {
  transition: background-color 250ms ease, color 250ms ease, border-color 250ms ease;
}


/* --- Base Resets --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html {
  scroll-behavior: smooth;
  color: var(--text-main);
  background-color: var(--white);
  overflow-x: hidden;
}

body {
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  padding-top: 52px; /* offset for fixed header */
}

@media (max-width: 768px) {
  body {
    padding-top: 60px !important; /* offset for mobile fixed header */
  }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--light-bg);
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* --- Hide scrollbar on mobile --- */
@media (max-width: 768px) {
  html, body {
    scrollbar-width: none; /* Firefox */
  }
  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
  }
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--dark-bg);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 3.5vw, 2.5rem);
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  color: var(--text-muted);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

/* --- Utilities --- */
.text-accent {
  color: var(--accent);
}

.text-primary {
  color: var(--primary);
}

/* --- Animations --- */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(0, 210, 196, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(0, 210, 196, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 210, 196, 0); }
}

/* --- Theme Toggle Button --- */
.theme-toggle-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border-color);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: background-color 250ms, border-color 250ms, transform 100ms;
  padding: 0;
  box-shadow: var(--shadow-sm);
  user-select: none;
  outline: none;
}

.theme-toggle-btn .theme-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2px;
  fill: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), stroke 250ms;
}

.theme-toggle-btn:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.theme-toggle-btn:hover .theme-icon {
  transform: rotate(25deg) scale(1.1);
}

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

.theme-toggle-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

[data-theme="dark"] .theme-toggle-btn {
  border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .theme-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Specific Dark Mode Element Overrides --- */
[data-theme="dark"] header:not(.auth-mobile-header) {
  background-color: var(--white) !important;
  border-bottom-color: var(--border-color) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] .dashboard-sidebar {
  background-color: #0F172A !important;
  border-right-color: rgba(255, 255, 255, 0.05) !important;
}

/* Also keep sidebar navigation active link text legible in dark mode */
[data-theme="dark"] .dashboard-nav-link.active {
  background: linear-gradient(90deg, rgba(0, 102, 200, 0.25) 0%, rgba(0, 210, 196, 0.1) 100%) !important;
  color: var(--white) !important;
}

}

/* --- Me Dropdown Footer: Dark Mode + Sign Out as menu rows --- */
.me-dropdown-footer {
  display: flex !important;
  flex-direction: column;
  padding: 4px 0 0;
  border-top: 1px solid var(--border-color);
}

/* Dark Mode item — reuses .me-menu-item base, adds toggle pill on right */
.me-menu-item-theme {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-main);
}

/* Toggle pill */
.me-theme-toggle-pill {
  margin-left: auto;
  width: 36px;
  height: 20px;
  border-radius: 99px;
  background: var(--border-color);
  display: flex;
  align-items: center;
  padding: 2px;
  flex-shrink: 0;
  transition: background 280ms;
}
.me-theme-toggle-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  transform: translateX(0);
  transition: transform 280ms cubic-bezier(0.4,0,0.2,1);
}
/* Active state when dark mode on */
html[data-theme="dark"] .me-theme-toggle-pill {
  background: var(--primary) !important;
}
html[data-theme="dark"] .me-theme-toggle-dot {
  transform: translateX(16px);
}

/* Sign Out item — red danger row */
.me-menu-item-signout {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: #EF4444 !important;
  border-radius: 0 0 12px 12px;
}
.me-menu-item-signout .me-menu-icon {
  color: #EF4444 !important;
  background: #FEF2F2 !important;
}
.me-menu-item-signout:hover {
  background: #FEF2F2 !important;
  color: #DC2626 !important;
}
.me-menu-item-signout:hover .me-menu-icon {
  background: #FEE2E2 !important;
  color: #DC2626 !important;
}

.me-menu-theme-toggle {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.me-menu-theme-toggle:hover {
  background: var(--primary-light) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

[data-theme="dark"] .me-menu-theme-toggle {
  border-color: rgba(255,255,255,0.2) !important;
  color: var(--text-main);
}

[data-theme="dark"] .me-menu-theme-toggle:hover {
  background: rgba(255,255,255,0.08) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* --- Me Dropdown Dark Mode Overrides --- */
[data-theme="dark"] .me-dropdown {
  background-color: var(--white) !important; /* #1E293B */
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] .me-dropdown-header {
  background-color: var(--light-bg) !important; /* #0B0F19 */
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .me-dropdown-footer {
  background-color: var(--light-bg) !important; /* #0B0F19 */
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .me-menu-item {
  color: var(--text-muted) !important;
}

[data-theme="dark"] .me-menu-item:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-main) !important;
}

[data-theme="dark"] .me-menu-icon {
  color: var(--text-muted) !important;
}

[data-theme="dark"] .me-menu-item:hover .me-menu-icon {
  color: var(--text-main) !important;
}

[data-theme="dark"] .me-dropdown-signout:hover {
  background-color: rgba(239, 68, 68, 0.1) !important;
}

/* ============================================================
   THEME TOGGLE VISIBILITY
   Hide the theme toggle icon from the desktop header nav,
   the login page, and the dashboard topbar.
   The ONLY remaining toggle is the me-menu-theme-toggle inside
   the Me dropdown / hamburger menu (injected by auth.js).
   ============================================================ */

/* 1. Desktop nav <li> wrapper — hidden on all pages, all sizes */
.theme-toggle-item {
  display: none !important;
}

/* 2. Login page standalone toggle container */
.theme-toggle-container {
  display: none !important;
}

/* 3. Dashboard topbar theme button */
button.theme-toggle-btn.dash-topbar-icon-btn {
  display: none !important;
}



/* ============================================================
   VERIFIED BADGE — UNIVERSAL COLOR FIX
   The badge SVG uses fill="currentColor", so it inherits the
   text color of any ancestor (e.g. .post-author-name, anchor
   tags, etc.). These rules use !important to guarantee the
   correct colour regardless of where a badge is rendered:
   posts, comments, networking cards, sidebar, messaging, etc.
   ============================================================ */

svg.verified-badge {
  color: #1D9BF0 !important;  /* Twitter/X verified blue — default */
}

svg.verified-badge.gold {
  color: #EAB308 !important;  /* Amber-500 — Gold Partner tick */
}

/* Preserve proper drop-shadow glow colours on hover */
svg.verified-badge:hover {
  filter: drop-shadow(0 0 5px rgba(29, 155, 240, 0.65)) !important;
}
svg.verified-badge.gold:hover {
  filter: drop-shadow(0 0 5px rgba(234, 179, 8, 0.8)) !important;
}


/* ============================================================
   COLLEGE ADMIN PORTAL — PREMIUM THEME OVERRIDES
   Scoped to body.college-admin-body so it never bleeds into
   the school portal. Inherits all structural layout from
   body.school-admin-body (sidebar, topbar, grid, mobile).
   ============================================================ */

body.college-admin-body {
  /* --- College Brand Colors: Indigo + Emerald --- */
  --primary:         #4F46E5;  /* Indigo 600 */
  --primary-rgb:     79, 70, 229;
  --primary-hover:   #4338CA;  /* Indigo 700 */
  --primary-light:   #EEF2FF;  /* Indigo 50 */

  --accent:          #10B981;  /* Emerald 500 */
  --accent-rgb:      16, 185, 129;
  --accent-hover:    #059669;  /* Emerald 600 */
  --accent-light:    #D1FAE5;  /* Emerald 50 */

  --border-focus:    rgba(79, 70, 229, 0.4);

  --shadow-glow:     0 0 20px rgba(79, 70, 229, 0.22);
}

/* --- College Active Sidebar Link --- */
body.college-admin-body .dashboard-nav-link.active,
body.college-admin-body .admin-sidebar-link.active {
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.18) 0%, rgba(16, 185, 129, 0.08) 100%) !important;
  color: var(--primary) !important;
  border-left-color: var(--primary) !important;
}

/* --- College Logo Brand Text --- */
body.college-admin-body .dashboard-sidebar .logo-brand-wrapper .logo,
body.college-admin-body .mobile-school-name,
body.college-admin-body .mobile-header-brand {
  color: var(--primary) !important;
}

/* --- College Primary Buttons --- */
body.college-admin-body .btn-primary,
body.college-admin-body button[class*="btn-primary"] {
  background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%) !important;
  border-color: #4338CA !important;
}
body.college-admin-body .btn-primary:hover {
  background: linear-gradient(135deg, #4338CA 0%, #4F46E5 100%) !important;
}

/* --- College Accent / Badge Highlights --- */
body.college-admin-body .badge-accent,
body.college-admin-body .stat-icon,
body.college-admin-body .overview-card-icon {
  color: var(--accent) !important;
}

/* --- College Tab Active Underline --- */
body.college-admin-body .tab-btn.active,
body.college-admin-body .subtab-btn.active,
body.college-admin-body .classroom-subtab-btn.active {
  color: var(--primary) !important;
  border-bottom-color: var(--primary) !important;
}

/* --- College Theme Toggle Hover --- */
body.college-admin-body .me-menu-theme-toggle:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

/* ── Dark Mode College Overrides ── */
[data-theme="dark"] body.college-admin-body,
body.college-admin-body[data-theme-scope="dark"] {
  --primary-light: rgba(79, 70, 229, 0.2);
  --accent-light:  rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] body.college-admin-body .dashboard-nav-link.active,
[data-theme="dark"] body.college-admin-body .admin-sidebar-link.active {
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.28) 0%, rgba(16, 185, 129, 0.12) 100%) !important;
  color: #818CF8 !important; /* Indigo 400 – legible on dark bg */
}

[data-theme="dark"] body.college-admin-body .me-menu-theme-toggle:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}



/* ============================================================
   PREMIUM SHARE MODAL STYLES
   ============================================================ */

.share-modal-card {
  overflow: visible !important; /* Prevent scrollbar cutting off text */
}

.share-options-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.share-btn-item {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 72px;
  transition: transform 0.2s ease;
  outline: none;
}

.share-btn-item:hover {
  transform: translateY(-3px);
}

.share-btn-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.share-btn-svg {
  width: 24px;
  height: 24px;
  transition: transform 0.25s ease;
}

/* WhatsApp Styling */
.whatsapp-glow {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff;
}
.share-btn-item:hover .whatsapp-glow {
  box-shadow: 0 0 16px rgba(37, 211, 102, 0.45);
}

/* Telegram Styling */
.telegram-glow {
  background: linear-gradient(135deg, #0088cc 0%, #0077b5 100%);
  color: #ffffff;
}
.share-btn-item:hover .telegram-glow {
  box-shadow: 0 0 16px rgba(0, 136, 204, 0.45);
}

/* Email Styling */
.email-glow {
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
  color: #ffffff;
}
.share-btn-item:hover .email-glow {
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.45);
}

/* Copy Link Styling */
.copy-glow {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  color: #ffffff;
}
.share-btn-item:hover .copy-glow {
  box-shadow: 0 0 16px rgba(71, 85, 105, 0.45);
}

.share-btn-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

/* ============================================================
   SETTINGS PANEL — Bottom Sheet (mobile) / Modal (desktop)
   ============================================================ */

/* Overlay */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms cubic-bezier(0.4, 0, 0.2, 1);
}
.settings-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Panel */
.settings-panel {
  position: fixed;
  z-index: 9999;
  background: var(--white);
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1), opacity 280ms ease;
}

/* Mobile: slide up from bottom */
@media (max-width: 768px) {
  .settings-panel {
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 20px 20px 0 0;
    max-height: 88vh;
    overflow-y: auto;
    transform: translateY(100%);
    opacity: 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
  }
  .settings-panel.active {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Desktop: centered modal */
@media (min-width: 769px) {
  .settings-panel {
    top: 50%;
    left: 50%;
    width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 16px;
    transform: translate(-50%, -52%) scale(0.96);
    opacity: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.08);
  }
  .settings-panel.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* Settings Panel Header */
.settings-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

/* Mobile drag handle */
.settings-panel-handle {
  width: 40px;
  height: 4px;
  background: var(--border-color);
  border-radius: 99px;
  margin: 10px auto 0;
}
@media (min-width: 769px) {
  .settings-panel-handle { display: none; }
}

.settings-panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark-bg);
}

.settings-panel-close {
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 180ms, color 180ms;
  padding: 0;
}
.settings-panel-close:hover {
  background: var(--light-bg);
  color: var(--dark-bg);
}

/* Settings Sections */
.settings-section {
  padding: 12px 20px 4px;
}
.settings-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* Settings Row Item */
.settings-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  text-align: left;
  transition: color 150ms;
}
.settings-row:last-child { border-bottom: none; }
.settings-row:hover { color: var(--primary); }
.settings-row:hover .settings-row-icon { color: var(--primary); background: var(--primary-light); }

.settings-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--light-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: background 150ms, color 150ms;
}
.settings-row-icon svg { width: 17px; height: 17px; }

.settings-row-text { flex: 1; line-height: 1.3; }
.settings-row-chevron { color: var(--text-muted); opacity: 0.4; flex-shrink: 0; }
.settings-row-chevron svg { width: 16px; height: 16px; }

/* Danger row */
.settings-row.danger { color: #EF4444; }
.settings-row.danger .settings-row-icon { background: #FEF2F2; color: #EF4444; }
.settings-row.danger:hover { color: #DC2626; }
.settings-row.danger:hover .settings-row-icon { background: #FEE2E2; color: #DC2626; }

/* Dark mode */
[data-theme="dark"] .settings-panel {
  background: var(--white);
  border: 1px solid rgba(255,255,255,0.07);
}
[data-theme="dark"] .settings-panel-header {
  background: var(--white);
  border-bottom-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .settings-row-icon { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5); }
[data-theme="dark"] .settings-row { border-color: rgba(255,255,255,0.06); color: var(--text-main); }
[data-theme="dark"] .settings-section-label { color: rgba(255,255,255,0.35); }

/* Panel bottom */
.settings-panel-bottom {
  padding: 16px 20px 28px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ============================================================
   HIDE FOOTER ON MOBILE (links moved to Settings panel)
   ============================================================ */
@media (max-width: 768px) {
  footer { display: none !important; }
}
