/* ---------------------------------------------------------------------------
   Notes - copied verbatim from the profile site (diptidhawade/src/styles/notes.css).
   The variables below come from that project's global.css :root (dark theme);
   they are inlined here because this project has no global stylesheet to
   inherit them from, and recoloured to the app's neutral greys.
   Everything after this block is unmodified.
   --------------------------------------------------------------------------- */
:root {
  --page-padding-x: 1.25rem;
  --page-padding-x-sm: 2rem;
  --page-max-width: 80rem;
  /* Neutral greys taken from css/style.css so Notes sits on the same
     background as the rest of the app - the originals were warm-tinted. */
  --color-bg: #0c0c0c;
  --color-bg-elevated: #141414;
  --color-bg-card: #1a1a1a;
  --color-border: #1e1e1e;
  --color-border-muted: #333;
  --color-text: #f0f0f0;
  --color-text-muted: #bbb;
  --color-text-dim: #666;
  --color-accent: #fff;
}

.page-content {
  max-width: var(--page-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--page-padding-x);
  padding-right: var(--page-padding-x);
}
@media (min-width: 640px) {
  .page-content { padding-left: var(--page-padding-x-sm); padding-right: var(--page-padding-x-sm); }
}

/* Notes section */
.notes-page {
  padding-top: 6rem;
  padding-bottom: 4rem;
  min-height: 60vh;
  color: var(--color-text);
  background: var(--color-bg);
}

.notes-page.page-content {
  max-width: var(--page-max-width);
  padding-left: var(--page-padding-x);
  padding-right: var(--page-padding-x);
}

@media (min-width: 640px) {
  .notes-page.page-content {
    padding-left: var(--page-padding-x-sm);
    padding-right: var(--page-padding-x-sm);
  }
}

.notes-page.notes-section-page.page-content {
  max-width: 100%;
  padding: 0;
  padding-top: 5.25rem;
  padding-bottom: 0;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Explorer-style folder tree (notes sidebar) */
.notes-section-sidebar-tree {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.notes-tree-root {
  list-style: none;
  padding: 0;
  margin: 0;
}

.notes-tree-folder {
  margin: 0;
  list-style: none;
}

.notes-tree-folder-row {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  min-height: 1.5rem;
}

.notes-tree-chevron {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.5rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}

.notes-tree-chevron:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.06);
}

.notes-tree-chevron-icon {
  width: 0.95rem;
  height: 0.95rem;
}

.notes-tree-folder-label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  padding: 0.2rem 0.35rem 0.2rem 0;
  margin: 0;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.12s, background 0.12s;
}

.notes-tree-folder-label:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.04);
}

.notes-tree-folder-label-active {
  color: var(--color-accent);
}

.notes-tree-files {
  list-style: none;
  padding: 0 0 0.35rem 0;
  margin: 0 0 0.15rem 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  margin-left: 0.5rem;
  padding-left: 0.5rem;
}

.notes-tree-file {
  margin: 0;
  list-style: none;
}

.notes-tree-file-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.2rem 0.35rem;
  margin: 0;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.8125rem;
  font-family: inherit;
  font-weight: 400;
  transition: color 0.12s, background 0.12s;
}

.notes-tree-file-btn:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.05);
}

.notes-tree-file-btn-active {
  color: var(--color-accent) !important;
}

.notes-page a,
.notes-page a:hover,
.notes-page a:focus,
.notes-page button:hover,
.notes-page button:focus {
  text-decoration: none !important;
}

.notes-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.notes-subheading,
.notes-folder-intro {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.notes-subheading {
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}

.notes-back-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  padding: 0.4rem 0;
  font-size: 0.875rem;
  cursor: pointer;
  margin-bottom: 1.5rem;
  transition: color 0.15s;
}

.notes-back-btn:hover {
  color: var(--color-text);
}

/* Category list (Plaksha, Software Dev) — square boxes with image */
.notes-category-list {
  list-style: none;
  padding-top: 2rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.notes-category-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .notes-category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .notes-category-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 78rem;
  }
}

.notes-category-item {
  margin: 0;
}

.notes-category-card {
  display: block;
  color: var(--color-text) !important;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.notes-category-card:hover {
  transform: translateY(-2px);
  text-decoration: none !important;
}

.notes-category-box {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  min-height: 340px;
  padding: 1.6rem;
  background: linear-gradient(180deg, var(--color-bg-elevated) 0%, var(--color-bg-card) 100%);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

@media (min-width: 640px) {
  .notes-category-box {
    aspect-ratio: auto;
    min-height: 0;
  }
}

body.theme-light .notes-category-box {
  background: linear-gradient(180deg, var(--color-bg-elevated) 0%, var(--color-bg-card) 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.notes-category-box:hover {
  border-color: var(--color-border-muted);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

body.theme-light .notes-category-box:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.notes-category-number {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 50%;
}

.notes-category-box {
  position: relative;
  padding-top: 2rem;
}

.notes-category-image-wrap {
  flex-shrink: 0;
  width: 100%;
  height: 180px;
  margin-top: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}

.notes-category-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

body.theme-light .notes-category-image {
  opacity: 0.85;
}

.notes-category-title {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notes-category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: auto;
  overflow: hidden;
  max-height: 3.2rem;
}

.notes-category-tag {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.notes-category-tag-more {
  color: var(--color-text-dim);
}

/* Subject list — two columns side by side, no box behind names */
.notes-subject-list {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 2rem;
  max-width: 100%;
}

@media (max-width: 639px) {
  .notes-subject-list {
    grid-template-columns: 1fr;
    margin-top: 1.5rem;
  }
}

.notes-subject-list li {
  margin: 0;
}

.notes-subject-card {
  display: block;
  padding: 0.5rem 0;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--color-text) !important;
  text-decoration: none;
  font-size: 1.2rem;
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.15s, opacity 0.15s;
}

.notes-subject-card:hover {
  background: transparent;
  border: none;
  color: var(--color-accent) !important;
  opacity: 0.9;
  text-decoration: none !important;
}

/* Folders (Class Notes, Tutorials/Assignments, Exam Practice, Past Papers) */
.notes-folders {
  display: grid;
  gap: 0.25rem;
  margin-top: 1rem;
}

.notes-folder-section {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0.5rem 0;
}

.notes-folder-title {
  font-size: 1.2rem;
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-text);
  margin: 0;
}

.notes-folder-title-link {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.15s, opacity 0.15s;
}

.notes-folder-title-link:hover {
  color: var(--color-accent);
  opacity: 0.9;
  text-decoration: none !important;
}

.notes-section-page-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0.5rem 0 0.25rem 0;
}

.notes-section-layout-wrap {
  display: flex;
  flex-direction: row;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.notes-section-left-col {
  display: flex;
  flex-direction: column;
  padding: 0.0rem 0.75rem 0.75rem 0.75rem;
  flex-shrink: 0;
}

.notes-section-left-col .notes-toggle-list-btn {
  margin-bottom: 0.25rem;
}

.notes-toggle-list-btn {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s;
}

.notes-toggle-list-btn:hover {
  color: var(--color-text);
}

.notes-toggle-list-btn-active {
  color: var(--color-text);
}

.notes-toggle-list-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  vertical-align: middle;
}

.notes-empty {
  color: var(--color-text-dim);
  font-size: 0.875rem;
  margin: 0;
}

.notes-pdf-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.notes-section-sidebar {
  flex: 1 1 auto;
  overflow-y: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0.25rem 0;
}

@media (max-width: 900px) {
  .notes-section-left-col {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .notes-section-layout-wrap {
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }

  .notes-section-left-col {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    flex-shrink: 0;
    overflow: visible;
  }

  .notes-section-left-col .notes-toggle-list-btn {
    margin-bottom: 0;
  }

  .notes-section-page-heading {
    margin: 0;
    font-size: 0.9rem;
  }

  .notes-section-sidebar {
    width: 100%;
    max-height: 30vh;
    overflow-y: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
  }

  .notes-section-viewer {
    flex: 1;
    min-height: 60vh;
    height: auto;
  }
}

.notes-pdf-list-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.notes-pdf-list li {
  margin: 0;
}

.notes-pdf-link {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.5rem 0;
  color: var(--color-text) !important;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.notes-pdf-link-button {
  width: 100%;
  text-align: left;
}

.notes-pdf-link-active {
  color: var(--color-accent) !important;
}

.notes-section-viewer {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: visible;
}

/* React PDF Viewer tweaks */
.notes-section-viewer .rpv-core__viewer {
  width: 100%;
}

.notes-section-viewer .rpv-core__page-layer::after {
  display: none !important;
}

.notes-section-viewer .rpv-core__inner-page {
  padding-bottom: 24px;
}

.notes-section-viewer .rpv-core__viewer--dark {
  --rpv-core__page-layer-box-shadow: none;
}

/* Hide the built-in sidebar tab strip (we use our own thumbnail button in the toolbar) */
.notes-section-viewer .rpv-default-layout__sidebar-headers {
  display: none !important;
}

/* Keep tooltips visible */
.notes-section-viewer .rpv-core__tooltip-body {
  white-space: nowrap;
  z-index: 9999;
}

.notes-section-viewer .rpv-default-layout__toolbar,
.notes-section-viewer .rpv-default-layout__toolbar-slot {
  overflow: visible !important;
}

/* Hide Download, Print, Theme, and Search buttons from toolbar and popover menu */
.notes-section-viewer [data-testid="get-file__download-button"],
.notes-section-viewer [data-testid="print__button"],
.notes-section-viewer [data-testid="search__popover-button"],
.notes-section-viewer [aria-label="Download"],
.notes-section-viewer [aria-label="Print"],
.notes-section-viewer [aria-label="Search"],
.notes-section-viewer [aria-label*="witch theme"],
.notes-section-viewer [aria-label*="witch to"],
[data-testid="get-file__download-menu"],
[data-testid="print__menu"],
[data-testid="open__menu"] {
  display: none !important;
}

.notes-pdf-link:hover {
  color: var(--color-accent) !important;
  text-decoration: none !important;
}

/* Nav active state for Notes */
.nav-li_a-active {
  font-weight: 600;
  color: var(--color-accent);
}
