* {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.1s ease;
}

button, .tab, .card, .nav-item, .icon-btn, .share-btn {
  cursor: pointer;
}

button:active, .tab:active, .card:active, 
.nav-item:active, .icon-btn:active, .share-btn:active {
  transform: scale(1.08);
}
/* ===== CSS VARIABLES ===== */
:root {
  --bg: #f5f0eb;
  --bg2: #ffffff;
  --bg3: #ede8e0;
  --header-bg: #1a2744;
  --header-text: #ffffff;
  --text: #1a1a2e;
  --text2: #555577;
  --accent: #e8690a;
  --accent2: #1a2744;
  --card-bg: #ffffff;
  --card-shadow: 0 4px 20px rgba(0,0,0,0.10);
  --border: #ddd8cf;
  --tab-active: #1a2744;
  --tab-text: #888;
  --radius: 16px;
  --radius-sm: 10px;
  --modal-bg: #f5f0eb;
  --nav-bg: #ffffff;
  --nav-border: #ede8e0;
  --tag-bg: #ede8e0;
  --tag-active: #1a2744;
  --tag-active-text: #fff;
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"] {
  --bg: #0f1117;
  --bg2: #1a1d27;
  --bg3: #22263a;
  --header-bg: #0a0d18;
  --header-text: #e8e0ff;
  --text: #e8e0ff;
  --text2: #9090b0;
  --accent: #ff8c3a;
  --accent2: #a78bfa;
  --card-bg: #1a1d27;
  --card-shadow: 0 4px 20px rgba(0,0,0,0.40);
  --border: #2a2d3e;
  --tab-active: #a78bfa;
  --tab-text: #6060a0;
  --modal-bg: #0f1117;
  --nav-bg: #1a1d27;
  --nav-border: #2a2d3e;
  --tag-bg: #22263a;
  --tag-active: #a78bfa;
  --tag-active-text: #0f1117;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans Devanagari', 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 80px;
  transition: background var(--transition), color var(--transition);
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--header-bg);
  color: var(--header-text);
  box-shadow: 0 2px 20px rgba(0,0,0,0.25);
}
.header-left { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 28px; }
.logo-text { display: flex; flex-direction: column; }
.logo-main {
  font-family: 'Tiro Devanagari Hindi', serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #fff;
}
.logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-family: 'DM Sans', sans-serif;
}
.logo-clock {
  font-size: 11px;
  color: rgba(255,255,255,0.80);
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.5px;
  margin-top: 1px;
}
.header-right { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  background: none;
  border: none;
  color: var(--header-text);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.icon-btn:hover { background: rgba(255,255,255,0.15); }

/* ===== SEARCH BAR ===== */
.search-bar-wrap {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: var(--bg2);
  transform: translateY(-110%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 4px 30px rgba(0,0,0,0.15);
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}
.search-bar-wrap.open { transform: translateY(0); }
.search-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  color: var(--text2);
}
.search-inner input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
}
.search-inner input::placeholder { color: var(--text2); }
#searchClose {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text2);
  padding: 4px 8px;
}
.search-results {
  padding: 0 16px 16px;
  max-height: 60vh;
  overflow-y: auto;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.search-result-item:hover { background: var(--bg3); }
.search-result-cover {
  width: 44px; height: 60px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg3);
}
.search-result-info .title { font-weight: 600; font-size: 14px; }
.search-result-info .meta { font-size: 12px; color: var(--text2); margin-top: 2px; }
.search-no-result { color: var(--text2); text-align: center; padding: 24px; }

/* ===== DROPDOWN MENU ===== */
.dropdown-menu {
  position: fixed;
  top: 60px; right: 12px;
  z-index: 300;
  background: var(--bg2);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.20);
  padding: 8px;
  min-width: 200px;
  border: 1px solid var(--border);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92) translateY(-10px);
  transform-origin: top right;
  transition: opacity 0.22s, transform 0.22s cubic-bezier(0.4,0,0.2,1);
}
.dropdown-menu.open {
  opacity: 1;
  pointer-events: all;
  transform: scale(1) translateY(0);
}
.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  transition: background var(--transition);
}
.dropdown-menu a:hover { background: var(--bg3); }
.menu-divider { height: 1px; background: var(--border); margin: 6px 0; }
.lang-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text2);
}
.toggle-switch { position: relative; display: inline-block; width: 38px; height: 20px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.3s;
}
.slider::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}
input:checked + .slider { background: var(--accent2); }
input:checked + .slider::before { transform: translateX(18px); }

/* ===== HERO / FEATURED SLIDES ===== */
.hero-section {
  margin: 14px 14px 0;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  height: 190px;
  box-shadow: var(--card-shadow);
}
.hero-slides {
  display: flex;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.4,0,0.2,1);
}
.hero-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  background: linear-gradient(135deg, #1a2744 0%, #e8690a 100%);
  cursor: pointer;
}
.hero-slide-bg {
  position: absolute; inset: 0;
  object-fit: cover;
  width: 100%; height: 100%;
  opacity: 0.35;
}
.hero-slide-info { position: relative; z-index: 1; flex: 1; }
.hero-slide-tag {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  font-family: 'DM Sans', sans-serif;
  margin-bottom: 4px;
}
.hero-slide-title {
  font-family: 'Tiro Devanagari Hindi', serif;
  font-size: 22px;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 8px;
}
.hero-slide-btn {
  display: inline-block;
  background: rgba(255,255,255,0.22);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  font-family: 'DM Sans', sans-serif;
}
.hero-slide-cover {
  width: 80px; height: 110px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  background: rgba(255,255,255,0.2);
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
}
.hero-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}
.hero-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.3s;
}
.hero-dot.active {
  background: #fff;
  width: 18px;
  border-radius: 3px;
}

/* ===== CATEGORY TABS ===== */
.category-tabs {
  display: flex;
  gap: 6px;
  padding: 14px 14px 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg2);
  color: var(--tab-text);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  white-space: nowrap;
}
.tab.active {
  background: var(--tab-active);
  color: #fff;
  border-color: var(--tab-active);
}

/* ===== TAG FILTER ===== */
.tag-filter-wrap {
  display: flex;
  gap: 6px;
  padding: 6px 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tag-filter-wrap::-webkit-scrollbar { display: none; }
.tag-chip {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 12px;
  background: var(--tag-bg);
  color: var(--text2);
  font-size: 12px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all var(--transition);
}
.tag-chip.active {
  background: var(--tag-active);
  color: var(--tag-active-text);
}

/* ===== SECTION ===== */
.content-section { padding: 8px 14px 12px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title {
  font-family: 'Tiro Devanagari Hindi', serif;
  font-size: 18px;
  color: var(--text);
}
.random-btn {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text2);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.random-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== HORIZONTAL SCROLL CARDS ===== */
.cards-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.cards-scroll::-webkit-scrollbar { display: none; }

/* ===== GRID CARDS ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* ===== CARD ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform 0.22s, box-shadow 0.22s;
  position: relative;
  animation: fadeUp 0.4s ease both;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(0,0,0,0.16); }
.card-scroll { min-width: 140px; max-width: 140px; }
.card-cover {
  width: 100%;
  height: 130px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.card-scroll .card-cover { height: 100px; }
.card-body { padding: 10px; }
.card-category {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  font-family: 'DM Sans', sans-serif;
  margin-bottom: 3px;
}
.card-title {
  font-family: 'Tiro Devanagari Hindi', serif;
  font-size: 14px;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-scroll .card-title { font-size: 13px; }
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.card-read-time { font-size: 10px; color: var(--text2); font-family: 'DM Sans', sans-serif; }
.card-bookmark {
  font-size: 14px;
  opacity: 0.5;
}
.card-bookmark.saved { opacity: 1; }
.card-read-btn {
  display: block;
  width: 100%;
  background: var(--accent2);
  color: #fff;
  border: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 7px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition);
}
.card-read-btn:hover { background: var(--accent); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--modal-bg);
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
  padding-bottom: 40px;
}
.modal-overlay.open { transform: translateX(0); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  background: var(--modal-bg);
  z-index: 10;
  border-bottom: 1px solid var(--border);
}
.modal-back {
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 4px;
}
.modal-actions { display: flex; gap: 4px; }
.modal-actions .icon-btn { color: var(--text); }
.modal-body { padding: 20px 16px; }
.poem-cover-large {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  margin-bottom: 20px;
}
.poem-title-large {
  font-family: 'Tiro Devanagari Hindi', serif;
  font-size: 26px;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--text);
}
.poem-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.poem-meta-badge {
  background: var(--tag-bg);
  color: var(--text2);
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-family: 'DM Sans', sans-serif;
}
.poem-meta-badge.accent { background: var(--accent); color: #fff; }
.poem-divider { height: 1px; background: var(--border); margin: 16px 0; }
.poem-content {
  font-family: 'Tiro Devanagari Hindi', serif;
  font-size: 17px;
  line-height: 2;
  color: var(--text);
  white-space: pre-wrap;
}
.poem-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.poem-tag {
  background: var(--tag-bg);
  color: var(--text2);
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 11px;
  cursor: pointer;
}

/* ===== SHARE MODAL ===== */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.share-modal.open { opacity: 1; pointer-events: all; }
.share-content {
  background: var(--bg2);
  border-radius: 24px 24px 0 0;
  padding: 24px;
  width: 100%;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
.share-modal.open .share-content { transform: translateY(0); }
.share-content h3 { font-size: 16px; margin-bottom: 16px; color: var(--text); text-align: center; }
.share-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-btn {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  transition: opacity 0.2s;
}
.share-btn:hover { opacity: 0.85; }
.share-btn.whatsapp { background: #25D366; color: #fff; }
.share-btn.facebook { background: #1877F2; color: #fff; }
.share-btn.twitter { background: #1da1f2; color: #fff; }
.share-btn.copy { background: var(--bg3); color: var(--text); }
.share-close {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text2);
  font-family: inherit;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav-bg);
  border-top: 1px solid var(--nav-border);
  display: flex;
  align-items: center;
  padding: 8px 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--tab-text);
  transition: color var(--transition);
  font-family: inherit;
}
.nav-item.active { color: var(--accent2); }
[data-theme="dark"] .nav-item.active { color: var(--accent2); }
.nav-icon { font-size: 20px; }
.nav-label { font-size: 10px; font-family: 'DM Sans', sans-serif; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent2);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 999;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text2);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stagger card animations */
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.10s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.20s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.30s; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

