:root {
  --bg-color: #121212;
  --surface-color: #1e1e1e;
  --text-color: #e0e0e0;
  --accent-color: #ff9800; /* Saffron-ish but modern */
  --muted-text: #b0b0b0;
  --border-color: #333;
  --sidebar-width: 280px;
}

body {
  font-family: 'Noto Sans Devanagari', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  line-height: 1.8;
}

h1, h2, h3, h4 {
  font-family: 'Rozha One', serif;
  color: var(--accent-color);
  font-weight: 400;
}

a { color: var(--accent-color); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: var(--sidebar-width);
  height: 100%;
  background-color: var(--surface-color);
  border-right: 1px solid var(--border-color);
  transition: left 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto; /* Enable scrolling */
}

.sidebar.active { left: 0; }

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

.sidebar-title {
  font-family: 'Rozha One', serif;
  font-size: 24px;
  color: var(--text-color);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 24px;
  cursor: pointer;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Volume Headers */
.vol-header a {
  display: block;
  padding: 15px 20px 5px 20px; /* Reduced bottom padding */
  color: var(--accent-color);
  font-family: 'Rozha One', serif;
  font-size: 18px;
  border-bottom: none; /* Removed border */
  text-transform: uppercase;
  letter-spacing: 1px;
}

.vol-header a:hover {
  background-color: transparent;
  text-decoration: underline;
}

/* Chapter Lists */
.chapter-list {
  padding-left: 0;
  margin-bottom: 15px;
  background-color: rgba(255, 255, 255, 0.03); /* Slight background distinction */
}

.chapter-list li a {
  display: block;
  padding: 8px 20px 8px 35px; /* Indented */
  color: var(--muted-text);
  font-size: 15px;
  border-bottom: 1px solid #2a2a2a;
  transition: all 0.2s ease;
}

.chapter-list li a:hover {
  background-color: #2a2a2a;
  color: var(--text-color);
  padding-left: 40px; /* slight movement on hover */
}

.sidebar-footer {
  margin-top: auto;
  padding: 20px;
}

#installAppBtn {
  width: 100%;
  padding: 10px;
  background-color: var(--accent-color);
  color: #000;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  z-index: 900;
}
.overlay.active { display: block; }

/* Main Content */
.main-content {
  padding-top: 60px; /* Space for mobile header */
}

.mobile-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background-color: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 800;
}

.hamburger {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 24px;
  cursor: pointer;
  margin-right: 20px;
}

.mobile-title {
  font-family: 'Rozha One', serif;
  font-size: 20px;
}

.wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Typography Enhancements */
blockquote {
  background-color: #1a1a1a;
  border-left: 4px solid var(--accent-color);
  color: var(--muted-text);
  margin: 20px 0;
  padding: 15px;
  font-style: italic;
}

code {
  background-color: #2a2a2a;
  color: #ffcc80;
  padding: 2px 5px;
  border-radius: 3px;
  font-family: monospace;
}

/* Desktop Sidebar always visible on large screens */
@media (min-width: 1024px) {
  .sidebar { left: 0; }
  .main-content { margin-left: var(--sidebar-width); padding-top: 0; }
  .mobile-header { display: none; }
  .overlay { display: none !important; } /* No overlay on desktop */
  .close-btn { display: none; }
}/* ... previous CSS ... */

/* Floating Share Button */
.fab-share {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 56px;
  height: 56px;
  background-color: var(--accent-color);
  color: #000;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: transform 0.2s ease, background-color 0.2s;
}

.fab-share:hover {
  transform: scale(1.1);
  background-color: #ffa726;
}

.fab-share:active {
  transform: scale(0.9);
}

/* Adjust for mobile */
@media (max-width: 768px) {
  .fab-share {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }
}
/* ... previous CSS ... */

/* PWA Toast */
.pwa-toast {
  position: fixed;
  bottom: -100px; /* Hidden initially */
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 400px;
  background-color: var(--surface-color);
  border: 1px solid var(--accent-color);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  padding: 15px;
  z-index: 2000;
  transition: bottom 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pwa-toast.show {
  bottom: 20px;
}

.pwa-content {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
}

.pwa-content span {
  font-size: 14px;
  color: var(--text-color);
  flex-grow: 1;
}

#pwa-install-btn {
  background-color: var(--accent-color);
  color: #000;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 10px;
}

#pwa-dismiss-btn {
  background: none;
  border: none;
  color: var(--muted-text);
  font-size: 18px;
  cursor: pointer;
  margin-left: 10px;
}
/* ... previous CSS ... */

/* Heading Anchors */
.post-content h1, .post-content h2, .post-content h3 {
  position: relative;
}

.anchor-link {
  position: absolute;
  left: -25px;
  opacity: 0;
  color: var(--accent-color);
  text-decoration: none;
  font-family: sans-serif;
  transition: opacity 0.2s;
}

h1:hover .anchor-link, h2:hover .anchor-link, h3:hover .anchor-link {
  opacity: 1;
}

@media (max-width: 1024px) {
  .anchor-link {
    left: auto;
    right: 0;
    opacity: 0.3; /* Always slightly visible on mobile */
  }
}
