/* ========================================== */
/* FULLSCREEN ENFORCER STYLES                 */
/* ========================================== */

#fullscreen-enforcer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.98);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  font-family: sans-serif;
}

.enforcer-box {
  background: #1e293b;
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.8);
  max-width: 400px;
  width: 90%;
}

.enforcer-box h2 { 
  margin-top: 0; 
  color: #f8fafc;
}

.enforcer-box p {
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 25px;
}

.enforcer-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  margin: 8px;
  font-weight: bold;
  transition: background 0.3s;
  width: 100%;
  max-width: 200px;
}

.enforcer-btn:hover { 
  background: #2563eb; 
}

/* --- CORE CSS VARIABLES (Identical to index.html for consistency) --- */
:root {
  --primary: #98BACE;
  --primary-dark: #799EBA;
  --bg-main: #f4f6f9;
  --bg-card: #ffffff;
  --bg-light: #e5eef9;
  --text-main: #334155;
  --text-light: #64748b;
  --text-heading: #111827;
  --border-color: #1e293b80;
  --badge-bg: #e0f2fe;
  --sidebar-width: 260px;
  --nav-height: 64px;

  /* Permanent Dark Theme Variables (Navbar) */
  --nav-bg: #1e293b;
  --nav-border: #334155;
  --nav-text: #f8fafc;
   --nav-text-muted: #c3cbd7;
  --nav-input-bg: rgba(255, 255, 255, 0.08);

  /* Section Colors */
  --jss1-bg: #d5e0ee;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --primary: #98BACE;
  --primary-dark: #b5d0df;
  --bg-main: #0b1120;
  --bg-card: #1e293b;
  --bg-light: #1e293b;
  --text-main: #e2e8f0;
  --text-light: #94a3b8;
  --text-heading: #f8fafc;
  --border-color: #334155;
  --badge-bg: #0ea5e9;
}
@font-face {
  font-family: Poppins;
  src:url(/Poppins/Poppins-Regular.ttf);
}

html, body {
  overscroll-behavior: none;
}

/* --- RESET & BASE --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Poppins, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: 1px;
  -webkit-tap-highlight-color: transparent;
}  
body {
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
  /* Prevent text selection */
  -webkit-user-select: none;
  /* Safari */
  -moz-user-select: none;
  /* Firefox */
  -ms-user-select: none;
  /* IE10+/Edge */
  user-select: none;
  /* Standard */
}
input, textarea, select {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}
body.no-scroll {
  overflow: hidden;
}
html:has(body.no-scroll){
  overflow: hidden;
}
a {
  text-decoration: none;
  color: inherit;
}
button, select {
  cursor: pointer;
  border: none;
  font-family: inherit;
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-light);
  }
  ::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
  }

  /* --- NAVBAR --- */
.navbar {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  position: fixed;
  width: 100%;
  top: 0;
  height: var(--nav-height);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 15px;
}
.menu-btn {
  font-size: 28px;
  background: none;
  color: var(--nav-text);
  display: block;
}
.brand {
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 900;
  color: var(--nav-text);
  letter-spacing: -0.5px;
}
.brand img {
  height: 32px;
  width: 32px;
  object-fit: contain;
}
.nav-links {
  display: none;
  gap: 5px;
  font-weight: 600;
}
.nav-links a {
  padding: 8px 16px;
  border-radius: 4px;
  transition: 0.2s;
  color: var(--nav-text-muted);
  }
  .nav-links a:hover {
  background: rgba(255,255,255,0.1);
  color: var(--nav-text);
  }

  .nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.full-logo {
  display: flex;
  justify-content: left;
  align-items: center;
  width: 150px;
  gap: 0;
  overflow: hidden;
}
.full-logo img {
  width: 150px!important;
  object-fit: unset;
}

@media screen and (max-width: 763px) {
  .flex-mobile {
    display: flex;
  }
  .block-mobile {
    display: block;
  }
  .none-mobile {
    display: none;
  }
}


.search-input {
  background: var(--nav-input-bg);
  color: var(--nav-text);
  border: 1px solid var(--nav-border);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  outline: none;
  transition: 0.3s;
}
.search-input {
  display: none;
}

.search-input::placeholder {
  color: #dcdcdc;
} 
.search-input:focus {
  width: 200px;
}
.login-btn {
  background: var(--primary);
  color: var(--nav-text);
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: bold;
  transition: 0.2s;
  margin-left: 5px;
}
.custom-theme-dropdown {
  position: relative;
  display: inline-block;
}

.theme-btn {
  background: var(--nav-input-bg);
  color: var(--nav-text);
  border: 1px solid var(--nav-border);
  width: 36px;
  height: 36px;
  border-radius: 50%; /* Sleek circular button */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: 0.3s;
}

.theme-btn:hover, .theme-btn:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.15);
}

.theme-menu {
  position: absolute;
  top: 130%;
  right: 0;
  background: var(--nav-bg);
  border: 1px solid var(--nav-border);
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.4);
  display: none; /* Hidden by default */
  flex-direction: column;
  overflow: hidden;
  min-width: 130px;
  z-index: 100;
}

.theme-menu.show {
  display: flex; /* Shown when toggled */
}

.theme-option {
  background: transparent;
  color: var(--nav-text);
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  border: none;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.theme-option.active {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
}

.login-btn:hover {
  background: var(--primary-dark);
  }

  /* --- LAYOUT WRAPPER & SIDEBAR --- */
.app-container {
  display: flex;
  margin-top: 0:
  min-height: calc(100vh - var(--nav-height));
  }

/* --- SIDEBAR --- */
.sidebar {
  background: var(--bg-light);
  width: var(--sidebar-width);
  position: fixed;
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  border-right: 1px solid var(--border-color);
  transform: translateX(-100%);
  transition: transform 0.3s ease, background-color 0.3s, border-color 0.3s;
  z-index: 40;
  padding: 20px;
}

.sidebar.open {
  transform: translateX(0);
  box-shadow: 2px 0 10px rgba(0,0,0,0.2);
}

/* Sidebar Navigation Core */
.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-nav > li {
  margin-bottom: 5px;
}
.sidebar-nav > li > a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  transition: 0.2s;
  color: var(--text-main);
}

.sidebar-nav > li > a.active {
  background: var(--primary);
  color: white;
}

.sidebar-nav > li > a:hover {
   backdrop-filter: blur(5px);
  background-color: #dcdcdc55;
}

/* Sidebar Dropdown Logic */
.submenu-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.submenu-toggle:hover {
  backdrop-filter: blur(5px);
  background-color: #dcdcdc55;
}

.chevron {
  width: 18px;
  height: 18px;
  display: inline-block;
  
  /* 1. Set the background to the current text color */
  background-color: currentColor;
  
  /* 2. Use the SVG to "mask" or cut out the shape from the background */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath d='M297.4 470.6C309.9 483.1 330.2 483.1 342.7 470.6L534.7 278.6C547.2 266.1 547.2 245.8 534.7 233.3C522.2 220.8 501.9 220.8 489.4 233.3L320 402.7L150.6 233.4C138.1 220.9 117.8 220.9 105.3 233.4C92.8 245.9 92.8 266.2 105.3 278.7L297.3 470.7z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath d='M297.4 470.6C309.9 483.1 330.2 483.1 342.7 470.6L534.7 278.6C547.2 266.1 547.2 245.8 534.7 233.3C522.2 220.8 501.9 220.8 489.4 233.3L320 402.7L150.6 233.4C138.1 220.9 117.8 220.9 105.3 233.4C92.8 245.9 92.8 266.2 105.3 278.7L297.3 470.7z'/%3E%3C/svg%3E");
  
  /* 3. Apply the sizing and positioning rules to the mask */
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  font-size: 10px;
  transition: transform 0.3s ease;
  margin-top: -5px;
}
.submenu-toggle.active .chevron {
  transform: rotate(180deg);
}

/* Submenu Hidden by Default */
.sidebar-submenu {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding-left: 20px; /* Indent the sub-items */
}
.sidebar-submenu li {
  margin: 2px 0;
}
.sidebar-submenu li a {
  display: block;
  padding: 8px 15px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-light);
  border-radius: 6px;
  transition: 0.2s;
}
.sidebar-submenu li a:hover {
  background: rgba(152, 186, 206, 0.1);
}
.sidebar-submenu li a.view-all-link {
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 13px;
  margin-top: 5px;
  margin-bottom: 10px;
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 30;
  display: none;
}
.overlay.show {
  display: block;
}
.main-content {
  flex: 1;
  width: 100%;
  padding-bottom: 60px;
}

/* --- JSS 1 SPECIFIC LAYOUT --- */

/* Page Header (Theme Adaptive) */
.page-header {
  background-color: var(--bg-main);
  padding: 30px 20px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s;
}
.breadcrumb {
  margin-bottom: 10px;
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--text-light);
}
.breadcrumb a:hover {
  text-decoration: underline;
  color: var(--primary);
}

.page-header h1 {
  color: var(--text-heading);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.3s;
}
.page-header p {
  color: var(--text-light);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 20px;
  transition: color 0.3s;
}

/* Always-Visible Search Bar */
.mobile-search-container {
  display: flex;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: background-color 0.3s, border-color 0.3s;
}
.mobile-search-container input {
  flex: 1;
  padding: 14px 20px;
  border: none;
  outline: none;
  font-size: 16px;
  background: transparent;
  color: var(--text-main);
}
.mobile-search-container button {
  background: var(--primary);
  color: white;
  padding: 0 24px;
  font-weight: bold;
  font-size: 16px;
  transition: 0.2s;
}
.mobile-search-container button:hover {
  background: var(--primary-dark);
}

  /* Subjects Grid Container */
.dashboard-container {
  padding: 40px 20px;
  padding-top: 10px;
  max-width: 1200px;
  margin: 0 auto;
}

.subjects-grid {
  display: grid;
  /* Auto-fit creates as many columns as will fit. Min size 280px ensures it drops to 1 column on mobile */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* Tappable Subject Cards (Matching Topics Layout) */
.subject-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--primary); /* The signature thick border */
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.subject-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.05);
}

.subject-card:active {
  transform: scale(0.98);
}

/* The new square badge that replaces the round arrow icon */
.subject-badge {
  background: var(--badge-bg);
  color: var(--primary-dark);
  font-size: 18px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-content h3 {
  color: var(--text-heading);
  font-size: 1.1rem;
  margin-bottom: 4px;
  line-height: 1.2;
}

.card-content p {
  color: var(--text-light);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* --- RESPONSIVE DESKTOP QUERIES --- */
  @media (min-width: 768px) {
  .menu-btn {
    display: none;
  }
  .nav-links {
    display: flex;
  }
  .search-input {
    display: block;
  }
  .sidebar {
    transform: translateX(0);
  z-index: 10;
  }

  .page-header {
    padding: 60px 40px;
    text-align: left;
  }
}
/* --- MOBILE SIDEBAR SCROLLBAR TWEAK --- */
@media (max-width: 767px) {
  .sidebar {
    /* Hides scrollbar for Firefox */
    scrollbar-width: none; 
    /* Optional: To make it very thin instead of hiding, remove 'scrollbar-width: none' and uncomment below */
    /* scrollbar-width: thin; */
  }
  
  /* Hides scrollbar for Chrome, Safari, and Edge */
  .sidebar::-webkit-scrollbar { 
    display: none; 
    /* Optional: To make it very thin instead of hiding, use this instead of display: none; */
    /* width: 2px; */
  }
}


/* ========================================== */
/* NUKE ALL SCROLLBARS ON MOBILE              */
/* ========================================== */
@media (max-width: 768px) {
  /* 1. Kill native Webkit/Firefox scrollbars */
  ::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
  * {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
  }

  /* 2. Kill the custom cursor.js DOM scrollbar */
  #pormaro-dom-track,
  #pormaro-dom-thumb {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}
/* ========================================== */
/* GLOBAL NAVBAR QUICK SEARCH                 */
/* ========================================== */
.nav-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

/* Force the input to always show when the wrapper is visible */
.nav-search-wrapper .search-input {
  display: block !important; 
  width: 200px;
}

.nav-suggestions-box {
  position: absolute;
  top: 130%; /* Drops down just below the navbar */
  right: 0;
  width: 320px; /* Wider than the input for better reading */
  background: var(--nav-bg); /* Matches the dark navbar */
  border: 1px solid var(--nav-border);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
}

.nav-suggestions-box.show {
  display: flex;
}

.nav-suggestions-box .suggestion-item {
  padding: 12px 15px;
  cursor: pointer;
  border-bottom: 1px solid var(--nav-border);
  transition: 0.2s;
  color: var(--nav-text);
}

.nav-suggestions-box .suggestion-item:last-child {
  border-bottom: none;
}

.nav-suggestions-box .suggestion-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-suggestions-box .sugg-title {
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.nav-suggestions-box .sugg-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  color: var(--nav-text-muted);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
