* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Hide all scrollbars */
*::-webkit-scrollbar {
  display: none;
}

* {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1e1e2e;
  font-family: 'Plus Jakarta Sans', 'Inter', Arial, sans-serif;
  color: #1a1a2e;
}

/* ===== App Shell ===== */
.app-shell {
  width: 100%;
  height: 100vh;
  padding: 50px 30px;
  display: flex;
  position: relative;
}

/* ===== White Container ===== */
.app-container {
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 40px;
  display: flex;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* ===== Sidebar ===== */
.sidebar {
  width: 200px;
  min-width: 200px;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 32px 0;
  border-right: 1px solid #f0f0f0;
}

.sidebar-logo {
  padding: 0 16px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.sidebar-logo .logo-main {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #1a1a2e;
  line-height: 1.1;
  text-align: center;
}

.sidebar-logo .logo-sub {
  font-size: 15px;
  font-weight: 500;
  color: #8b8b9e;
  letter-spacing: 3px;
  text-transform: lowercase;
  text-align: center;
}

/* ===== Sidebar Nav ===== */
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  text-decoration: none;
  color: #8b8b9e;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid transparent;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke: #8b8b9e;
  transition: stroke 0.25s ease, stroke-width 0.25s ease;
}

.nav-item:hover {
  background: #f0f0f4;
  color: #2d2d3a;
}

.nav-item:hover svg {
  stroke: #2d2d3a;
}

.nav-item.active {
  background: #ecedf2;
  color: #2d2d3a;
  border-color: #3a3a4a;
}

.nav-item.active svg {
  stroke: #2d2d3a;
  stroke-width: 2;
}

/* ===== Sidebar Footer ===== */
.sidebar-footer {
  padding: 16px;
  margin-top: auto;
}

.nav-item-logout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #8b8b9e;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
}

.nav-item-logout svg {
  width: 22px;
  height: 22px;
  stroke: #8b8b9e;
  transition: stroke 0.2s ease;
}

/* Sign In state: neutral gray-black hover */
.nav-item-logout.is-signin:hover,
.nav-item-logout:not(.is-logout):hover {
  background: #f0f0f5;
  color: #2d2d3a;
}

.nav-item-logout.is-signin:hover svg,
.nav-item-logout:not(.is-logout):hover svg {
  stroke: #2d2d3a;
}

/* Log Out state: red hover */
.nav-item-logout.is-logout:hover {
  background: #fff0f0;
  color: #e74c3c;
}

.nav-item-logout.is-logout:hover svg {
  stroke: #e74c3c;
}

/* ===== Main Content Wrapper ===== */
.content-wrapper {
  flex: 1;
  height: 100%;
  display: flex;
  overflow: hidden;
}

/* Remove old content-wrapper flex for leaderboard - now it's just main-content */
.content-wrapper {
  display: block;
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 32px 36px 0;
  padding-right: 756px;
  overflow: hidden;
}

/* ===== Right Sidebar (Leaderboard) - Floating independent panel ===== */
.right-sidebar {
  position: absolute;
  right: 36px;
  top: 50px;
  bottom: 0;
  width: 620px;
  overflow-y: auto;
  padding: 30px 24px 20px;
  background: #fff;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12);
  z-index: 50;
}

.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f5;
}

.leaderboard-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
}

.leaderboard-badge {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #2d2d3a;
  padding: 6px 16px;
  border-radius: 20px;
}

/* ===== Leaderboard List ===== */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 16px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
}

.leaderboard-item:hover {
  background: #f8f8fc;
  border-color: #e8e8f0;
  transform: translateX(2px);
}

.leaderboard-rank {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
}

.leaderboard-rank.top1 {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #fff;
  box-shadow: 0 3px 10px rgba(255, 165, 0, 0.3);
}

.leaderboard-rank.top2 {
  background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
  color: #fff;
  box-shadow: 0 3px 10px rgba(192, 192, 192, 0.3);
}

.leaderboard-rank.top3 {
  background: linear-gradient(135deg, #CD7F32, #B8690E);
  color: #fff;
  box-shadow: 0 3px 10px rgba(205, 127, 50, 0.3);
}

.leaderboard-rank.normal {
  background: #f0f0f5;
  color: #8b8b9e;
}

.leaderboard-info {
  flex: 1;
  min-width: 0;
}

.leaderboard-name {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.leaderboard-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.leaderboard-tag {
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.leaderboard-tag.tag-ai {
  background: #eef0ff;
  color: #6C5CE7;
}

.leaderboard-tag.tag-design {
  background: #fff4ec;
  color: #e67e22;
}

.leaderboard-tag.tag-dev {
  background: #ecfdf5;
  color: #10b981;
}

.leaderboard-tag.tag-productivity {
  background: #f0f4ff;
  color: #3b82f6;
}

.leaderboard-tag.tag-seo {
  background: #fef3f2;
  color: #ef4444;
}

.leaderboard-tag.tag-writing {
  background: #fefce8;
  color: #ca8a04;
}

.leaderboard-tag.tag-video {
  background: #fdf2f8;
  color: #ec4899;
}

.leaderboard-visits {
  font-size: 13px;
  color: #a0a0b5;
  display: flex;
  align-items: center;
  gap: 4px;
}

.leaderboard-visits svg {
  width: 13px;
  height: 13px;
  stroke: #a0a0b5;
}

.leaderboard-score {
  font-size: 13px;
  font-weight: 700;
  color: #6C5CE7;
  flex-shrink: 0;
}

.leaderboard-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.leaderboard-trend {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 8px;
}

.leaderboard-trend.up {
  color: #16a34a;
  background: #f0fdf4;
}

.leaderboard-trend.down {
  color: #dc2626;
  background: #fef2f2;
}

.leaderboard-trend svg {
  width: 14px;
  height: 14px;
}

.leaderboard-hot {
  font-size: 13px;
  color: #a0a0b5;
}

/* ===== Search Bar ===== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 20px;
  margin-bottom: 0;
  position: sticky;
  top: 0;
  z-index: 20;
  background: #f4f4f7;
}

.search-bar svg {
  width: 18px;
  height: 18px;
  stroke: #2d2d3a;
  flex-shrink: 0;
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  color: #1a1a2e;
  width: 100%;
}

.search-bar input:focus {
  outline: none;
  box-shadow: none;
  border: none;
}

.search-bar:focus-within {
  outline: none;
  box-shadow: none;
}

.search-bar input::placeholder {
  color: #2d2d3a;
}

/* Scrollable content area below search bar */
.page-scroll {
  overflow-y: auto;
  flex: 1;
  padding-top: 28px;
}

/* ===== Section Title ===== */
.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #1a1a2e;
}

/* ===== Tool Cards Grid ===== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 32px 24px;
  padding: 16px 20px 28px;
}

/* Polaroid Stack Card */
.tool-card {
  position: relative;
  background: #fff;
  border: 2px solid #2d2d3a;
  padding: 7% 7% 12% 7%;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: 0.25s ease;
  border-radius: 2px;
}

.tool-card::before,
.tool-card::after {
  content: "";
  display: block;
  position: absolute;
  height: 100%;
  width: 100%;
  border: 2px solid #2d2d3a;
  background: #fff;
  transform-origin: center center;
  z-index: -1;
  transition: 0.15s ease;
  top: 0;
  left: 0;
  border-radius: 2px;
}

.tool-card::before {
  transform: translateY(-2%) rotate(-5deg);
}

.tool-card::after {
  transform: translateY(2%) rotate(5deg);
}

.tool-card:hover {
  transform: rotate(4deg);
}

.tool-card:hover::before {
  transform: translateY(-2%) rotate(-3deg);
}

.tool-card:hover::after {
  transform: translateY(2%) rotate(3deg);
}

/* Icon = "photo" area */
.tool-card-icon {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px solid #2d2d3a;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  font-size: 0;
  position: relative;
}

/* Curved arrow in bottom-right of photo area */
.tool-card-icon::after {
  content: "";
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232d2d3a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' opacity='0.3'%3E%3Cpath d='M7 17l9.2-9.2M17 17V7H7'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Caption area (below photo) */
.tool-card-name {
  font-size: 13px;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.tool-card-desc {
  font-size: 10px;
  color: #8b8b9e;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hide old arrow element */
.tool-card-arrow {
  display: none;
}

/* ===== Page Switching ===== */
.page {
  display: none;
}

.page.active {
  display: block;
  animation: pageEnter 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes pageEnter {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Staggered children animation */
.page.active > .module {
  opacity: 0;
  animation: moduleSlideIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.page.active > .module:nth-child(1) { animation-delay: 0.05s; }
.page.active > .module:nth-child(2) { animation-delay: 0.12s; }
.page.active > .module:nth-child(3) { animation-delay: 0.19s; }
.page.active > .module:nth-child(4) { animation-delay: 0.26s; }
.page.active > .module:nth-child(5) { animation-delay: 0.33s; }
.page.active > .module:nth-child(6) { animation-delay: 0.40s; }

@keyframes moduleSlideIn {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tool cards stagger within each module */
.page.active .tool-card,
.page.active .favorite-card,
.page.active .accordion-item {
  opacity: 0;
  animation: cardReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.page.active .tool-card:nth-child(1),
.page.active .favorite-card:nth-child(1),
.page.active .accordion-item:nth-child(1) { animation-delay: 0.1s; }

.page.active .tool-card:nth-child(2),
.page.active .favorite-card:nth-child(2),
.page.active .accordion-item:nth-child(2) { animation-delay: 0.15s; }

.page.active .tool-card:nth-child(3),
.page.active .favorite-card:nth-child(3),
.page.active .accordion-item:nth-child(3) { animation-delay: 0.2s; }

.page.active .tool-card:nth-child(4),
.page.active .favorite-card:nth-child(4),
.page.active .accordion-item:nth-child(4) { animation-delay: 0.25s; }

.page.active .tool-card:nth-child(5),
.page.active .favorite-card:nth-child(5),
.page.active .accordion-item:nth-child(5) { animation-delay: 0.3s; }

.page.active .tool-card:nth-child(6) { animation-delay: 0.35s; }
.page.active .tool-card:nth-child(7) { animation-delay: 0.4s; }
.page.active .tool-card:nth-child(8) { animation-delay: 0.45s; }

@keyframes cardReveal {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== Module Spacing ===== */
.module {
  margin-bottom: 36px;
  overflow: visible;
  padding: 0 8px;
}

/* ===== Favorites Grid ===== */
.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.favorite-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border: 1.5px solid #eeeef2;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s ease;
  position: relative;
}

.favorite-card:hover {
  border-color: #d0d0e0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.favorite-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.favorite-info {
  flex: 1;
  min-width: 0;
}

.favorite-name {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 2px;
}

.favorite-cat {
  font-size: 11px;
  color: #a0a0b5;
}

.favorite-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f4f4f8;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
}

.favorite-remove svg {
  width: 10px;
  height: 10px;
  stroke: #8b8b9e;
}

.favorite-card:hover .favorite-remove {
  opacity: 1;
}

/* ===== Accordion FAQ ===== */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.accordion-item {
  border: 1.5px solid #eeeef2;
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.25s ease;
}

.accordion-item.open {
  border-color: #d0d0e0;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  background: #fff;
  transition: background 0.2s ease;
  user-select: none;
}

.accordion-header:hover {
  background: #fafafc;
}

.accordion-header span {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
}

.accordion-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.accordion-icon svg {
  width: 16px;
  height: 16px;
  stroke: #8b8b9e;
}

.accordion-item.open .accordion-icon {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-body-inner {
  padding: 0 20px 18px;
  font-size: 14px;
  color: #6b6b80;
  line-height: 1.7;
}

/* ===== Tool Detail Page ===== */
.detail-page {
  max-width: 720px;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  border: 1.5px solid #eeeef2;
  background: #fff;
  color: #2d2d3a;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 32px;
}

.detail-back svg {
  width: 18px;
  height: 18px;
  stroke: #2d2d3a;
}

.detail-back:hover {
  background: #f4f4f7;
  border-color: #d0d0e0;
  transform: translateX(-4px);
}

.detail-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.detail-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: #eef0ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  flex-shrink: 0;
}

.detail-hero-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-name {
  font-size: 28px;
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1.2;
}

.detail-cat {
  font-size: 13px;
  font-weight: 600;
  color: #6C5CE7;
  background: #eef0ff;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
  width: fit-content;
}

.detail-desc {
  font-size: 16px;
  color: #6b6b80;
  line-height: 1.7;
  margin-bottom: 28px;
}

.detail-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
}

.detail-btn-visit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 14px;
  background: #2d2d3a;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  border: none;
}

.detail-btn-visit svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
}

.detail-btn-visit:hover {
  background: #1a1a2e;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 45, 58, 0.25);
}

.detail-btn-save {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 14px;
  background: #fff;
  color: #2d2d3a;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  border: 1.5px solid #eeeef2;
}

.detail-btn-save svg {
  width: 18px;
  height: 18px;
  stroke: #2d2d3a;
}

.detail-btn-save:hover {
  border-color: #6C5CE7;
  color: #6C5CE7;
  background: #f8f7ff;
  transform: translateY(-2px);
}

.detail-btn-save:hover svg {
  stroke: #6C5CE7;
}

.detail-btn-save.saved {
  background: #6C5CE7;
  color: #fff;
  border-color: #6C5CE7;
}

.detail-btn-save.saved svg {
  stroke: #fff;
  fill: #fff;
}

.detail-article {
  margin-bottom: 40px;
}

.detail-article-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid #eeeef2;
}

.detail-article-body {
  font-size: 15px;
  color: #4a4a5e;
  line-height: 1.85;
}

.detail-article-body p {
  margin-bottom: 16px;
}

.detail-article-body h3 {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 24px 0 10px;
}

.detail-article-body ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

.detail-article-body ul li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.detail-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

/* ===== Categories Page ===== */
.categories-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.login-prompt {
  text-align: center;
  max-width: 420px;
  animation: loginFloat 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes loginFloat {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-prompt-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: #f4f4f7;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-prompt-icon svg {
  width: 40px;
  height: 40px;
}

.login-prompt-title {
  font-size: 22px;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 12px;
}

.login-prompt-desc {
  font-size: 14px;
  color: #8b8b9e;
  line-height: 1.7;
  margin-bottom: 28px;
}

.login-prompt-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  border-radius: 16px;
  background: #2d2d3a;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  margin-bottom: 20px;
}

.login-prompt-btn svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
}

.login-prompt-btn:hover {
  background: #1a1a2e;
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(45, 45, 58, 0.3);
}

.login-prompt-hint {
  font-size: 13px;
  color: #a0a0b5;
}

.login-link {
  color: #6C5CE7;
  font-weight: 600;
  text-decoration: none;
}

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

/* Categories logged-in content */
.categories-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  text-align: center;
  padding: 40px 20px;
}

.categories-empty-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.categories-empty-icon svg {
  width: 100%;
  height: 100%;
}

.categories-empty-title {
  font-size: 20px;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.categories-empty-desc {
  font-size: 14px;
  color: #8b8b9e;
  max-width: 360px;
  line-height: 1.6;
  margin-bottom: 28px;
}

.categories-empty-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.categories-help-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 12px;
  background: #fff;
  color: #2d2d3a;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid #e0e0ea;
  transition: all 0.25s ease;
}

.categories-help-btn svg {
  width: 14px;
  height: 14px;
}

.categories-help-btn:hover {
  border-color: #6C5CE7;
  color: #6C5CE7;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(108, 92, 231, 0.12);
}

/* Help Modal */
.help-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 20, 30, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.help-overlay.open {
  display: flex;
  animation: overlayIn 0.3s ease forwards;
}

.help-modal {
  position: relative;
  width: 480px;
  max-width: 94vw;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.2);
  animation: modalIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.help-title {
  font-size: 22px;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 28px;
}

.help-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.help-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.help-step-num {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #6C5CE7;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.help-step-body h3 {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.help-step-body p {
  font-size: 13px;
  color: #6b6b80;
  line-height: 1.6;
}

.categories-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.categories-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 12px;
  background: #2d2d3a;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
}

.categories-add-btn svg {
  width: 14px;
  height: 14px;
  stroke: #fff;
}

.categories-add-btn:hover {
  background: #1a1a2e;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(45, 45, 58, 0.2);
}

.category-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.category-module-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
}

.category-module-count {
  font-size: 13px;
  color: #a0a0b5;
  font-weight: 500;
}

/* ===== Auth Modal ===== */
.auth-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 20, 30, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.auth-overlay.open {
  display: flex;
  animation: overlayIn 0.3s ease forwards;
}

@keyframes overlayIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.auth-modal {
  position: relative;
  width: 420px;
  max-width: 94vw;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.2);
  animation: modalIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes modalIn {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: #f4f4f7;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.auth-close svg {
  width: 18px;
  height: 18px;
  stroke: #6b6b80;
}

.auth-close:hover {
  background: #eeeef2;
  transform: scale(1.05);
}

.auth-header {
  margin-bottom: 28px;
}

.auth-title {
  font-size: 24px;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 14px;
  color: #8b8b9e;
}

.auth-field {
  margin-bottom: 18px;
}

.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #2d2d3a;
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid #eeeef2;
  background: #fafafe;
  font-size: 14px;
  font-family: inherit;
  color: #1a1a2e;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.auth-input:focus {
  border-color: #6C5CE7;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
  background: #fff;
}

.auth-input::placeholder {
  color: #b0b0c0;
}

/* Avatar Upload */
.auth-avatar-upload {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding: 16px;
  border-radius: 14px;
  background: #fafafe;
  border: 1.5px dashed #e0e0ea;
  transition: border-color 0.25s ease;
}

.auth-avatar-upload:hover {
  border-color: #6C5CE7;
}

.auth-avatar-preview {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #eeeef2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.auth-avatar-preview svg {
  width: 28px;
  height: 28px;
  stroke: #a0a0b5;
}

.auth-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-avatar-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-avatar-btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1.5px solid #eeeef2;
  background: #fff;
  color: #2d2d3a;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  width: fit-content;
}

.auth-avatar-btn:hover {
  border-color: #6C5CE7;
  color: #6C5CE7;
}

.auth-avatar-hint {
  font-size: 11px;
  color: #a0a0b5;
}

/* Submit Button */
.auth-submit {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: #2d2d3a;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.auth-submit:hover {
  background: #1a1a2e;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 45, 58, 0.25);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-submit-loader svg {
  width: 20px;
  height: 20px;
}

/* Error */
.auth-error {
  font-size: 13px;
  color: #e74c3c;
  text-align: center;
  min-height: 20px;
  margin-bottom: 4px;
}

/* Switch Link */
.auth-switch {
  font-size: 13px;
  color: #8b8b9e;
  text-align: center;
}

.auth-switch a {
  color: #6C5CE7;
  font-weight: 600;
  text-decoration: none;
}

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

/* ===== Sidebar User Profile (logged in) ===== */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 0 14px 14px 0;
  background: #f4f4f7;
  margin-bottom: 16px;
  margin-right: 20px;
  cursor: default;
}

.sidebar-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #eeeef2;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 11px;
  color: #8b8b9e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Global Toast ===== */
.toast-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.toast {
  padding: 18px 44px;
  background: rgba(26, 26, 36, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: scale(0.88);
  animation: toastIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  pointer-events: auto;
}

.toast.toast-out {
  animation: toastOut 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes toastIn {
  0% { opacity: 0; transform: scale(0.88); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes toastOut {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.88); }
}

/* ===== SEO: Screen reader only ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
