/* =========================================================
   GLOBAL RESET & SAFE-AREA HANDLING
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}


/* Safe-area variables (mobile notch, WebView, iOS) */
:root {
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

/* =========================================================
   BASE BODY
   ========================================================= */

body {
  background: #f6f7f9;
  color: #1f2937;
  padding-top: var(--safe-top);
  padding-bottom: calc(var(--safe-bottom) + 64px); /* space for bottom nav */
}
/* Lock body scroll only on dashboard */
body:has(.dashboard-wrapper) {
  overflow: hidden;
}

/* Disable bottom padding on desktop */
@media (min-width: 992px) {
  body {
    padding-bottom: 0;
  }
}

/* =========================================================
   NAVBAR (TOP)
   ========================================================= */

.navbar {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.navbar-brand {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: 0.04px;
  color: #000 !important;
}

/* Icon buttons (top nav) */
.nav-icon {
  font-size: 1.2rem;
  color: #374151;
  padding: 6px 10px;
  background: none;
  border: none;
}

.nav-icon:hover {
  color: #2563eb;
}

/* =========================================================
   SEARCH
   ========================================================= */

.global-search input {
  border-radius: 10px;
}

/* =========================================================
   BOTTOM NAV (MOBILE)
   ========================================================= */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;

  height: 56px;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;

  display: flex;
  justify-content: space-around;
  align-items: center;

  z-index: 9999;
}


.bottom-nav a,
.bottom-nav button {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 1.3rem;
  color: #374151;
  background: none;
  border: none;
}

.bottom-nav a:hover,
.bottom-nav button:hover {
  color: #2563eb;
}

/* =========================================================
   VISIBILITY HELPERS
   ========================================================= */

@media (max-width: 991px) {
  .desktop-only {
    display: none !important;
  }
}

@media (min-width: 992px) {
  .mobile-only {
    display: none !important;
  }
}

/* =========================================================
   CARDS & NOTES
   ========================================================= */

.card {
  border-radius: 10px;
}

/* Note card hover */
.note-card {
  border-radius: 12px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.note-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);

}

/* ===============================
   BOOK-LIKE LANDSCAPE NOTE CARDS
=============================== */

.note-card {
  aspect-ratio: 4 / 3;        /* 📖 landscape book feel */
  max-height: 220px;          /* keeps cards compact */
  display: flex;
  flex-direction: column;
}

/* Body fills space but clips content */
.note-card .card-body {
  flex: 1;
  overflow: hidden;
  padding-bottom: 0.5rem;
}


/* Title tighter */
.note-card .card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* Description clamp */
.note-card .card-text {
  font-size: 0.8rem;
  line-height: 1.4;
  overflow: hidden;

  display: -webkit-box;
  -webkit-line-clamp: 3;     /* 🔑 keeps height small */
  -webkit-box-orient: vertical;
}


/* =========================================================
   NOTE CONTENT & PREVIEW
   ========================================================= */

.note-title {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.3px;
  color: #111;
}

.note-title:hover {
  text-decoration: underline;
}

.note-preview {
  max-height: 240px;
  overflow: hidden;
  position: relative;
}

/* Fade-out effect */
.note-preview::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 60px;
  color: black;
}

/* Images inside notes */
.note-preview img,
.note-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px 0;
  border-radius: 8px;
}

.note-content p {
  margin-bottom: 1rem;
}

/* =========================================================
   ERROR LISTS
   ========================================================= */

.errorlist {
  color: red;
  list-style: none;
  padding: 0;
}

/* =========================================================
   DASHBOARD LAYOUT
   ========================================================= */

/* Lock body scroll only on dashboard */
body:has(.dashboard-wrapper) {
  overflow: hidden;
}
.dashboard-wrapper {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.dashboard-body {
  flex: 1;
  display: flex;
  min-height: 0; 
  overflow: hidden;
}


/* Sidebar scroll (VS Code style) */
.sidebar {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#sidebar {
  width: 260px;               /* default */
  min-width: 260px;           /* minimum */    
  border-right: 1px solid #fff;
  overflow-y: auto;
  overflow-x: auto;
}
#sidebar-resizer {
  width: 6px;
  cursor: col-resize;
  background: transparent;
  position: relative;
}

/* hover feedback */
#sidebar-resizer:hover {
  background: rgba(0, 0, 0, 0.05);
}
/* Main content scroll */



/* =========================================================
   MAIN CONTENT (BOOTSTRAP-FREE)
   Applies only inside <main class="main-content">
========================================================= */

.main-content {
  flex: 1;
  min-width: 300px;
  overflow: auto;
  overscroll-behavior: contain;
  overflow-y: auto;
  overflow-y: auto;
  background: #f6f7f9;
  padding-left: 10vw !important;
  padding-right: 10vw !important;
  padding-top: 15vh !important;
  padding-bottom: 90px !important;
  
}

@media (max-width: 576px) {
  .main-content {
    padding-top: 8vh;
  }
}



/* =========================================================
   GRID SYSTEM (Bootstrap row/col replacement)
========================================================= */
/* ===== Grid ===== */
.main-content .row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
}

/* ===== Grid item ===== */
.main-content .row > div {
  width: 100%;
  justify-self: stretch;
}

/* ===== Card ===== */
.main-content .card,
.main-content .note-card {
  width: 100%;
  /* min-width: 160px;
  min-height: 160px; */
  /* height: auto; */

  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;

  display: flex;
  flex-direction: column;
}


/* ---------- Card body ---------- */
.main-content .card-body {
  padding: 14px 16px;
  flex: 1;
}
.main-content .card {
  position: relative;   /* 🔥 anchor for absolute children */
}


/* =========================================================
   TYPOGRAPHY
========================================================= */

.main-content .card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.main-content .card-text {
  font-size: 0.85rem;
  line-height: 1.45;
  color: #6b7280;
}

/* ---------- Truncate ---------- */
.main-content .text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-content .small {
  font-size: 0.85rem;
}

.main-content .text-muted {
  color: #6b7280;
}

/* =========================================================
   NOTE PREVIEW
========================================================= */

.main-content .note-preview {
  max-height: 80px;
  overflow: hidden;
  position: relative;
}

/* =========================================================
   BUTTONS (local)
========================================================= */

.main-content .btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
}

.main-content .btn-sm {
  font-size: 0.85rem;
}

/* =========================================================
   ICONS
========================================================= */

.main-content .note-card-icon {
  font-size: 1.1rem;
  color: #374151;
}

.main-content .note-card-icon:hover {
  color: #000000;
}

/* =========================================================
   EMPTY STATE TEXT
========================================================= */

.main-content p.text-muted {
  padding: 12px;
}



 


@media (max-width:992px){
 .main-content .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;

  }
}


/* Mobile */
@media (max-width: 576px) {
  .main-content {
    padding: 30px;
    padding-top:80px;
  }

  .note-card {
    height: auto;               /* natural height on mobile */
  }
}


/* Top bar (mobile dashboard) */
.mobile-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #dee2e6;
  background: #fff;
}

/* =========================================================
   SIDEBAR
   ========================================================= */



.sidebar {
  width: 260px;
  min-width: 260px;
  background: #fafafa;
  padding: 12px;
  height: auto;
  overflow-y: auto;
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  min-height: 0;
  overflow-y: auto;

}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 10px;
}

.sidebar-item {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: #333;
  text-decoration: none;
}

.sidebar-item:hover {
  background: #e9ecef;
}

.sidebar-item.active {
  background: #e9ecef;
  color: #333;
}

/* Sidebar backdrop (mobile) */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1030;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.sidebar-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile sidebar */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 48px;
    left: 0;
    transform: translateX(-100%);
    z-index: 1040;
    box-shadow: 0 0 20px rgba(0,0,0,.15);
    bottom: var(--safe-bottom);
    height: auto;
    overflow-y: auto;
   
  }

  .sidebar.show {
    transform: translateX(0);
  }
}

/* Mobile-safe dashboard height (accounts for bottom nav) */
@media (max-width: 768px) {
  .dashboard-wrapper {
    height: calc(100vh - 56px); /* bottom nav height */
  }
  #sidebar{
    min-width:100vw;
  }
}



/* Desktop sidebar */
@media (min-width: 769px) {
  .sidebar-backdrop {
    display: none;
  }
  
  
}

/* =========================================================
   FOLDERS
   ========================================================= */


.folder-row {
  position: relative; /* 🔥 ANCHOR FOR FOLDER MENU */

  border-radius: 8px;
  padding: 2px 4px;
 align-items: center;
  justify-content: space-between;
  
  gap: 8px;
}
.folder-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;          /* 🔑 allows text shrinking */
  flex: 1;               /* 🔑 takes remaining space */
}
.folder-row.active .folder-left {
  min-width: 0;          /* 🔑 enables shrinking */
}

.folder-row:hover {
  background: #e9ecef;
}

.folder-row.active {
  background: #e9ecef; /* soft grey like VS Code */
}

.folder-action-btn {
  background: none;
  border: none;
  color: #6b7280; /* default muted */
  padding: 6px;
  border-radius: 6px;
}

.folder-row.active .folder-action-btn {
  color: #333; /* same as text */
}

.folder-action-btn:hover {
  background: rgba(0,0,0,0.05);
}

.toggle-collapse {
  background: none;
  border: none;
  color: #6b7280;
}
/* Collapse all folder children by default */



.folder-row.active .toggle-collapse {
  color: #333;
}



.folder-add-btn {
  border: none;
  background: none;
  color: #6b7280;
  font-size: 16px;
  padding: 4px 6px;
  border-radius: 6px;
}

.folder-row:hover .folder-add-btn {
  color: #111827;
}

.folder-add-btn:hover {
  background: rgba(0,0,0,0.06);
}



.folder-menu-btn {
  border: none;
  background: none;
  color: #6b7280;
  font-size: 18px;
  padding: 4px 6px;
  border-radius: 6px;
}

.folder-row:hover .folder-menu-btn {
  color: #111827;
}

.folder-menu-btn:hover {
  background: rgba(0,0,0,0.06);
}


.folder-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: #fff;
  border-radius: 8px;
  min-width: 180px;
  padding: 6px 0;
  z-index: 10;
}

/* ===============================
   INLINE FOLDER INPUT (VS Code)
=============================== */

.folder-input {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #c7d2fe;
  outline: none;
  background: #eef2ff;
}

.folder-input::placeholder {
  color: #6b7280;
}

.folder-input:focus {
  border-color: #6366f1;
  background: #ffffff;
}

.folder-name {
  white-space: nowrap;     /* ❌ no wrapping */
  overflow: hidden;        /* hide overflow */
  text-overflow: ellipsis; /* … when too long */
  display: block;
  max-width: 100%;
}

.folder-link {
  display: flex;
  width:100%;
  min-width:0px;
  padding: 6px 10px;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #333 !important;
  text-decoration: none !important;
}

.folder-link:hover {
  background: #e9ecef;
}

/* ===============================
   FOLDER FLOATING MENU (VS CODE STYLE)
=============================== */



.folder-menu {
  position: absolute;
  top: 28px;
  right: 0;
  min-width: 180px;

  background: #ffffff;
  border-radius: 8px;
  padding: 4px 0;

  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.08);

  z-index: 1000;
  display: none;
}

.folder-menu.show {
  display: block;
}

/* Menu items */
.folder-menu li a,
.folder-menu li button {
  all: unset;
  display: flex;
  align-items: center;
  gap: 10px;

  width: 100%;
  padding: 6px 12px;

  font-size: 13px;
  color: #111827;
  cursor: pointer;
}

.folder-menu li a:hover,
.folder-menu li button:hover {
  background: #f3f4f6;
}

/* Icons */
.folder-menu i {
  font-size: 14px;
  opacity: 0.85;
}

/* Divider */
.folder-menu .divider {
  height: 1px;
  margin: 4px 0;
  background: #e5e7eb;
}

/* Danger action */
.folder-menu .danger {
  color: #b91c1c;
}

.folder-menu .danger:hover {
  background: #fee2e2;
}


/* ===============================
   FOLDER CONTEXT MENU (CLEAN)
=============================== */

.folder-menu {
  position: absolute;
  right: 0;
  top: 28px;
  min-width: 180px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 4px 0;
  z-index: 1000;

  /* 🔑 FULL RESET */
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.folder-menu li {
  list-style: none;
}

/* Kill browser marker completely */
.folder-menu li::marker {
  content: none;
}

/* Menu items */
.folder-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: #111827;
  background: transparent;
  border: none;
}

.folder-menu .dropdown-item:hover {
  background: #f3f4f6;
}

/* Danger action */
.folder-menu .dropdown-item.text-danger:hover {
  background: #fee2e2;
}


/* ===============================
   INLINE RENAME INPUT
=============================== */

.folder-name[contenteditable="true"] {
  background: #ffffff;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  padding: 2px 6px;
  outline: none;
  min-width: 120px;
}

/* ===============================
   Folder row hover actions (VS Code style)
=============================== */

/* Hide actions by default */
.folder-actions {
  opacity: 0;
  pointer-events: none;
  
  display: flex;
}

/* Show actions on hover */
.folder-row:hover .folder-actions {
  opacity: 1;
  pointer-events: auto;
  display: flex;
}

/* Keep visible if menu is open */
.folder-menu.show ~ .folder-actions,
.folder-actions:has(.folder-menu.show) {
  opacity: 1;
  pointer-events: auto;
}



.folder-add-btn,
.folder-menu-btn {
  background: transparent;
  border: none;
  color: #6b7280; /* neutral gray */
  padding: 2px 6px;
  border-radius: 4px;
}

.folder-row:hover .folder-add-btn,
.folder-row:hover .folder-menu-btn {
  color: #111827; /* darker on hover */
}

.folder-add-btn:hover,
.folder-menu-btn:hover {
  background: #e9ecef;
}

@media (max-width: 768px) {
  .folder-menu {
    min-width: 220px;
  }

  .folder-menu li a,
  .folder-menu li button {
    padding: 10px 14px;
    font-size: 14px;
  }
}


/* =========================================================
   DASHBOARD CONTEXT (TOP INTRO)
========================================================= */

.dashboard-context {
  margin-bottom: 24px;
}

.dashboard-context-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Title */
.dashboard-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
  margin-bottom: 2px;
}

/* Subtitle */
.dashboard-desc {
  font-size: 0.9rem;
  color: #6b7280;
  line-height: 1.4;
}

/* Subtle divider below */
.dashboard-context::after {
  content: "";
  display: block;
  margin-top: 16px;
  height: 1px;
  background: linear-gradient(
    to right,
    #e5e7eb,
    transparent
  );
}

/* Mobile tuning */
@media (max-width: 576px) {
  .dashboard-title {
    font-size: 1.15rem;
  }

  .dashboard-desc {
    font-size: 0.85rem;
  }
}

/* search notes dashboard */
/* ===============================
  MOBILE DASHBOARD SEARCH
=============================== */


.mobile-search {
 flex: 1;
 max-width: 170px;
}


.mobile-search input {
 width: 100%;
 border-radius: 999px;
 border: 1px solid #e5e7eb;
 padding: 5px 10px;
 font-size: 0.8rem;
 background: #f9fafb;
}


.mobile-search input:focus {
 outline: none;
 border-color: #e5e7eb;
 background: #ffffff;
}


.sidebar-search input {
 width: 100%;
 border-radius: 999px;
 border: 1px solid #e5e7eb;
 padding: 5px 10px;
 font-size: 0.8rem;
 background: #f9fafb;


 margin-bottom: 20px;;
}
.sidebar-search input:focus{
 outline: none;
 border-color: #f9fafb;
 background: #ffffff;
}





/* =========================================================
   DASHBOARD PAGE EXTRAS
   ========================================================= */

/* ===============================
   NOTE ACTION ICONS
=============================== */




/* Prevent pull-to-refresh / bounce */
body {
  overscroll-behavior-y: contain;
}

/* Mobile top nav (sticky) */
.mobile-top-nav {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: #fff;
}

/* Clickable note cards */
.note-card {
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.note-card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}



.note-card {
  height: 150px;                 /* 🔑 landscape feel */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.note-card .card-body {
  padding: 14px 16px;
}

.note-card .card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.note-card .note-preview {
  max-height: 44px;              /* prevent tall cards */
  font-size: 0.8rem;
  opacity: 0.7;
}




/* =========================================================
   SEARCH / DISCOVER PAGE
   ========================================================= */

/* Layout */
.search-wrapper {
  max-width: 760px;
  margin: 0 auto;
}

/* Header */
.search-title {
  font-size: 1.35rem;
  font-weight: 700;
}

.search-subtitle {
  color: #6b7280;
  font-size: 0.9rem;
}

/* Tabs */
.search-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search-tab {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  color: #374151;
}

.search-tab.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

/* Section title */
.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

/* Note card */
.search-note {
  background: #ffffff;
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.25rem;
  box-shadow:
    0 4px 12px rgba(0,0,0,0.04),
    0 1px 3px rgba(0,0,0,0.04);
}

.search-note-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.search-meta {
  font-size: 0.8rem;
  color: #6b7280;
}

.search-meta a {
  color: #111827;
  font-weight: 600;
  text-decoration: none;
}

.search-snippet {
  font-size: 0.9rem;
  color: #374151;
  margin-top: 0.5rem;
}

/* Category chip */
.category-chip {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
}

/* User row */
.user-row {
  background: #ffffff;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.6rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* Empty state */
.empty-state {
  text-align: center;
  color: #6b7280;
  padding: 3rem 0;
}



/* =========================================================
   PUBLIC FEED (INSTAGRAM-LIKE)
   ========================================================= */

/* Feed layout */
.feed-shell {
  display: grid;
  grid-template-columns: 0.3fr minmax(0, 700px) 0.15fr;
  gap: 2rem;
}

/* Header */
.feed-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* Category bar */
.category-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.category-pill {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  background: #f1f3f5;
  color: #374151;
  text-decoration: none;
}

.category-pill.active {
  background: #111827;
  color: #ffffff;
}

/* Feed card */
.feed-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.05),
    0 1px 3px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: transform 0.12s ease;
}
.feed-card a {
  text-decoration: none;
  color:inherit;
}
.feed-card:hover {
  transform: translateY(-2px);
}

/* Meta */
.note-meta {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.note-meta a {
  color: #111827;
  font-weight: 600;
  text-decoration: none;
}

/* Title */
.feed-card .note-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

/* Tags */
.note-tags {
  margin-bottom: 0.8rem;
}

.note-tags a {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  text-decoration: none;
  margin-right: 4px;
}

/* Content preview (portrait feel) */
.feed-card .note-preview {
  /* max-height: 420px; */
  overflow: hidden;
  position: relative;
  font-size: 0.95rem;
  line-height: 1.6;
}

.feed-card .note-preview::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 90px;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0),
    rgba(255,255,255,1)
  );
}

.feed-card .note-preview img {
  width: 100% !important;
  border-radius: 10px;
  margin: 0.75rem 0;
}

/* Actions */
.feed-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.9rem;
  color: #374151;
  margin-top: 1.1rem;
}

/* Mobile layout */
@media (max-width: 992px) {
  .feed-shell {
    grid-template-columns: 1fr;
  }
}






/* =========================================================
   NOTE DETAIL / READER PAGE
   ========================================================= */

/* Layout */
.note-wrapper {
  max-width: 760px;
  margin: 0 auto;
}

/* ---------- HEADER ---------- */
.note-header {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem 2.2rem;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.05),
    0 1px 4px rgba(0, 0, 0, 0.04);
  margin-bottom: 2rem;
}

.note-header .note-title {
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  line-height: 1.25;
}

/* Meta */
.note-header .note-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #6b7280;
}

.note-header .note-meta a {
  color: #111827;
  font-weight: 600;
  text-decoration: none;
}

.note-badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}

/* ---------- CONTENT ---------- */
.note-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #1f2937;
  margin-top: 1.5rem;
}

.note-content img {
  max-width: 100%;
  border-radius: 12px;
  margin: 1rem 0;
}

/* ---------- ACTION BAR ---------- */
.note-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1.8rem;
  flex-wrap: wrap;
}

.note-actions .btn {
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
}

/* ---------- COMMENTS ---------- */
.comments-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.6rem 2rem;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.04),
    0 1px 3px rgba(0, 0, 0, 0.04);
}

.comment {
  padding: 0.8rem 0;
  border-bottom: 1px solid #f1f3f5;
}

.comment:last-child {
  border-bottom: none;
}

.comment-user {
  font-weight: 600;
  font-size: 0.85rem;
}

.comment-time {
  font-size: 0.75rem;
  color: #9ca3af;
}

.comment-text {
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.comment-form textarea {
  border-radius: 12px;
}

/* ---------- MOBILE ---------- */
@media (max-width: 768px) {
  .note-header,
  .comments-card {
    padding: 1.4rem;
  }

  .note-header .note-title {
    font-size: 1.6rem;
  }
}

/* =========================================================
   PAGE NAVIGATION – BOOK STYLE
========================================================= */

/* ---------- Desktop layout ---------- */

.private-icon {
  font-size: 0.6rem;
  opacity: 0.6;
  margin-left: 2px;
}

.page-nav {
  position: sticky;
  top: 10vh;

  width: 140px;
  margin-right: 48px;

  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 16px;

  padding: 14px 12px;
  height: fit-content;
}

/* Header */
.page-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;

  margin-bottom: 12px;
}

/* Grid */
.page-nav-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Page chip (pill like your image) */
.page-chip {
  min-width: 36px;
  height: 30px;
  padding: 0 12px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;

  font-size: 0.8rem;
  font-weight: 500;
  color: #374151;
  text-decoration: none;

  transition: background 0.12s ease, color 0.12s ease;
}

.page-chip:hover {
  background: #f3f4f6;
}

/* Active page */
.page-chip.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

/* ---------- Reader alignment ---------- */

/* =========================================================
   READER – 3 COLUMN DESKTOP LAYOUT
========================================================= */

.reader {
  display: grid;
  grid-template-columns:
    140px          /* page nav */
    minmax(0, 760px) /* article */
    320px;         /* comments */

  gap: 48px;
  align-items: start;

  max-width: 1300px;
  margin: 0 auto;

  padding-top: 10vh;
  padding-bottom: 10vh;
  padding-inline: clamp(16px, 4vw, 48px);
}

.reader-wrap {
  width: 100%;
  max-width: 760px;
}

/* ===============================
   RIGHT COMMENT COLUMN
=============================== */

.reader-side {
  position: sticky;
  top: 10vh;
  align-self: start;
}

.reader-comments {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 16px 18px;
}

/* Title */
.comments-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
}

/* Individual comment */
.comment-row {
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.comment-row:last-child {
  border-bottom: none;
}


/* ===============================
   PREVIOUS / NEXT PAGE NAV
=============================== */

.reader-pager {
  margin-top: 4rem;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.pager-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  color: #111827;

  box-shadow:
    0 2px 8px rgba(0,0,0,0.04);

  transition: transform .15s ease, box-shadow .15s ease;
}

.pager-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 6px 18px rgba(0,0,0,0.08);
}

.pager-btn small {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
}

.pager-btn strong {
  font-size: 0.9rem;
  font-weight: 600;
}

/* alignment */
.pager-btn.prev {
  justify-content: flex-start;
}

.pager-btn.next {
  justify-content: flex-end;
  text-align: right;
}

/* mobile */
@media (max-width: 576px) {
  .reader-pager {
    flex-direction: column;
  }

  .pager-btn.next {
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 1024px) {
  .reader {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .reader-side {
    position: static;
    margin-top: 48px;
  }

  .page-nav {
    position: fixed;
    inset: 0 auto 0 0;

    width: 72vw;
    max-width: 280px;

    background: #f9fafb;
    border-right: 1px solid #e5e7eb;

    transform: translateX(-100%);
    transition: transform 0.25s ease;

    z-index: 10001; /* 🔑 ABOVE navbar & content */
  }

  .page-nav.show {
    transform: translateX(0);
  }
}


/* =========================================================
   MOBILE SLIDE-IN PAGE NAV
========================================================= */

.page-nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;

  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #374151;

  margin-bottom: 16px;
}

.page-nav-toggle:hover {
  background: #f3f4f6;
}

/* Mobile behavior */
@media (max-width: 768px) {
  .page-nav {
    position: fixed;
    inset: 0 auto 0 0;

    width: 72vw;
    max-width: 280px;

    margin: 0;
    border-radius: 0;
    border-right: 1px solid #e5e7eb;

    padding: 16px 14px;
    background: #f9fafb;

    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 9999;
  }

  .page-nav.show {
    transform: translateX(0);
  }

  .page-nav-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #6b7280;
  }
}



/* =========================================================
   FULL-SCREEN READER (DISTRACTION-FREE)
   ========================================================= */

/* Base reader page */
.page-reader {
  background: #ffffff;
  color: #111827;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  overscroll-behavior-y: contain;
}

/* ---------- TOP BAR ---------- */
.reader-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
}

.reader-top-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Icon buttons */
.icon-btn {
  background: none;
  border: none;
  color: #374151;
  padding: 0.35rem 0.45rem;
  font-size: 1rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.icon-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

.icon-btn.danger {
  color: #b91c1c;
}

.icon-btn.danger:hover {
  background: #fee2e2;
}

/* ---------- MAIN READER ---------- */



/* ---------- TITLE ---------- */
.reader-title {
  font-size: 2.35rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.85rem;
}

/* ---------- META ---------- */
.reader-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 2.8rem;
}
.reader-meta a{
  text-decoration: none;
  color: #111827;
  font-weight: 600;
}

/* ---------- CONTENT ---------- */
.reader-article {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
  line-height: 1.9;
  color: #111827;
}

.reader-article p {
  margin-bottom: 1.6rem;
}

.reader-article img {
  max-width: 100%;
  border-radius: 12px;
  margin: 2.5rem 0;
}

.reader-article h1,
.reader-article h2,
.reader-article h3 {
  font-family: system-ui, sans-serif;
  margin-top: 3.2rem;
  margin-bottom: 1.3rem;
  font-weight: 600;
}

.reader-article blockquote {
  border-left: 3px solid #e5e7eb;
  padding-left: 1rem;
  margin: 2.2rem 0;
  color: #374151;
  font-style: italic;
}

/* ---------- FOOTER ---------- */
.reader-footer {
  margin-top: 4.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.8rem;
  color: #6b7280;
}

/* ---------- MOBILE ---------- */
@media (max-width: 768px) {
  .reader-title {
    font-size: 1.8rem;
  }

  .reader {
    padding-top: 2.2rem;
  }
}



/* =========================================================
   LANDING / HERO PAGE
   ========================================================= */

/* Page-level override */
body.page-landing {
  background: #ffffff;
  overflow: hidden; /* prevent tiny mobile scroll */
}

/* Layout */
.page {
  height: 100svh; /* mobile-safe viewport */
  display: grid;
  grid-template-rows: 1fr auto;
}

.page main {
  display: grid;
  place-items: center;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

/* Hero */
.hero-box {
  width: 100%;
  max-width: 560px;
  text-align: center;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  min-height: 1.6em;
  color: #6c757d;
  margin-bottom: 0.75rem;
}

.hero-desc {
  font-size: 1rem;
  color: #6c757d;
  margin-bottom: 2rem;
}

/* CTA */
.cta .btn {
  min-width: 220px;
  padding: 0.75rem 1.25rem;
}

.cta .btn-link {
  text-decoration: none;
  font-size: 0.9rem;
}

.cta .btn-link:hover {
  text-decoration: underline;
  color: #495057;
}

/* Footer */
.page footer {
  text-align: center;
  padding: 0.75rem 0;
  font-size: 0.85rem;
  color: #8e8e8e;
}



/* =========================================================
   CHAT PAGE
   ========================================================= */

/* Page-level override */
body.page-chat {
  overflow: hidden; /* prevent full page scroll */
}

/* Chat page layout */
.chat-page {
  height: calc(100vh - 70px); /* top navbar height */
  display: flex;
  justify-content: center;
  padding-bottom: 70px;
}

/* Chat container */
.chat-container {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  /* border-radius: 14px;
  box-shadow:
    0 4px 14px rgba(0,0,0,0.05),
    0 1px 3px rgba(0,0,0,0.04); */
  overflow: hidden;
  padding-bottom: 10px;
}

/* Header */
.chat-header {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 1rem;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}

/* Messages area (ONLY this scrolls) */
.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 24px;
  background: #ffffff;
  overscroll-behavior: contain;
}

/* Message bubble */
.message {
 
  padding: 6px 10px;
  border-radius: 10px;
  margin-bottom: 8px;
  word-wrap: break-word;
  line-height: 1.35;
  font-size: 0.9rem;
  display: flex;
  width:fit-content;
  max-width: 70%; 
  flex-direction: column;
}

/* Sent */
.message.sent {
  background: #686c70;
  color: #ffffff;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

/* Received */
.message.received {
  background: #f6f7f9;
  color: #111827;
  margin-right: auto;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* Time */
.message-time {
  font-size: 0.65rem;
  opacity: 0.55;
  margin-top: 2px;
  text-align: right;
}

/* Input area */
.chat-input {
  padding: 10px 12px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
  display: flex;
  gap: 8px;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.chat-input input {
  flex: 1;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.9rem;
}

.chat-input button {
  border-radius: 999px;
  padding-inline: 16px;
  font-size: 0.85rem;
}


/* =========================================================
   AUTH PAGES (LOGIN / REGISTER)
   ========================================================= */

/* Page-level override */
body.page-auth {
  height: 100%;
  margin: 0;
  overflow: hidden; /* prevent mobile scroll */
  background: #f6f7f9;
  color: #1f2937;
}

/* Layout */
.auth-wrapper {
  height: 100svh; /* mobile-safe viewport */
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 1.5rem);
}

/* Card */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 14px;
  padding: 2rem;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.05),
    0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Header */
.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.home-link {
  font-size: 0.9rem;
  color: #000;
  text-decoration: none;
  font-weight: 500;
}

.home-link:hover {
  text-decoration: underline;
}

/* Titles */
.auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  color: #6c757d;
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
}

/* Inputs */
.auth-card .form-control {
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.auth-card .form-control:focus {
  box-shadow: none;
  border-color: #2563eb;
}

/* Button */
.auth-btn {
  border-radius: 10px;
  padding: 0.65rem;
  font-weight: 600;
}

/* Footer links */
.auth-links a {
  font-size: 0.9rem;
  color: #2563eb;
  text-decoration: none;
  margin-left: 0.25rem;
}

.auth-links a:hover {
  text-decoration: underline;
}


/* =========================================================
   LOGIN PAGE (shares AUTH base styles)
   ========================================================= */

/* Login layout */
.login-wrapper {
  height: 100svh; /* mobile-safe viewport */
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 1.5rem);
}

/* Card */
.login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 14px;
  padding: 2rem;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.05),
    0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Header */
.login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

/* Titles */
.login-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  color: #6c757d;
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
}

/* Inputs */
.login-card .form-control {
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.login-card .form-control:focus {
  box-shadow: none;
  border-color: #2563eb;
}

/* Button */
.login-btn {
  border-radius: 10px;
  padding: 0.65rem;
  font-weight: 600;
}

/* Footer links */
.login-links a {
  font-size: 0.9rem;
  color: #2563eb;
  text-decoration: none;
}

.login-links a:hover {
  text-decoration: underline;
}


/* =========================================================
   PROFILE PAGE
   ========================================================= */

/* Layout */
.profile-wrapper {
  max-width: 760px;
  margin: 0 auto;
}

/* ---------- PROFILE HEADER ---------- */
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.4rem;
  border-radius: 14px;
  background: #ffffff;
  box-shadow:
    0 4px 12px rgba(0,0,0,0.04),
    0 1px 3px rgba(0,0,0,0.04);
  margin-bottom: 2rem;
}

.profile-name {
  font-size: 1.3rem;
  font-weight: 700;
}

.profile-stats {
  font-size: 0.85rem;
  color: #6b7280;
}

.profile-stats a {
  color: #374151;
  font-weight: 600;
  text-decoration: none;
}

.profile-stats a:hover {
  text-decoration: underline;
}

/* ---------- PROFILE ACTIONS ---------- */
.profile-actions .btn {
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
}

/* ---------- SECTION TITLE ---------- */
/* (shared naming with search/feed, kept consistent) */
.profile-wrapper .section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}

/* ---------- PROFILE NOTE CARD ---------- */
.profile-note {
  background: #ffffff;
  border-radius: 14px;
  padding: 1.3rem 1.4rem;
  margin-bottom: 1.6rem;
  box-shadow:
    0 4px 12px rgba(0,0,0,0.04),
    0 1px 3px rgba(0,0,0,0.04);
}

.profile-note-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.profile-note-meta {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 0.6rem;
}

/* ---------- NOTE PREVIEW (SAME AS FEED STYLE) ---------- */
.profile-note .note-preview {
  max-height: 260px;
  overflow: hidden;
  position: relative;
  font-size: 0.95rem;
  line-height: 1.6;
}

.profile-note .note-preview::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 70px;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0),
    rgba(255,255,255,1)
  );
}

.profile-note .note-preview img {
  width: 100% !important;
  border-radius: 10px;
  margin: 0.5rem 0;
}

/* ---------- NOTE ACTIONS ---------- */
.profile-note .note-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.8rem;
  font-size: 0.85rem;
  color: #6b7280;
}

/* ===============================
   PROFILE – MOBILE FIX
=============================== */

@media (max-width: 576px) {
  .profile-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .profile-actions {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }

  .profile-actions .btn {
    flex: 1;                 /* buttons share width */
    justify-content: center;
    white-space: nowrap;
  }
}




/* =========================================================
   PROFILE SETTINGS (PREFERRED CATEGORIES)
   ========================================================= */


#id_username {
  text-transform: none;
}

.profile-settings-wrapper {
  max-width: 720px;
  margin: 0 auto;
}

/* Card spacing consistency */
.profile-settings-wrapper .card {
  border-radius: 14px;
}

/* Selected category chips */
#selectedCategories .badge {
  font-size: 0.75rem;
  padding: 0.45rem 0.6rem;
  cursor: default;
}

#selectedCategories .badge span {
  cursor: pointer;
  font-weight: 700;
}

/* Autocomplete results */
#categoryResults .btn {
  margin-right: 0.4rem;
  margin-bottom: 0.4rem;
}

/* Mobile spacing */
@media (max-width: 576px) {
  .profile-settings-wrapper {
    padding-inline: 0.5rem;
  }
}













.note-card-icon{
  border: none;
  color:greay;
  background-color: transparent;
}
.note-card-icon:hover{
  color:black;
  cursor:pointer;
}






/* ===============================
   READER ACTIONS
=============================== */

.reader-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding-top: 10px;
  padding-bottom: 10px;
  color: #374151;
}

.reader-action-btn {
  background: none;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: #111827;
  cursor: pointer;
}

.reader-action-btn.active {
  color: #111827;
}

.reader-action-btn:hover {
  color: #111827;
}

.reader-action-muted {
  font-size: 0.9rem;
  color: #6b7280;
}

/* ===============================
   COMMENTS
=============================== */

.reader-divider {
  margin: 3rem 0 2rem;
  border: none;
  border-top: 1px solid #e5e7eb;
}

.reader-comments {
  max-width: 680px;
}

.comments-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
}

.comment-row {
  padding: 0.9rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.comment-header {
  display: flex;
  gap: 10px;
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.2rem;
}

.comment-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #111827;
}

.comment-delete {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: #b91c1c;
  margin-top: 4px;
  cursor: pointer;
}

.comment-form {
  margin-top: 1.6rem;
}

.comment-form textarea {
  width: 100%;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  font-size: 0.9rem;
  resize: vertical;
}

.comment-submit {
  margin-top: 0.6rem;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
}


/* ===============================
   MAIN CONTENT GRID
=============================== */

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;

  align-items: start;
}

/* On very large screens → slightly tighter */
@media (min-width: 1400px) {
  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 576px) {
  .content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

/* ===============================
   FOLDER BIG ICON TILES
=============================== */

.folder-tile {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;

  padding: 22px 16px;
  min-height: 170px;
  min-width: 120px;


  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 6px;
  text-decoration: none;
  color: #111827;

  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.folder-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.08);
  border-color: #d1d5db;
}

/* Big folder icon */
.folder-tile-icon {
  font-size: 48px;
  color: #f59e0b; /* warm folder yellow */
  line-height: 1;
}

/* Folder name */
.folder-tile-name {
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  max-width: 100%;
}

/* Meta text */
.folder-tile-meta {
  font-size: 0.75rem;
  color: #6b7280;
}

.folder-thumb {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.folder-tile.has-cover {
  background-size: cover;
  background-position: center;
  color: white;
  position: relative;
}

.folder-tile.has-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.15),
    rgba(0,0,0,0.55)
  );
  border-radius: inherit;
}

.folder-tile.has-cover > * {
  position: relative;
  z-index: 1;
}

.folder-tile.has-cover .folder-tile-name,
.folder-tile.has-cover .folder-tile-meta {
  color: #fff;
}



/* =========================================================
   GENERIC CARD RAIL (Folders, Notes, Anything)
========================================================= */

.card-rail {
  position: relative;
  margin-bottom: 24px;
}

/* Scroll container */
.card-rail-track {
  display: flex;
  gap: 14px;

  overflow-x: auto;
  overflow-y: hidden;

  padding-bottom: 6px;
  padding-right: 48px;

  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;

  scrollbar-width: none;
}

/* Hide scrollbar */
.card-rail-track::-webkit-scrollbar {
  display: none;
}

/* Each card inside rail */
.card-rail-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

/* Snap scrolling */
.card-rail-track {
  scroll-snap-type: x mandatory;
}

/* Right fade hint */
.card-rail-fade {
  pointer-events: none;
  position: absolute;
  top: 0;
  right: 0;
  width: 64px;
  height: 100%;

  background: linear-gradient(
    to left,
    rgba(246,247,249,1),
    rgba(246,247,249,0)
  );
}

/* Card sizing defaults */
.folder-tile.card-rail-item {
  width: 160px;
  min-width: 160px;
}

.note-card.card-rail-item {
  width: 220px;
  min-width: 220px;
}

/* Mobile tuning */
@media (max-width: 576px) {
  .folder-tile.card-rail-item {
    width: 140px;
    min-width: 140px;
  }

  .note-card.card-rail-item {
    width: 200px;
    min-width: 200px;
  }

  .card-rail-fade {
    width: 48px;
  }
}


/* ===============================
   CREATE NOTE CARD – POLISHED
=============================== */

.create-note-card {
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  text-decoration: none;
  color: #374151;
  transition: all 0.15s ease;
 
}

.create-note-card:hover {
  background: #f3f4f6;
  border-color: #6366f1;
  color: #4338ca;
  transform: translateY(-1px);
}

.create-note-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.create-note-icon {
  font-size: 28px;
  line-height: 1;
}

.create-note-text {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.2px;
}




.dragging {
  opacity: 0.5;
}

.drag-over {
  background: #eef2ff !important;
}

.folder-row.drag-over {
  background: #eef2ff;
}

.folder-tile.dragging {
  opacity: 0.5;
}



/* mobile drag drop */


.move-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 9999;
}

.move-modal.hidden {
  display: none;
}

.move-sheet {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: #fff;
  border-radius: 16px 16px 0 0;
  max-height: 70vh;
  overflow-y: auto;
}

.move-header {
  display: flex;
  justify-content: space-between;
  padding: 14px;
 
}

.move-list button {
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  text-align: left;
}

.move-list button:hover {
  background: #f3f4f6;
}


.drag-active {
  opacity: 0.6;

}

.drag-mode .folder-row {
  background: #f9fafb;
}

.drag-mode #sidebar {
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}


.folder-tile-meta {
  font-size: 0.75rem;
  color: #6b7280;
  display: flex;
  gap: 8px;
  align-items: center;
}

.folder-tile-meta i {
  font-size: 0.8rem;
  opacity: 0.8;
}




/* ===== MOBILE OVERFLOW FIX ===== */
html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
  min-width: 0;
}

img, video {
  max-width: 100%;
  height: auto;
}

@media (max-width: 576px) {
  .main-content {
    padding-inline: 16px !important;
    padding-top: 40px !important;
  }

  .feed-shell {
    grid-template-columns: 1fr;
    padding-inline: 0;
  }
}
