:root {
  /* Sidebar Light Slate Variables */
  --bg-sidebar: #f1f5f9;
  --border-sidebar: #e2e8f0;
  --text-sidebar: #334155;
  --text-sidebar-hover: #0f172a;
  --bg-btn-hover: #e2e8f0;
  --bg-btn-active: #3b82f6;

  /* Content Sheet Variables */
  --bg-content: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --border-card: #e2e8f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background-color: var(--bg-content);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* LAYOUT STRUCTURE */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* SIDEBAR RE-DESIGN (Light Theme & Sharp Contrast) */
.sidebar {
  width: 280px;
  min-width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-sidebar);
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-sidebar);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  letter-spacing: -0.3px;
}

/* NAVIGATION LINKS */
.nav {
  padding: 16px 12px;
  overflow-y: auto;
  flex-grow: 1;
}

.nav::-webkit-scrollbar {
  width: 5px;
}
.nav::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.nav-btn {
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  margin: 4px 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-sidebar);
  cursor: pointer;
  font-size: 16px;
  font-weight: 1000;
  transition: all 0.15s ease;
}

.nav-btn:hover {
  background-color: #70b7ff;
  color: var(--text-sidebar-hover);
}

.nav-btn.active {
  background-color: #70b7ff;
  color: #000000;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
}

/* Hamburger toggle hidden on Desktop */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.menu-toggle .bar {
  height: 3px;
  width: 100%;
  background-color: var(--text-main);
  border-radius: 10px;
  transition: all 0.25s ease;
}

/* MAIN CONTENT AREA */
.content {
  flex: 1;
  padding: 40px 5%;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  min-width: 0;
}

/* PDF Content Sheet Wrapper */
.note-page-content {
  height: 100%;
  width: 70%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* CONTENT HERO SECTIONS */
.home h1 {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.6px;
  margin-top: 0;
  margin-bottom: 16px;
}

.home h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 40px;
  margin-bottom: 16px;
}

.intro {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.65;
}

.note {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.65;
  background-color: #f1f5f9;
  border-left: 4px solid #cbd5e1;
  padding: 20px 24px;
  border-radius: 4px;
}

/* CARDS AUTO GRID */
.page {
  display: flex;
  justify-content: center;
  padding: 1px;
}

.card-grid {
  width: 100%;
  max-width: 1100px;
}

.card-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: nowrap;
}

.card {
  width: 240px;
  min-height: 95px;
  background: #187ab7;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 14px;
  padding: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.25s ease;
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.25);
}

.card h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #e5e7eb;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.4);
}

/* BRAND BUTTON STYLING */
.brand-btn {
  width: 100%;
  background: rgb(69, 70, 69);
  border: none;
  padding: 12px 0px;
  margin: 0;
  font-family: inherit;
  font-size: 25px;
  font-weight: 700;
  color: rgb(254, 254, 254);
  text-align: center;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.brand-btn:hover {
  background-color: #08d4ee;
  color: black;
}

.brand-btn:active {
  transform: scale(0.99);
}   

.site-footer {
  margin-top: 20px;
  padding: 20px;
  text-align: center;
  font-size: 18px;
  color: rgba(0, 0, 0, 0.55);
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  background: transparent;
}

/* ==========================================================================
   RESPONSIVE DESIGN RULES (Mobile Devices Less Than 768px Width)
   ========================================================================== */
@media (max-width: 768px) {
  /* Stack Layout Viewport Elements Vertically */
  .layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  /* Make Sidebar transform into a sticky Top Header Nav Bar */
  .sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    border-right: none;
    border-bottom: 1px solid var(--border-sidebar);
  }

  .sidebar-header {
    padding: 12px 16px;
  }

  .brand-btn {
    width: auto;
    font-size: 20px;
    padding: 6px 14px;
  }

  /* Show Hamburger toggle trigger on Mobile Viewport */
  .menu-toggle {
    display: flex;
  }

  /* Morph icon to X when opened */
  .menu-toggle.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Collapsible Dropdown Panel Drawer Logic */
  .nav {
    display: none;
    width: 100%;
    max-height: 75vh;
    padding: 8px 16px;
    background-color: var(--bg-sidebar);
    border-top: 1px solid var(--border-sidebar);
  }

  /* Class toggled via JS runtime to show/hide menu */
  .nav.mobile-open {
    display: block;
  }

  /* Adjust Main Content view properties underneath sticky header */
  .content {
    padding: 24px 16px;
    overflow-y: visible;
    height: auto;
  }

  /* Allow Card Rows to drop and wrap cleanly */
  .card-row {
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
  }

  .card {
    width: 100%; /* Cards stretch to take up horizontal full-width on mobile phones */
    min-height: 80px;
    padding: 16px;
  }

  /* Expand iframe document viewer to use full mobile viewport width safely */
  .note-page-content {
    width: 100%;
  }

  .home h1 {
    font-size: 28px;
  }
}