/* ================= RESET & VARIABLES ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Arial, sans-serif;
}

body {
  background: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ================= GLOBAL COMPONENTS ================= */
/* These styles are shared across ALL pages */

/* Top Bar */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
}

.menu-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

#menu-btn {
  font-size: 26px;
  cursor: pointer;
  color: var(--text-main);
  user-select: none;
  transition: opacity 0.2s;
  border-right: 1px solid var(--border);
  padding-right: 16px;
}

#menu-btn:hover {
  opacity: 0.8;
}

.brand {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.brand-link {
  text-decoration: none;
}

.brand {
  color: var(--text-main) !important;
  transition: color 0.2s ease;
}

.brand:hover {
  color: var(--accent) !important;
}

/* Logo (used only in top bar of some pages) */
.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.logo {
  height: 40px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  transition: opacity 0.2s ease;
}

.logo:hover {
  opacity: 0.85;
}

/* Overlay */
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 900;
}

#overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Sidebar */
#sidebar {
  position: fixed;
  top: 0;
  left: -260px;
  width: 260px;
  height: 100%;
  background: var(--bg-sidebar);
  padding: 20px;
  transition: left 0.3s ease;
  z-index: 1100;
  overflow-y: auto;
}

#sidebar.active {
  left: 0;
}

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

.sidebar-logo {
  height: 28px;
  width: auto;
}

#close-btn {
  font-size: 22px;
  cursor: pointer;
  color: var(--text-main);
  transition: opacity 0.2s;
}

#close-btn:hover {
  opacity: 0.8;
}

#sidebar a {
  display: block;
  color: var(--text-main);
  text-decoration: none;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.2s;
}

#sidebar a:hover {
  background: var(--bg-hover);
}

/* Theme Controls */
.theme-controls {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.theme-controls p {
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.theme-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.theme-switcher button {
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 14px;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 70px;
}

.theme-switcher button:hover {
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.theme-switcher button.active-theme {
  background: var(--accent);
  color: #000000;
  font-weight: 600;
}

/* Footer */
footer {
  background: var(--bg-secondary);
  padding: 30px 20px;
  text-align: center;
  border-top: 1px solid var(--border);
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 10px;
  font-size: 14px;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--text-main);
}

footer p {
  margin-top: 15px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Back Button */
.back-btn-container {
  padding: 80px 20px 20px;
}

.back-btn {
  display: inline-block;
  padding: 8px 18px;
  background: var(--accent);
  color: #000000;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.back-btn:hover {
  background: var(--accent-soft);
  transform: translateY(-2px);
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 90%;
  max-width: 450px;
}

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

.modal-header h3 {
  font-size: 18px;
  color: var(--text-main);
}

.close-modal {
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-modal:hover {
  color: var(--accent);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 20px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}

.modal-btn {
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.modal-btn.cancel {
  background: var(--bg-card);
  color: var(--text-muted);
}

.modal-btn.cancel:hover {
  background: var(--bg-hover);
}

.modal-btn.save {
  background: var(--accent);
  color: #000000;
}

.modal-btn.save:hover {
  background: var(--accent-soft);
  transform: translateY(-2px);
}

/* ================= HOMEPAGE STYLES ================= */
/* These styles ONLY apply to index.html */

.landing {
  height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 25px;
}

.hero-logo {
  margin-bottom: 30px;
}

.hero-logo-img {
  height: 120px;
  width: auto;
  max-width: 90%;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.2));
  animation: fadeInDown 0.8s ease;
}

.landing h1 {
  font-size: 56px;
  letter-spacing: 6px;
  margin-bottom: 12px;
  font-weight: 500;
  color: var(--text-main);
}

.landing p {
  font-size: 16px;
  max-width: 520px;
  color: var(--text-muted);
  margin-bottom: 30px;
  line-height: 1.6;
}

.enter-btn {
  padding: 12px 32px;
  background: var(--accent);
  color: #000000;
  text-decoration: none;
  font-size: 15px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  display: inline-block;
}

.enter-btn:hover {
  background: var(--accent-soft);
  transform: translateY(-2px);
}

/* Hero logo variants */
.hero-logo-small {
  margin-bottom: 30px;
}

.hero-logo-small-img {
  height: 80px;
  width: auto;
  max-width: 90%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
  animation: fadeInDown 0.8s ease;
}

.hero-text-logo {
  margin-bottom: 30px;
}

.hero-brand {
  font-size: 48px;
  font-weight: 500;
  color: var(--text-main);
  display: block;
  letter-spacing: 2px;
}

.hero-japanese {
  font-size: 24px;
  color: var(--accent);
  opacity: 0.8;
  font-family: serif;
}

/* ================= LIBRARY PAGE STYLES ================= */
/* These styles ONLY apply to library.html */

.library {
  padding-top: 20px;
}

.library-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px 0 40px;
  padding: 0 20px;
}

.library-header h1 {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--text-main);
  margin-bottom: 24px;
}

/* Search Bar */
.search-wrapper {
  width: 100%;
  max-width: 600px;
  position: relative;
}

.search-container {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  transition: color 0.2s ease;
  pointer-events: none;
  z-index: 2;
}

.search-input {
  width: 100%;
  height: 60px;
  padding: 0 50px 0 50px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  color: var(--text-main);
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(255, 159, 28, 0.15);
  transform: translateY(-2px);
}

.search-container.focused .search-icon {
  color: var(--accent);
}

.search-clear {
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 8px;
  transition: all 0.2s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.search-clear:hover {
  color: var(--accent);
  transform: translateY(-50%) scale(1.1);
}

.search-shortcut {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 8px;
  background: var(--bg-secondary);
  border-radius: 6px;
  border: 1px solid var(--border);
  opacity: 0.7;
  pointer-events: none;
  z-index: 2;
}

.search-stats {
  text-align: right;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  height: 0;
}

.search-stats.visible {
  opacity: 0.8;
  transform: translateY(0);
  height: auto;
  margin-bottom: 20px;
}

#result-count {
  color: var(--accent);
  font-weight: 600;
}

/* Reading Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 30px 0;
  width: 100%;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stat-value {
  font-size: 32px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-trend {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
}

.stat-trend.positive {
  color: #4caf50;
}

/* Reading Goals */
.goals-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  margin: 20px 0 30px;
  width: 100%;
}

.goals-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

.goal-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.goal-item:last-child {
  border-bottom: none;
}

.goal-info {
  min-width: 180px;
}

.goal-label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 4px;
}

.goal-target {
  font-size: 12px;
  color: var(--text-muted);
}

.goal-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.goal-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-hover);
  border-radius: 6px;
  overflow: hidden;
}

.goal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: 6px;
  transition: width 0.3s ease;
}

.goal-percent {
  min-width: 45px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  text-align: right;
}

.goal-time {
  min-width: 140px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: right;
}

.edit-goals-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.edit-goals-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Category Titles */
.category-title {
  color: var(--text-main);
  font-size: 22px;
  margin: 40px 20px 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

/* Book Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 20px;
  padding: 0 20px 40px;
}

/* Book Cards */
.card {
  height: 200px;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  border-color: var(--accent);
}

.card-content {
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 12px;
  word-break: break-word;
}

.card-progress {
  margin-top: auto;
}

.card-progress-text {
  display: block;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 6px;
}

.card-progress-bar {
  height: 3px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}

.card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Card bottom progress bar */
.card[data-progress]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--bg-hover);
  z-index: 1;
}

.card[data-progress]::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: attr(data-progress '%');
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  z-index: 2;
  transition: width 0.3s ease;
}

/* Continue Reading Section */
.continue-section {
  margin: 30px 20px 50px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 0 4px;
}

.section-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-main);
}

.section-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.section-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

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

.continue-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.continue-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.continue-cover {
  width: 70px;
  height: 95px;
  background: var(--bg-hover);
  border-radius: 10px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.continue-info {
  flex: 1;
}

.continue-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.continue-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
}

.continue-category {
  color: var(--accent);
  background: rgba(255, 159, 28, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
}

.continue-chapter {
  color: var(--text-muted);
}

.continue-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.continue-last-read {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
}

.continue-skeleton {
  height: 120px;
  border-radius: 16px;
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Recently Added Section */
.recent-section {
  margin: 30px 20px 40px;
}

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

.recent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.recent-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--bg-hover);
}

.recent-cover {
  width: 100%;
  height: 120px;
  background: var(--bg-hover);
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.recent-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 6px;
}

.recent-category {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 2px 10px;
  border-radius: 20px;
  display: inline-block;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 60px 20px;
  display: none;
}

.no-results.show {
  display: block;
}

.no-results h3 {
  font-size: 20px;
  color: var(--text-main);
  margin-bottom: 8px;
}

.no-results p {
  color: var(--text-muted);
}

/* ================= LIBRARY PAGE STYLES ================= */
/* ... existing code ... */

/* Category Header with See All button */
.category-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 30px 20px 10px;
}

.category-title {
  color: var(--text-main);
  font-size: 22px;
  font-weight: 500;
  margin: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.see-all-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.see-all-link:hover {
  background: var(--bg-hover);
  transform: translateX(2px);
}

/* Horizontal Scroll Container */
.horizontal-scroll {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 16px;
  padding: 4px 20px 20px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: var(--accent) var(--bg-secondary);
}

/* Custom scrollbar for WebKit browsers */
.horizontal-scroll::-webkit-scrollbar {
  height: 4px;
}

.horizontal-scroll::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.horizontal-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--accent-soft);
}

/* Cards inside horizontal scroll */
.horizontal-scroll .card {
  flex: 0 0 auto;
  width: 140px; /* Fixed width for horizontal scroll */
  height: 200px;
  margin: 0;
}

/* Hide the old grid */
.grid {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .category-header {
    margin: 25px 16px 8px;
  }
  
  .category-title {
    font-size: 20px;
  }
  
  .horizontal-scroll {
    gap: 12px;
    padding: 4px 16px 16px;
  }
  
  .horizontal-scroll .card {
    width: 120px;
    height: 180px;
  }
}

@media (max-width: 480px) {
  .category-header {
    margin: 20px 12px 6px;
  }
  
  .category-title {
    font-size: 18px;
  }
  
  .see-all-link {
    font-size: 13px;
  }
  
  .horizontal-scroll {
    gap: 10px;
    padding: 4px 12px 14px;
  }
  
  .horizontal-scroll .card {
    width: 100px;
    height: 160px;
  }
}

/* ================= RESPONSIVE STYLES ================= */
/* These apply to all pages but are optimized per section */

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

/* Tablet */
@media (max-width: 768px) {
  /* Homepage */
  .hero-logo-small-img {
    height: 60px;
  }
  
  .landing h1 {
    font-size: 42px;
  }
  
  /* Library */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .goal-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .goal-info {
    min-width: auto;
    width: 100%;
  }
  
  .goal-progress {
    width: 100%;
  }
  
  .goal-time {
    min-width: auto;
    text-align: left;
  }
  
  .continue-grid {
    grid-template-columns: 1fr;
  }
  
  .recent-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .search-input {
    height: 52px;
    font-size: 15px;
  }
  
  .search-shortcut {
    display: none;
  }
}

/* Mobile */
@media (max-width: 480px) {
  /* Homepage */
  .hero-logo-small-img {
    height: 50px;
  }
  
  .landing h1 {
    font-size: 32px;
  }
  
  .landing p {
    font-size: 15px;
  }
  
  /* Library */
  .library-header h1 {
    font-size: 28px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .stat-value {
    font-size: 28px;
  }
  
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 12px 30px;
  }
  
  .card {
    height: 160px;
  }
  
  .card-title {
    font-size: 13px;
  }
  
  .recent-grid {
    grid-template-columns: 1fr;
  }
  
  .recent-cover {
    height: 140px;
  }
  
  .continue-card {
    padding: 12px;
  }
  
  .continue-cover {
    width: 60px;
    height: 80px;
  }
  
  .continue-title {
    font-size: 15px;
  }
  
  .search-input {
    height: 48px;
    font-size: 14px;
    padding: 0 40px 0 40px;
  }
  
  .search-icon {
    left: 14px;
    font-size: 14px;
  }
  
  .search-clear {
    right: 40px;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .category-title {
    font-size: 20px;
    margin: 30px 12px 15px;
  }
}

/* Very Small Phones */
@media (max-width: 360px) {
  .grid {
    grid-template-columns: 1fr;
  }
  
  .recent-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}