/* ====================================================================
   BIONUL EDTECH PLATFORM - NOTES & DPP STYLES
   css/notes.css — Mobile-first, matched directly to reference image
   ==================================================================== */

.notes-page-container {
  max-width: 580px;
  margin: 0 auto;
  padding: 8px 14px 90px 14px;
}

/* ====================================================================
   1. TOP BAR NAVIGATION (Mobile Header)
   ==================================================================== */
.notes-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 2px 14px 2px;
}

.notes-header-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-heading, #0F172A);
  letter-spacing: -0.02em;
  margin: 0;
  text-align: center;
  flex: 1;
}

.notes-header-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-heading, #0F172A);
  cursor: pointer;
  transition: background var(--transition-fast, 0.2s);
}

.notes-header-icon-btn:hover {
  background: var(--surface-subtle, #F1F5F9);
}

.notes-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Expandable Search Input */
.notes-search-bar-wrap {
  display: none;
  margin-bottom: 14px;
  animation: slideDown 0.2s ease-out;
}

.notes-search-bar-wrap.show {
  display: block;
}

.notes-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFFFF;
  border: 1.5px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-full, 9999px);
  padding: 8px 16px;
  box-shadow: var(--shadow-sm);
}

.notes-search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.88rem;
  color: var(--text-heading);
  background: transparent;
  font-family: inherit;
}

.notes-search-clear {
  border: none;
  background: transparent;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}

/* ====================================================================
   2. SEGMENTED TOP NAVIGATION TABS (All, Notes, DPP)
   ==================================================================== */
.segmented-tabs-wrapper {
  margin-bottom: 16px;
}

.segmented-tabs-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #F1F5F9;
  border-radius: var(--radius-full, 9999px);
  padding: 4px;
  gap: 4px;
}

.seg-tab-btn {
  padding: 9px 0;
  border: none;
  background: transparent;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted, #64748B);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.seg-tab-btn.active {
  background: var(--primary, #5B3DF5);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(91, 61, 245, 0.28);
}

/* ====================================================================
   3. STUDY RESOURCE HERO PROMO CARD (Reference Image)
   ==================================================================== */
.resource-hero-card {
  background: #F4F2FF;
  border: 1.5px solid #E0DBFD;
  border-radius: var(--radius-xl, 20px);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.hero-doc-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #5B3DF5;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(91, 61, 245, 0.35);
}

.hero-text-col {
  min-width: 0;
}

.resource-hero-headline {
  font-size: 1.02rem;
  font-weight: 800;
  color: #1E1B4B;
  line-height: 1.25;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.resource-hero-subtitle {
  font-size: 0.78rem;
  color: #4338CA;
  line-height: 1.35;
  font-weight: 500;
}

.hero-3d-books {
  width: 78px;
  height: 70px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ====================================================================
   4. SUBJECTS FILTER SECTION
   ==================================================================== */
.notes-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.notes-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-heading, #0F172A);
  letter-spacing: -0.01em;
}

.notes-section-link {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--primary, #5B3DF5);
  text-decoration: none;
  cursor: pointer;
}

.notes-section-link:hover {
  text-decoration: underline;
}

.subject-chips-slider {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 22px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.subject-chips-slider::-webkit-scrollbar {
  display: none;
}

.subject-chip {
  padding: 8px 18px;
  border-radius: var(--radius-full, 9999px);
  background: #FFFFFF;
  border: 1px solid var(--border-color, #E2E8F0);
  color: var(--text-body, #475569);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.subject-chip.active {
  background: #FFFFFF;
  border: 1.5px solid var(--primary, #5B3DF5);
  color: var(--primary, #5B3DF5);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(91, 61, 245, 0.12);
}

.subject-chip:hover:not(.active) {
  background: var(--surface-subtle, #F8FAFC);
  border-color: #CBD5E1;
}

/* ====================================================================
   5. RECENT NOTES & RECENT DPP CARDS (Reference Image)
   ==================================================================== */
.notes-feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.note-item-card {
  background: var(--surface-card, #FFFFFF);
  border: 1px solid var(--border-color, #EAEBF2);
  border-radius: var(--radius-xl, 18px);
  padding: 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast, 0.2s), box-shadow var(--transition-fast, 0.2s);
}

.note-item-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Subject Themed Thumbnail Slate */
.note-thumb-slate {
  width: 86px;
  height: 74px;
  border-radius: var(--radius-md, 12px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.note-thumb-slate svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Thumbnail Subject Gradients */
.note-thumb-slate.maths { background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%); }
.note-thumb-slate.physics { background: linear-gradient(135deg, #0D9488 0%, #0F766E 100%); }
.note-thumb-slate.chemistry { background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%); }
.note-thumb-slate.biology { background: linear-gradient(135deg, #10B981 0%, #059669 100%); }
.note-thumb-slate.english { background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%); }
.note-thumb-slate.computer { background: linear-gradient(135deg, #4F46E5 0%, #4338CA 100%); }

/* Note Card Content */
.note-content-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding-right: 28px; /* space for bookmark icon */
}

.note-subject-tag {
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 2px;
  text-transform: capitalize;
}

.note-subject-tag.maths { color: #7C3AED; }
.note-subject-tag.physics { color: #0D9488; }
.note-subject-tag.chemistry { color: #D97706; }
.note-subject-tag.biology { color: #10B981; }
.note-subject-tag.english { color: #0284C7; }
.note-subject-tag.computer { color: #4F46E5; }

.note-card-title {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text-heading, #0F172A);
  line-height: 1.25;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-card-chapter {
  font-size: 0.76rem;
  color: var(--text-muted, #64748B);
  font-weight: 500;
  margin-bottom: 6px;
}

.note-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.note-meta-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted, #64748B);
  font-weight: 600;
}

.note-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Card Action Buttons */
.btn-note-open {
  background: var(--primary, #5B3DF5);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm, 8px);
  padding: 5px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-note-open:hover {
  background: var(--primary-hover, #4E2FE3);
  transform: translateY(-1px);
}

.btn-dpp-start {
  background: var(--primary, #5B3DF5);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm, 8px);
  padding: 5px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-dpp-start:hover {
  background: var(--primary-hover, #4E2FE3);
  transform: translateY(-1px);
}

.btn-locked-access {
  background: #FFFBEB;
  color: #D97706;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm, 8px);
  padding: 4px 12px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Bookmark Button (Top-Right) */
.btn-card-bookmark {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-light, #94A3B8);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-card-bookmark:hover {
  color: var(--primary, #5B3DF5);
  transform: scale(1.15);
}

.btn-card-bookmark.bookmarked {
  color: var(--primary, #5B3DF5);
}

.btn-card-bookmark.bookmarked svg {
  fill: currentColor;
}

/* ====================================================================
   6. DEDICATED NOTES & DPP SUB-VIEWS (Screens B & C)
   ==================================================================== */
.library-subnav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}

.library-filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.library-filter-chips::-webkit-scrollbar {
  display: none;
}

.lib-filter-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full, 9999px);
  background: #FFFFFF;
  border: 1px solid var(--border-color, #E2E8F0);
  color: var(--text-muted, #64748B);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.lib-filter-pill.active {
  background: var(--primary-light, #F1EEFF);
  color: var(--primary, #5B3DF5);
  border-color: var(--primary-border, #DCD6FE);
  font-weight: 700;
}

.sort-select-pill {
  border: 1px solid var(--border-color, #E2E8F0);
  background: #FFFFFF;
  border-radius: var(--radius-full, 9999px);
  padding: 6px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-heading, #0F172A);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ====================================================================
   7. MODAL SHEETS (Filter, Viewer, DPP)
   ==================================================================== */
.notes-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.notes-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.notes-modal-sheet {
  background: #FFFFFF;
  width: 100%;
  max-width: 540px;
  border-radius: 24px 24px 0 0;
  padding: 20px 20px 28px 20px;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.notes-modal-overlay.open .notes-modal-sheet {
  transform: translateY(0);
}

.notes-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color, #E2E8F0);
  margin-bottom: 16px;
}

.notes-sheet-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-heading, #0F172A);
  margin: 0;
}

/* Filter Body */
.notes-filter-body {
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
  margin-bottom: 18px;
}

.filter-group {
  margin-bottom: 16px;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-heading, #0F172A);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 8px;
}

.filter-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip-btn {
  padding: 6px 14px;
  border-radius: var(--radius-full, 9999px);
  background: var(--surface-subtle, #F1F5F9);
  border: 1px solid transparent;
  color: var(--text-body, #334155);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip-btn.active {
  background: var(--primary, #5B3DF5);
  color: #FFFFFF;
  font-weight: 700;
}

.notes-filter-actions {
  display: flex;
  gap: 10px;
  padding-top: 10px;
}

.notes-filter-actions .btn {
  flex: 1;
}

/* Viewer Modal Specifics */
.notes-modal-sheet.viewer-sheet {
  height: 94vh;
  max-height: 94vh;
  border-radius: 20px 20px 0 0;
  padding: 16px 16px 20px 16px;
}

.notes-viewer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.notes-viewer-title-box {
  flex: 1;
  min-width: 0;
}

.viewer-subject-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.04em;
}

.viewer-note-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.viewer-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-subtle);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-heading);
  cursor: pointer;
}

.notes-viewer-body {
  flex: 1;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.viewer-content-frame {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 16px;
}

/* DPP Modal Specifics */
.dpp-modal-body {
  margin-bottom: 18px;
}

.dpp-badge-banner {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.dpp-modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.25;
  margin-bottom: 4px;
}

.dpp-modal-chapter {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.dpp-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: var(--surface-subtle, #F8FAFC);
  border-radius: var(--radius-md, 12px);
  padding: 12px;
  margin-bottom: 16px;
}

.dpp-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dpp-info-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.dpp-info-val {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-heading);
}

.dpp-instructions-box {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-md, 12px);
  padding: 12px 14px;
}

.dpp-inst-heading {
  font-size: 0.78rem;
  font-weight: 800;
  color: #B45309;
  margin-bottom: 6px;
}

.dpp-inst-list {
  padding-left: 18px;
  margin: 0;
  font-size: 0.74rem;
  color: #92400E;
  line-height: 1.45;
}

/* ====================================================================
   8. SKELETON LOADERS
   ==================================================================== */
.resource-hero-skeleton {
  width: 100%;
  height: 110px;
  border-radius: 20px;
  background: linear-gradient(90deg, #F4F2FF 25%, #EBE7FD 50%, #F4F2FF 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s infinite;
  margin-bottom: 20px;
}

.chips-row-skeleton {
  width: 100%;
  height: 36px;
  border-radius: 9999px;
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s infinite;
  margin-bottom: 22px;
}

.note-card-skeleton {
  width: 100%;
  height: 100px;
  border-radius: 18px;
  background: linear-gradient(90deg, #F8FAFC 25%, #EDE9FE 50%, #F8FAFC 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s infinite;
  margin-bottom: 12px;
}

@keyframes skeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tiny mobile tweaks */
@media (max-width: 360px) {
  .resource-hero-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-doc-badge, .hero-3d-books {
    display: none;
  }
  .note-item-card {
    grid-template-columns: 1fr;
  }
  .note-thumb-slate {
    width: 100%;
    height: 80px;
  }
}
