/* Ayurvedamritham CSS - Traditional Palm-Leaf (Thaliyola) & Modern Styling */

@import url('https://fonts.googleapis.com/css2?family=Gayathri:wght@400;700&family=Inter:wght@300;400;500;600;700&family=Noto+Serif+Malayalam:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,700;1,400&display=swap');

/* Color Variables & Base Styles */
:root {
  /* Default: Thaliyola (Palm-Leaf Manuscript) Theme */
  --bg-color: #e5d8b1;
  --bg-surface: #f3e5c0;
  --bg-surface-glass: rgba(243, 229, 192, 0.92);
  --primary-color: #7b4513;
  --primary-light: #ebdcb2;
  --primary-dark: #4b2707;
  --accent-color: #a86b24;
  --accent-light: #f7ecd2;
  --text-main: #331a04;
  --text-muted: #6b523b;
  --border-color: #cbb483;
  --shadow-color: rgba(75, 39, 7, 0.12);
  
  /* Warnings & Contraindications */
  --warning-border: #bd3c1b;
  --warning-bg: #f5e4df;
  --warning-text: #731e0b;
  
  /* Transition & Typography */
  --transition-speed: 0.3s;
  --font-header: 'Noto Serif Malayalam', 'Playfair Display', serif;
  --font-body: 'Gayathri', 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Sandalwood Wood Grain Texture */
  --thaliyola-lines: repeating-linear-gradient(90deg, rgba(123, 69, 19, 0.015) 0px, rgba(123, 69, 19, 0.015) 2px, transparent 2px, transparent 12px), repeating-linear-gradient(90deg, rgba(123, 69, 19, 0.01) 0px, rgba(123, 69, 19, 0.01) 1px, transparent 1px, transparent 24px);
}

/* Theme: Kariyola (Burnt Charcoal/Dark Mode) */
body.kariyola-mode {
  --bg-color: #0b0e0c;
  --bg-surface: #121813;
  --bg-surface-glass: rgba(18, 24, 19, 0.92);
  --primary-color: #d19a47;
  --primary-light: #1b241c;
  --primary-dark: #ebd1a0;
  --accent-color: #b5894b;
  --accent-light: #161e17;
  --text-main: #cecac0;
  --text-muted: #838e86;
  --border-color: #233026;
  --shadow-color: rgba(0, 0, 0, 0.6);
  
  --warning-border: #d35400;
  --warning-bg: #221812;
  --warning-text: #e67e22;
  
  --thaliyola-lines: repeating-linear-gradient(90deg, rgba(209, 154, 71, 0.012) 0px, rgba(209, 154, 71, 0.012) 2px, transparent 2px, transparent 12px), repeating-linear-gradient(90deg, rgba(209, 154, 71, 0.008) 0px, rgba(209, 154, 71, 0.008) 1px, transparent 1px, transparent 24px);
}

/* Theme: Elayola (Fresh Green Leaf) */
body.elayola-mode {
  --bg-color: #e2ecd9;
  --bg-surface: #ecf7e4;
  --bg-surface-glass: rgba(236, 247, 228, 0.92);
  --primary-color: #357a3b;
  --primary-light: #dbead2;
  --primary-dark: #1b4e20;
  --accent-color: #4caf50;
  --accent-light: #f3fbf0;
  --text-main: #1b331f;
  --text-muted: #537057;
  --border-color: #bad2b2;
  --shadow-color: rgba(35, 74, 39, 0.08);
  
  --warning-border: #b33939;
  --warning-bg: #f9ebea;
  --warning-text: #8c1d18;
  
  --thaliyola-lines: repeating-linear-gradient(90deg, rgba(53, 122, 59, 0.015) 0px, rgba(53, 122, 59, 0.015) 2px, transparent 2px, transparent 12px), repeating-linear-gradient(90deg, rgba(53, 122, 59, 0.01) 0px, rgba(53, 122, 59, 0.01) 1px, transparent 1px, transparent 24px);
}

/* Reset & Layout */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.85;
  transition: background-color var(--transition-speed), color var(--transition-speed);
  font-size: 18px;
  background-image: var(--thaliyola-lines);
}

.app-container {
  display: flex;
  min-height: 100vh;
}

/* Navigation Sidebar */
.sidebar {
  width: 320px;
  background-color: var(--bg-surface);
  border-right: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 4px 0 16px var(--shadow-color);
  transition: transform var(--transition-speed) ease, background-color var(--transition-speed), border-color var(--transition-speed);
}

.sidebar-header {
  padding: 28px 24px;
  border-bottom: 2px solid var(--border-color);
  background-image: linear-gradient(to bottom, rgba(123, 69, 19, 0.04), transparent);
}

.sidebar-title {
  font-family: var(--font-header);
  font-size: 1.7rem;
  color: var(--primary-color);
  font-weight: 700;
  text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.4);
  line-height: 1.25;
}

.sidebar-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.nav-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin: 24px 0 8px 12px;
  font-weight: 700;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.92rem;
  font-family: var(--font-header);
  transition: all 0.2s;
  cursor: pointer;
  margin-bottom: 3px;
  border: 1px solid transparent;
}

.nav-link:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
  transform: translateX(4px);
}

.nav-link.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-weight: 700;
  border-color: var(--border-color);
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-link-icon {
  margin-right: 12px;
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 2px solid var(--border-color);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  background-color: rgba(0,0,0,0.02);
}

/* Main Area & Toolbar */
.main-content {
  flex: 1;
  margin-left: 320px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.toolbar {
  height: 75px;
  background-color: var(--bg-surface-glass);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 4px;
}

.search-container {
  position: relative;
  width: 280px;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 38px;
  border-radius: 20px;
  border: 1.5px solid var(--border-color);
  background-color: var(--bg-color);
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  transition: all 0.3s;
}

.search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(123, 69, 19, 0.15);
  width: 320px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 52%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.controls-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-selector {
  display: flex;
  background-color: var(--primary-light);
  padding: 4px;
  border-radius: 20px;
  border: 1.5px solid var(--border-color);
}

.theme-btn {
  background: none;
  border: none;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-header);
}

.theme-btn.active {
  background-color: var(--bg-surface);
  color: var(--primary-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.font-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 2px solid var(--border-color);
  padding-left: 16px;
}

.font-btn {
  background: none;
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.font-btn:hover {
  background-color: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Wood Board Page Layout */
.content-wrapper {
  max-width: 900px;
  width: 96%;
  margin: 40px auto;
  padding: 56px 64px;
  background-color: var(--bg-surface);
  border: 12px solid var(--primary-dark); /* Solid dark wood frame border */
  border-radius: 8px; /* Slightly rounded corners for the wood frame */
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.25),
    inset 0 0 25px rgba(123, 69, 19, 0.12); /* Inner shadow for depth */
  position: relative;
  
  /* Wood grain background texture layers */
  background-image: 
    linear-gradient(to right, rgba(75, 39, 7, 0.04) 0%, transparent 10%, transparent 90%, rgba(75, 39, 7, 0.05) 100%),
    var(--thaliyola-lines);
  flex: 1;
}

/* Traditional manuscript binding hole visual */
.content-wrapper::before {
  content: '';
  position: absolute;
  left: 36px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--bg-color);
  border: 2px solid var(--border-color);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 0 rgba(255,255,255,0.6);
  z-index: 10;
}

.content-wrapper::after {
  content: '✦';
  position: absolute;
  left: 38px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--border-color);
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11;
  pointer-events: none;
}

/* Cover Styling */
.book-cover-view {
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.cover-image-container {
  width: 100%;
  max-width: 440px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 30px var(--shadow-color);
  margin-bottom: 12px;
  border: 3px solid var(--border-color);
  background-color: #fff;
}

.cover-image-container img {
  width: 100%;
  height: auto;
  display: block;
}

.cover-title {
  font-family: var(--font-header);
  font-size: 3.2rem;
  color: var(--primary-color);
  line-height: 1.25;
  text-shadow: 1px 1px 1px rgba(255,255,255,0.8);
}

.cover-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  font-style: italic;
}

.start-reading-btn {
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  padding: 14px 40px;
  font-family: var(--font-header);
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(123, 69, 19, 0.25);
  transition: all 0.3s;
  margin-top: 15px;
}

.start-reading-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(123, 69, 19, 0.35);
  background-color: var(--primary-dark);
}

/* Chapter Headers */
.chapter-header {
  margin-bottom: 36px;
  border-bottom: 2px dashed var(--border-color);
  padding-bottom: 20px;
  position: relative;
  padding-left: 20px;
}

.chapter-badge {
  font-size: 0.8rem;
  color: var(--accent-color);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
  display: inline-block;
}

.chapter-title {
  font-family: var(--font-header);
  font-size: 2.1rem;
  color: var(--primary-color);
  line-height: 1.45;
  margin-bottom: 12px;
}

.bookmark-btn {
  position: absolute;
  right: 0;
  top: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  transition: color 0.2s;
}

.bookmark-btn.active {
  color: var(--accent-color);
}

.chapter-intro {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.75;
  padding-left: 16px;
  border-left: 3px solid var(--accent-color);
}

/* Chapter Reading Sections */
.chapter-section {
  margin-bottom: 40px;
  animation: fadeIn 0.4s ease-out;
  padding-left: 20px;
}

.section-title {
  font-family: var(--font-header);
  font-size: 1.4rem;
  color: var(--primary-color);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background-image: linear-gradient(to right, var(--border-color), transparent);
}

.chapter-section p {
  margin-bottom: 18px;
  text-align: justify;
  text-justify: inter-word;
}

.chapter-section blockquote {
  background-color: var(--primary-light);
  border-left: 4px solid var(--primary-color);
  padding: 16px 20px;
  margin: 20px 0 20px 20px;
  font-family: var(--font-header);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--primary-dark);
  line-height: 1.7;
  text-align: center;
  border-radius: 0 6px 6px 0;
}

.chapter-section ul, .chapter-section ol {
  margin: 14px 0 20px 36px;
}

.chapter-section li {
  margin-bottom: 8px;
}

/* Tridosha layout cards */
.dosha-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.dosha-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 3px 10px var(--shadow-color);
  transition: transform 0.25s, border-color 0.25s;
  background-image: var(--thaliyola-lines);
}

.dosha-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-color);
}

.dosha-card h4 {
  font-family: var(--font-header);
  font-size: 1.15rem;
  color: var(--primary-color);
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 6px;
}

.dosha-card p {
  font-size: 0.85rem;
  margin-bottom: 6px !important;
  text-align: left !important;
}

/* Warnings and Contraindications Box Styling */
.warning-box {
  background-color: var(--warning-bg);
  border: 1.5px solid var(--warning-border);
  color: var(--warning-text);
  padding: 20px 24px;
  border-radius: 10px;
  margin: 28px 0;
  box-shadow: 0 4px 12px rgba(123, 69, 19, 0.05);
}

.warning-box-title {
  font-family: var(--font-header);
  font-size: 1.15rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--warning-text);
}

.warning-box ul {
  margin: 10px 0 0 20px !important;
}

.warning-box li {
  font-size: 0.92rem;
  margin-bottom: 6px;
}

/* Sanskrit Mantras Custom Card */
.mantra-section-container {
  margin: 40px 0;
  background-color: var(--accent-light);
  border: 2px dashed var(--accent-color);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 6px 18px var(--shadow-color);
}

.mantra-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.mantra-flower {
  font-size: 1.5rem;
  color: var(--accent-color);
}

.mantra-card-title {
  font-family: var(--font-header);
  font-size: 1.25rem;
  color: var(--primary-color);
  font-weight: 600;
}

.sanskrit-verse {
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  color: var(--primary-dark);
  margin-bottom: 18px;
  line-height: 1.8;
  font-family: var(--font-header);
}

.malayalam-translit {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 6px;
  font-family: var(--font-header);
  font-size: 1.05rem;
  text-align: center;
  color: var(--text-main);
  margin-bottom: 20px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.03);
}

.mantra-subtitle {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--accent-color);
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.word-by-word-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
  background-color: var(--bg-surface);
  padding: 16px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.word-item {
  font-size: 0.85rem;
}

.word-item strong {
  color: var(--primary-color);
  font-family: var(--font-header);
}

.mantra-translation {
  font-size: 0.98rem;
  margin-bottom: 16px;
  line-height: 1.8;
  color: var(--text-main);
}

.mantra-significance {
  font-size: 0.88rem;
  background-color: var(--primary-light);
  padding: 12px;
  border-radius: 6px;
  color: var(--text-main);
  border-left: 3px solid var(--primary-color);
}

/* Tips and Tricks Box */
.tips-container {
  margin-top: 36px;
  background: linear-gradient(135deg, var(--primary-light), var(--bg-surface));
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 4px 12px var(--shadow-color);
}

.tips-header {
  font-family: var(--font-header);
  font-size: 1.15rem;
  color: var(--primary-color);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tips-list {
  list-style-type: none !important;
  margin: 0 !important;
}

.tips-list li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 12px;
  font-size: 0.92rem;
}

.tips-list li::before {
  content: '🌱';
  position: absolute;
  left: 0;
  top: 2px;
  font-size: 0.85rem;
}

/* Remedy Table layout */
.remedy-table-container {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  box-shadow: 0 3px 10px var(--shadow-color);
}

.remedy-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--bg-surface);
  text-align: left;
}

.remedy-table th, .remedy-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
}

.remedy-table th {
  background-color: var(--primary-color);
  color: #ffffff;
  font-family: var(--font-header);
  font-weight: 600;
}

.remedy-table tr:hover {
  background-color: var(--primary-light);
}

/* Medicinal Plants Cards */
.plants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.plant-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px var(--shadow-color);
  transition: all 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.plant-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px var(--shadow-color);
  border-color: var(--primary-color);
}

.plant-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background-color: #faf7f0;
  border-bottom: 1px solid var(--border-color);
}

.plant-card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.plant-card-title {
  font-family: var(--font-header);
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-bottom: 2px;
}

.plant-card-scientific {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.plant-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plant-card-more {
  margin-top: auto;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Modal details popup styling */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(5px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background-color: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 35 rgba(0, 0, 0, 0.25);
  position: relative;
  animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  background-image: var(--thaliyola-lines);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
  z-index: 10;
}

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

.modal-hero {
  position: relative;
  height: 220px;
  background-color: var(--primary-light);
  overflow: hidden;
  border-bottom: 2px solid var(--border-color);
}

.modal-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-body {
  padding: 28px;
}

.modal-title-box {
  margin-bottom: 16px;
}

.modal-title {
  font-family: var(--font-header);
  font-size: 1.6rem;
  color: var(--primary-color);
  margin-bottom: 2px;
}

.modal-sanskrit {
  font-size: 0.95rem;
  color: var(--accent-color);
  font-weight: 700;
}

.modal-scientific {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-muted);
}

.modal-section-title {
  font-family: var(--font-header);
  font-size: 1.1rem;
  color: var(--primary-color);
  margin: 20px 0 8px 0;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 4px;
}

.modal-properties {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
  background-color: var(--primary-light);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.modal-properties li {
  font-size: 0.85rem;
}

.modal-remedy-card {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 10px;
  background-image: var(--thaliyola-lines);
}

.modal-remedy-cond {
  font-family: var(--font-header);
  font-size: 0.95rem;
  color: var(--primary-dark);
  font-weight: 700;
  margin-bottom: 4px;
}

/* Treatment Items style */
.treatments-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}

.treatment-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 12px var(--shadow-color);
  background-image: var(--thaliyola-lines);
}

.treatment-name {
  font-family: var(--font-header);
  font-size: 1.35rem;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.treatment-desc {
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.treatment-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.treatment-col-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.treatment-benefits, .treatment-precautions {
  list-style-type: none;
}

.treatment-benefits li, .treatment-precautions li {
  position: relative;
  padding-left: 20px;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.treatment-benefits li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #27ae60;
  font-weight: bold;
}

.treatment-precautions li::before {
  content: '⚠';
  position: absolute;
  left: 0;
  color: var(--warning-border);
  font-weight: bold;
}

/* Dinacharya Tracker Styles */
.tracker-container {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 6px 18px var(--shadow-color);
  margin-top: 24px;
  background-image: var(--thaliyola-lines);
}

.tracker-dosha-select {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tracker-select-btn {
  background: none;
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 25px;
  font-size: 0.85rem;
  font-family: var(--font-header);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.tracker-select-btn:hover {
  background-color: var(--primary-light);
  border-color: var(--primary-color);
}

.tracker-select-btn.active {
  background-color: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

.tracker-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tracker-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background-color: var(--bg-color);
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
  background-image: var(--thaliyola-lines);
}

.tracker-item:hover {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
}

.tracker-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 3px;
  flex-shrink: 0;
  transition: all 0.15s;
}

.tracker-item.completed .tracker-checkbox {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
}

.tracker-item.completed .tracker-checkbox::after {
  content: '✓';
  font-size: 0.72rem;
  font-weight: bold;
}

.tracker-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tracker-item-title {
  font-family: var(--font-header);
  font-size: 0.98rem;
  color: var(--text-main);
}

.tracker-item.completed .tracker-item-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.tracker-item-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tracker-progress-container {
  margin-top: 24px;
  border-top: 1px dashed var(--border-color);
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tracker-progress-bar {
  flex: 1;
  height: 8px;
  background-color: var(--border-color);
  border-radius: 4px;
  margin: 0 16px;
  overflow: hidden;
}

.tracker-progress-fill {
  height: 100%;
  background-color: var(--primary-color);
  width: 0%;
  transition: width 0.3s ease;
}

.tracker-progress-text {
  font-size: 0.82rem;
  font-weight: 700;
}

/* Bookmarks grid */
.bookmarks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.bookmark-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 3px 10px var(--shadow-color);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bookmark-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

.bookmark-card-title {
  font-family: var(--font-header);
  font-size: 1.15rem;
  color: var(--primary-color);
}

.bookmark-card-intro {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Search results screen styles */
.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.search-result-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.search-result-item:hover {
  border-color: var(--primary-color);
  transform: translateX(4px);
}

.search-result-title {
  font-family: var(--font-header);
  font-size: 1.05rem;
  color: var(--primary-color);
  margin-bottom: 2px;
}

.search-result-type {
  font-size: 0.7rem;
  background-color: var(--primary-light);
  color: var(--primary-color);
  padding: 2px 6px;
  border-radius: 8px;
  display: inline-block;
  margin-bottom: 6px;
  font-weight: 700;
}

.search-result-snippet {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.highlight {
  background-color: rgba(181, 122, 50, 0.25);
  padding: 0 2px;
  border-radius: 2px;
  font-weight: bold;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalScale {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Mobile Screen Breakpoints */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .toolbar {
    padding: 0 16px;
  }
  
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.4);
    z-index: 95;
  }
  
  .sidebar-overlay.active {
    display: block;
  }
}

@media (max-width: 768px) {
  .content-wrapper {
    margin: 20px auto;
    padding: 36px 28px;
  }
  
  .content-wrapper::before {
    left: 20px;
    top: 24px;
    transform: none;
  }
  .content-wrapper::after {
    left: 22px;
    top: 25px;
    transform: none;
  }
}

@media (max-width: 576px) {
  body {
    font-size: 16px;
  }
  
  .toolbar {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
    gap: 12px;
  }
  
  .search-container {
    width: 100%;
    order: 3;
  }
  
  .search-input:focus {
    width: 100%;
  }
  
  .controls-group {
    width: 100%;
    justify-content: space-between;
  }
  
  .cover-title {
    font-size: 2.2rem;
  }
  
  .chapter-title {
    font-size: 1.5rem;
  }
  
  .content-wrapper {
    padding: 24px 16px;
    margin: 10px;
    border-width: 6px; /* Thinner wood border on mobile screens */
  }
  
  .content-wrapper::before, .content-wrapper::after {
    display: none; /* Hide manuscript holes on very small screens */
  }
  
  .mantra-section-container {
    padding: 16px;
  }
  
  .sanskrit-verse {
    font-size: 1.05rem;
  }
  
  .malayalam-translit {
    font-size: 0.9rem;
  }
  
  .theme-btn {
    padding: 4px 8px;
    font-size: 0.72rem;
  }
}
