/* ── TamilPrayers.com — Main Stylesheet ──────────────────────── */
/* Mobile-first. Breakpoint: 768px desktop */

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

:root {
  --purple:     #7C3AED;
  --purple-dk:  #5B21B6;
  --purple-lt:  #EDE9FE;
  --purple-mid: #A78BFA;
  --gold:       #F59E0B;
  --text:       #1F1F1F;
  --text-mid:   #4B5563;
  --text-lt:    #6B7280;
  --bg:         #FAFAFA;
  --bg-card:    #FFFFFF;
  --border:     #E5E7EB;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 1px 4px rgba(0,0,0,0.08);
  --header-h:   56px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.tamil-text, .tamil-input {
  font-family: 'Noto Sans Tamil', 'Inter', sans-serif;
}

.monospace { font-family: 'Courier New', Courier, monospace; letter-spacing: 0.04em; }

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

/* ── HEADER ─────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--purple);
  height: var(--header-h);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 0 16px;
  max-width: 960px;
  margin: 0 auto;
}
.menu-btn {
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px;
  display: flex; flex-direction: column;
  justify-content: center; gap: 5px; padding: 4px;
}
.menu-btn span {
  display: block; height: 2px;
  background: #fff; border-radius: 2px; transition: all .2s;
}
.site-logo {
  display: flex; align-items: center; gap: 8px;
  color: #fff; font-weight: 600; font-size: 1.1rem;
  text-decoration: none; flex: 1;
}
.logo-cross { font-size: 1.3rem; }
.quick-goto select {
  background: rgba(255,255,255,0.15);
  color: #fff; border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  padding: 6px 10px; font-size: 13px;
  max-width: 160px; cursor: pointer;
}
.quick-goto select option { background: var(--purple-dk); color: #fff; }

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 200;
}
.overlay.open { display: block; }

.sidebar {
  position: fixed; top: 0; left: -300px; width: 290px;
  height: 100dvh; background: var(--bg-card);
  border-right: 1px solid var(--border);
  z-index: 201; transition: left .25s ease;
  overflow-y: auto; padding-bottom: 2rem;
}
.sidebar.open { left: 0; }

.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  background: var(--purple); color: #fff;
  padding: 16px; font-weight: 600; font-size: 1rem;
}
.close-btn {
  margin-left: auto; background: none; border: none;
  color: #fff; font-size: 1.1rem; cursor: pointer;
}
.nav-links { list-style: none; padding: 8px 0; }
.nav-links a {
  display: block; padding: 12px 20px;
  color: var(--text); font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.nav-links a:hover { background: var(--purple-lt); text-decoration: none; }

.sidebar-section { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.sidebar-heading { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-lt); margin-bottom: 10px; }
.sidebar-verse { background: var(--purple-lt); border-radius: var(--radius-sm); padding: 12px; }
.verse-ref { font-weight: 600; color: var(--purple); font-size: 0.85rem; margin-bottom: 6px; }
.verse-text { font-size: 0.9rem; line-height: 1.7; font-family: 'Noto Sans Tamil', sans-serif; }
.sidebar-prayer p { font-size: 0.85rem; color: var(--text-mid); line-height: 1.7;
  font-family: 'Noto Sans Tamil', sans-serif; }
.read-more { font-size: 0.8rem; color: var(--purple); }
.category-list { list-style: none; }
.category-list a { display: block; padding: 6px 0; font-size: 0.9rem;
  color: var(--text-mid); border-bottom: 1px solid var(--border); }
.category-list a:hover { color: var(--purple); }

/* ── MAIN CONTENT ───────────────────────────────────────────── */
.main-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 40px;
  min-height: calc(100dvh - var(--header-h) - 80px);
}

/* ── HOME PAGE ──────────────────────────────────────────────── */
.hero-section {
  text-align: center;
  padding: 36px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.hero-title { font-size: 1.6rem; font-weight: 700; color: var(--purple-dk); }
.hero-sub   { font-size: 1rem; color: var(--text-mid);
  font-family: 'Noto Sans Tamil', sans-serif; margin: 4px 0 20px; }
.hero-search { position: relative; max-width: 420px; margin: 0 auto 16px; }
.hero-search input {
  width: 100%; padding: 12px 16px; font-size: 1rem;
  border: 2px solid var(--border); border-radius: 999px;
  outline: none; transition: border-color .2s;
}
.hero-search input:focus { border-color: var(--purple); }
.search-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  z-index: 50; overflow: hidden;
}
.sdrop-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; gap: 10px; color: var(--text);
  border-bottom: 1px solid var(--border); font-size: 0.9rem;
}
.sdrop-item:hover { background: var(--purple-lt); text-decoration: none; }
.sdrop-tamil { font-family: 'Noto Sans Tamil', sans-serif; color: var(--text-mid); font-size: 0.85rem; }

.btn-primary {
  display: inline-block;
  background: var(--purple); color: #fff;
  padding: 10px 24px; border-radius: 999px;
  font-weight: 500; font-size: 0.95rem;
  border: none; cursor: pointer; transition: background .15s;
}
.btn-primary:hover { background: var(--purple-dk); text-decoration: none; }

.home-section { margin-bottom: 24px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.view-all-link { font-size: 0.9rem; color: var(--purple); }

.section-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow);
}
.section-card .section-title { margin-bottom: 12px; }
.verse-card { border-left: 4px solid var(--gold); }
.prayer-card { border-left: 4px solid var(--purple); }
.verse-reference { font-weight: 700; color: var(--gold); margin-bottom: 8px; font-size: 0.9rem; }
.verse-body {
  font-size: 1.05rem; line-height: 1.9;
  border-left: 3px solid var(--border); padding-left: 14px;
  margin: 0; color: var(--text);
}
.verse-tanglish { margin-top: 10px; font-size: 0.88rem; color: var(--text-mid); }

/* Prayer mini tabs */
.prayer-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.ptab {
  padding: 5px 14px; border: 1px solid var(--border);
  border-radius: 999px; background: none; cursor: pointer;
  font-size: 0.85rem; color: var(--text-mid);
}
.ptab.active { background: var(--purple); color: #fff; border-color: var(--purple); }
.prayer-body { font-size: 0.95rem; line-height: 2; color: var(--text); }

/* Songs grid */
.songs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.song-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.song-card:hover { border-color: var(--purple-mid); box-shadow: 0 2px 8px rgba(124,58,237,0.12); text-decoration: none; }
.song-icon { font-size: 1.4rem; }
.song-title-main { font-size: 0.92rem; font-weight: 500; }
.song-title-tamil { font-size: 0.85rem; color: var(--text-mid); }
.song-category { font-size: 0.72rem; background: var(--purple-lt); color: var(--purple);
  padding: 2px 8px; border-radius: 999px; display: inline-block; margin-top: 4px; }
.empty-msg { color: var(--text-lt); font-size: 0.9rem; }

/* ── SONGS LISTING PAGE ─────────────────────────────────────── */
.page-header { padding: 24px 0 12px; display: flex; align-items: center; justify-content: space-between; }
.page-title { font-size: 1.4rem; font-weight: 700; font-family: 'Noto Sans Tamil', sans-serif; }
.song-count { font-size: 0.85rem; color: var(--text-lt); background: var(--border);
  padding: 3px 10px; border-radius: 999px; }

.filter-bar { margin-bottom: 14px; }
.filter-form { display: flex; gap: 8px; flex-wrap: wrap; }
.search-field { position: relative; flex: 1; min-width: 180px; }
.search-field input {
  width: 100%; padding: 10px 36px 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.95rem; outline: none;
}
.search-field input:focus { border-color: var(--purple); }
.clear-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-lt); font-size: 0.9rem; }
.filter-form select {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.9rem; background: var(--bg-card); min-width: 140px;
}
.btn-search { padding: 10px 18px; background: var(--purple); color: #fff;
  border: none; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.9rem; }

.category-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { padding: 5px 14px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 0.82rem; color: var(--text-mid); transition: all .15s; }
.chip.active, .chip:hover { background: var(--purple); color: #fff; border-color: var(--purple); text-decoration: none; }

.song-list { list-style: none; }
.song-list-item { border-bottom: 1px solid var(--border); }
.song-list-link {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 8px; color: var(--text); transition: background .1s;
}
.song-list-link:hover { background: var(--purple-lt); text-decoration: none; }
.song-num { min-width: 36px; text-align: center; font-size: 0.8rem;
  color: var(--text-lt); font-weight: 600; }
.song-list-info { flex: 1; }
.sli-tanglish { font-size: 0.95rem; font-weight: 500; }
.sli-tamil { font-size: 0.85rem; color: var(--text-mid); }
.sli-category { font-size: 0.72rem; background: var(--purple-lt); color: var(--purple);
  padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.sli-arrow { color: var(--text-lt); font-size: 1.2rem; margin-left: 4px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 24px 0; }
.page-btn { padding: 8px 20px; border: 1px solid var(--purple); color: var(--purple);
  border-radius: var(--radius-sm); font-size: 0.9rem; }
.page-btn:hover { background: var(--purple-lt); }
.page-info { font-size: 0.9rem; color: var(--text-mid); }

/* ── SINGLE SONG PAGE ───────────────────────────────────────── */
.back-link { display: block; margin: 16px 0 8px; }
.back-link a { color: var(--purple); font-size: 0.9rem; }
.song-hero { text-align: center; padding: 10px 0 20px; }
.song-number-badge { display: inline-block; background: var(--gold);
  color: #fff; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; margin-bottom: 8px; }
.song-title-tanglish { font-size: 1.5rem; font-weight: 700; color: var(--purple-dk); }
.song-title-tamil { font-size: 1.1rem; color: var(--text-mid);
  font-family: 'Noto Sans Tamil', sans-serif; margin: 4px 0 10px; }
.song-cat-badge { background: var(--purple-lt); color: var(--purple);
  padding: 3px 12px; border-radius: 999px; font-size: 0.8rem; }

/* Tabs */
.tabs-container { background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.tab-nav { display: flex; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab-btn {
  flex: 1; min-width: 90px; padding: 14px 10px;
  background: none; border: none; cursor: pointer;
  font-size: 0.9rem; color: var(--text-mid); font-weight: 500;
  border-bottom: 3px solid transparent; transition: all .15s;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tab-btn .tab-icon { font-size: 1.1rem; }
.tab-btn.active { color: var(--purple); border-bottom-color: var(--purple); }
.tab-btn:hover { background: var(--purple-lt); }
.tab-panel { padding: 0; }
.tab-panel.active { display: block; }

.tab-toolbar { display: flex; gap: 8px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); background: var(--bg); }
.tool-btn { padding: 4px 12px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg-card); cursor: pointer; font-size: 0.82rem; }
.tool-btn:hover { background: var(--purple-lt); border-color: var(--purple); color: var(--purple); }

.lyrics-content {
  padding: 20px; font-size: 18px; line-height: 2.1;
  white-space: pre-wrap; color: var(--text); min-height: 200px;
  transition: font-size .1s;
}
.tanglish-text { font-size: 17px; }
.notes-text { font-size: 16px; line-height: 2.2; }
.no-content { color: var(--text-lt); font-size: 0.9rem; font-style: italic; }

.notes-legend {
  display: flex; gap: 10px; padding: 10px 16px; flex-wrap: wrap;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.notes-legend span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--purple); color: #fff; font-weight: 600; font-size: 0.85rem;
}
.notes-legend .legend-sep, .notes-legend .legend-bar, .notes-legend .legend-dash, .notes-legend .legend-hold {
  background: var(--border); color: var(--text-mid); font-weight: 400; font-size: 0.8rem;
  width: auto; padding: 0 8px;
}

/* Prev / Next nav */
.song-nav {
  display: flex; justify-content: space-between; gap: 12px;
  margin-bottom: 24px;
}
.snav-btn {
  flex: 1; max-width: 48%;
  padding: 12px 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-mid); font-size: 0.85rem;
  background: var(--bg-card); transition: all .15s;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.snav-btn:hover { border-color: var(--purple); color: var(--purple); text-decoration: none; }
.snav-next { text-align: right; }

/* ── FOOTER ─────────────────────────────────────────────────── */
.site-footer { background: var(--purple-dk); color: rgba(255,255,255,0.8);
  padding: 28px 16px; text-align: center; }
.footer-logo { font-size: 1.1rem; font-weight: 700; color: #fff; margin-bottom: 4px; }
.footer-tagline { font-family: 'Noto Sans Tamil', sans-serif; font-size: 0.9rem; margin-bottom: 16px; }
.footer-links { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
.footer-links a { color: rgba(255,255,255,0.7); font-size: 0.85rem; }
.footer-links a:hover { color: #fff; }
.footer-copy { font-size: 0.78rem; color: rgba(255,255,255,0.5); }

/* ── UTILITY ────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px; color: var(--text-lt); }
.empty-state p { margin-bottom: 16px; }

/* ── DESKTOP ────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .main-content { padding: 0 24px 60px; }
  .sidebar { left: 0; position: static; height: auto;
    width: 260px; float: left; border-right: 1px solid var(--border); }
  /* On desktop sidebar is always visible if you want — 
     or remove float and keep as slide-in only */
  .hero-title { font-size: 2rem; }
  .songs-grid { grid-template-columns: repeat(3, 1fr); }
  .song-title-tanglish { font-size: 1.8rem; }
}
