/* ============================================================
   ShriKirtan — style.css
   Mobile-first, supports Bootstrap 5 light/dark themes
   ============================================================ */

/* ── Override Bootstrap primary to saffron ──────────────────── */
:root {
  --bs-primary:             #b45309;
  --bs-primary-rgb:         180, 83, 9;
  --bs-link-color:          #b45309;
  --bs-link-hover-color:    #92400e;
}

[data-bs-theme="dark"] {
  --bs-primary:             #fbbf24;
  --bs-primary-rgb:         251, 191, 36;
  --bs-link-color:          #fbbf24;
  --bs-link-hover-color:    #f59e0b;
}

/* Bootstrap 5 btn-outline-primary uses compiled values, not --bs-primary,
   so we override the component variables manually */
.btn-outline-primary {
  --bs-btn-color:              #b45309;
  --bs-btn-border-color:       #b45309;
  --bs-btn-hover-color:        #fff;
  --bs-btn-hover-bg:           #b45309;
  --bs-btn-hover-border-color: #b45309;
  --bs-btn-active-color:       #fff;
  --bs-btn-active-bg:          #b45309;
  --bs-btn-active-border-color:#b45309;
  --bs-btn-disabled-color:     #b45309;
  --bs-btn-disabled-border-color: #b45309;
}

[data-bs-theme="dark"] .btn-outline-primary {
  --bs-btn-color:              #fbbf24;
  --bs-btn-border-color:       #fbbf24;
  --bs-btn-hover-color:        #1a0a00;
  --bs-btn-hover-bg:           #fbbf24;
  --bs-btn-hover-border-color: #fbbf24;
  --bs-btn-active-color:       #1a0a00;
  --bs-btn-active-bg:          #fbbf24;
  --bs-btn-active-border-color:#fbbf24;
  --bs-btn-disabled-color:     #fbbf24;
  --bs-btn-disabled-border-color: #fbbf24;
}

/* ── Google Fonts (loaded via <link> in base.html too) ──────── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Gujarati:wght@400;500;700&family=Nunito:wght@400;600;700&display=swap');

/* ── Design tokens ──────────────────────────────────────────── */
:root {
  --sk-primary:        #b45309;
  --sk-primary-light:  #fbbf24;
  --sk-navbar-bg:      #92400e;
  --sk-navbar-fg:      #fffbeb;
  --sk-font-body:      'Nunito', system-ui, -apple-system, sans-serif;
  --sk-font-gu:        'Noto Sans Gujarati', serif;
  --sk-content-bg:     var(--bs-body-bg);
  --sk-border:         var(--bs-border-color);
  --sk-radius:         0.5rem;
}

[data-bs-theme="dark"] {
  --sk-navbar-bg: #78350f;
}

/* ── Base ───────────────────────────────────────────────────── */
body {
  font-family: var(--sk-font-body);
  scroll-behavior: smooth;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.sk-navbar {
  background-color: var(--sk-navbar-bg) !important;
}
.sk-navbar .navbar-brand,
.sk-navbar .navbar-brand i {
  color: var(--sk-navbar-fg) !important;
  font-size: 1.2rem;
}

/* ── Font helpers ───────────────────────────────────────────── */
.gujarati-text {
  font-family: var(--sk-font-gu);
  line-height: 2;
  letter-spacing: 0.02em;
}

/* ── Home: compact list ──────────────────────────────────────── */
.sk-list {
  background: var(--bs-body-bg);
}
.sk-list-row {
  border-bottom: 1px solid var(--sk-border);
  color: var(--bs-body-color);
  transition: background 0.1s ease;
}
.sk-list-row:last-child {
  border-bottom: none;
}
.sk-list-row:hover,
.sk-list-row:focus-visible {
  background: var(--bs-tertiary-bg);
  outline: none;
}
.sk-list-row.sk-now-playing {
  background: rgba(34, 197, 94, 0.07);
  border-left: 3px solid #22c55e;
}
.sk-list-row.sk-now-playing:hover,
.sk-list-row.sk-now-playing:focus-visible {
  background: rgba(34, 197, 94, 0.13);
}

/* ── Now Playing dot ─────────────────────────────────────────── */
@keyframes sk-pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(1.5); }
}
.sk-np-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: sk-pulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
/* In list rows: hide dot unless row is now-playing */
.sk-list-row .sk-np-dot {
  display: none;
}
.sk-list-row.sk-now-playing .sk-np-dot {
  display: inline-block;
}

.sk-row-num {
  font-size: 0.75rem;
  min-width: 1.6rem;
  text-align: right;
}
.sk-row-gu {
  font-size: 1.05rem;
  line-height: 1.4;
}
.sk-row-en {
  font-size: 0.82rem;
  line-height: 1.3;
}

/* ── Home: bhajan cards (kept for possible reuse) ────────────── */
.card-hover {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.card-hover:hover,
.card-hover:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.bhajan-card:focus-visible .card {
  outline: 2px solid var(--sk-primary);
  outline-offset: 2px;
}

/* ── Hero title on home page ─────────────────────────────────── */
.sk-hero-title {
  font-family: var(--sk-font-gu);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 700;
  color: #92400e;
}
[data-bs-theme="dark"] .sk-hero-title {
  color: #fbbf24;
}

/* ── Controls bar below sticky navbar ───────────────────────── */
.sk-controls {
  background: var(--bs-body-bg);
  z-index: 99;
  /* sits right below the Bootstrap navbar (56 px default) */
  top: 56px;
}

/* ── Bhajan page: titles ─────────────────────────────────────── */
.sk-bhajan-title {
  font-size: clamp(1.4rem, 4.5vw, 2.2rem);
  line-height: 1.5;
  text-align: center;
}
.sk-bhajan-subtitle {
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 400;
  text-align: center;
}

/* ── Bhajan text blocks ──────────────────────────────────────── */
.sk-section-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}
.sk-text {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--sk-border);
  border-radius: var(--sk-radius);
  font-size: 1em;
  line-height: 2;
  text-align: center;
}
.sk-text.gujarati-text {
  font-size: 1.05em;
}
.english-text {
  color: var(--bs-secondary-color);
  font-size: 0.9em;
  line-height: 2;
  text-align: center;
}

/* ── QR code section ─────────────────────────────────────────── */
.sk-qr-section {
  opacity: 0.85;
}
.sk-qr-img {
  max-width: 180px;
  height: auto;
}

/* ── Admin content textarea ──────────────────────────────────── */
.sk-content-ta {
  font-family: var(--sk-font-gu), monospace;
  font-size: 1rem;
  line-height: 1.8;
  resize: vertical;
}

/* ── Footer ──────────────────────────────────────────────────── */
.sk-footer {
  background: var(--bs-body-bg);
}

/* ── Search highlight ────────────────────────────────────────── */
mark.sk-highlight {
  background: #fde68a;
  color: #78350f;
  border-radius: 2px;
  padding: 0 2px;
}
[data-bs-theme="dark"] mark.sk-highlight {
  background: #92400e;
  color: #fef3c7;
}

/* ── Responsive tweaks ───────────────────────────────────────── */
@media (max-width: 575.98px) {
  .sk-controls .btn-group label {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
  }

  .sk-float-bar {
    min-width: 170px;
    font-size: 0.85rem;
  }
}

/* ── Manager dashboard ───────────────────────────────────────── */

/* Horizontal-scroll chip bar — no wrapping */
.sk-chip-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}
.sk-chip-scroll::-webkit-scrollbar { display: none; }

/* Column widths — shared between header and rows */
.sk-toggle-col { width: 62px;  min-width: 62px; }

/* Column header bar */
.sk-manage-header {
  background: var(--bs-tertiary-bg);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .68rem;
  color: var(--bs-secondary-color);
}

/* Row styling */
.sk-manage-list .manage-row:last-child { border-bottom: none; }
.manage-row {
  transition: background .1s ease;
}
.manage-row.sk-row-hidden {
  opacity: .45;
  background: var(--bs-tertiary-bg);
}

/* Title typography */
.sk-row-gu-title {
  font-size: .98rem;
  line-height: 1.35;
}
.sk-row-en-title {
  font-size: .75rem;
  min-width: 0;
}
.sk-cat-badge { font-size: .62rem; }

/* ── Manager tab bar ─────────────────────────────────────────────────────── */
.sk-manage-page {
  padding-bottom: 96px; /* clear status strip + tab bar */
}

/* Status strip — thin bar above tab bar */
.sk-status-bar {
  position: fixed;
  bottom: 60px;
  left: 0;
  right: 0;
  background: var(--bs-tertiary-bg);
  border-top: 1px solid var(--bs-border-color);
  padding: 5px 0;
  z-index: 1029;
}
.sk-status-text {
  font-size: .74rem;
  white-space: nowrap;
  color: var(--bs-secondary-color);
}

/* Tab bar */
.sk-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bs-body-bg);
  border-top: 1px solid var(--bs-border-color);
  display: flex;
  align-items: stretch;
  z-index: 1030;
  box-shadow: 0 -2px 10px rgba(0,0,0,.07);
}
.sk-tabbar-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--bs-secondary-color);
  font-size: .6rem;
  line-height: 1;
  cursor: pointer;
  padding: 6px 4px;
  text-decoration: none;
  transition: color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.sk-tabbar-btn i {
  font-size: 1.3rem;
  line-height: 1;
}
.sk-tabbar-btn:active {
  background: var(--bs-tertiary-bg);
  color: var(--bs-primary);
}
.sk-tabbar-btn:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: -2px;
}
.sk-tabbar-logout {
  color: var(--bs-danger) !important;
}
.sk-tabbar-logout:active {
  color: var(--bs-danger) !important;
}

/* ── Public tab bar (home + bhajan pages) ────────────────────── */
body.sk-has-pub-tabbar {
  padding-bottom: 60px;
}
.sk-pub-tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: var(--bs-body-bg);
  border-top: 1px solid var(--bs-border-color);
  display: flex;
  align-items: stretch;
  z-index: 1030;
  box-shadow: 0 -2px 10px rgba(0,0,0,.07);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.sk-pub-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--bs-secondary-color);
  font-size: .6rem;
  line-height: 1;
  cursor: pointer;
  padding: 6px 4px;
  text-decoration: none;
  transition: color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.sk-pub-tab i {
  font-size: 1.3rem;
  line-height: 1;
}
.sk-pub-tab:active {
  background: var(--bs-tertiary-bg);
  color: var(--bs-primary);
}
.sk-pub-tab.sk-tab-active {
  color: var(--bs-primary) !important;
}
/* Language/font state — home list */
body.sk-lang-gu .sk-row-en  { display: none !important; }
body.sk-lang-en .sk-row-gu  { display: none !important; }
/* Language/font state — bhajan page */
body.sk-lang-gu #sectionEn,
body.sk-lang-gu #titleEn    { display: none !important; }
body.sk-lang-en #sectionGu,
body.sk-lang-en #titleGu    { display: none !important; }


