/* style.css — Hymns page for vincentchiu.com */

:root {
  --primary: #1a237e;
  --accent: #1565c0;
  --purple: #7c3aed;
  --pink: #ec4899;
  --teal: #0891b2;
  --green: #10b981;
  --bg: #f0f2ff;
  --card-bg: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --border: #d2d2d7;
  --nav-height: 64px;
  --radius: 20px;
  --shadow: 0 4px 24px rgba(124, 58, 237, 0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Nav ─── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(135deg, #0d1057 0%, #1a237e 50%, #4a1d96 100%);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  height: var(--nav-height);
  display: flex; align-items: center;
  box-shadow: 0 4px 20px rgba(13,16,87,0.4);
}
.nav-container {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: center;
  width: 100%; gap: 16px;
}
.nav-links { display: flex; gap: 4px; list-style: none; flex-wrap: wrap; }
.nav-links a {
  color: rgba(255,255,255,0.8); text-decoration: none;
  font-size: 14px; font-weight: 500; padding: 7px 14px;
  border-radius: 8px; transition: all 0.25s ease; white-space: nowrap;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.18); transform: translateY(-1px); }
.nav-links a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(124,58,237,0.6), rgba(236,72,153,0.4));
  box-shadow: 0 2px 12px rgba(124,58,237,0.3);
}

/* ─── Page Header ─── */
.page-header {
  background: linear-gradient(-45deg, #1a237e, #4a1d96, #7c3aed, #1565c0);
  background-size: 300% 300%;
  animation: gradientShift 8s ease infinite;
  color: #fff; padding: 56px 24px 48px;
  text-align: center; position: relative; overflow: hidden;
}
.page-header h1 {
  font-size: 38px; font-weight: 800; letter-spacing: -0.8px;
  margin-bottom: 8px; animation: fadeInUp 0.6s ease both;
}
.page-header p {
  color: rgba(255,255,255,0.85); font-size: 16px;
  animation: fadeInUp 0.6s ease 0.1s both;
  max-width: 700px; margin: 6px auto 0;
}
.page-header .bible-verse {
  font-size: 14px; color: rgba(255,255,255,0.72);
  font-style: italic; max-width: 800px; margin: 16px auto 0;
  line-height: 1.7;
  animation: fadeInUp 0.6s ease 0.2s both;
}

/* ─── Container ─── */
.container { max-width: 100%; margin: 0; padding: 0 32px; }

/* ─── Section Card ─── */
.section-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 36px;
  margin: 40px 0;
  border: 1px solid rgba(124,58,237,0.08);
  animation: fadeInUp 0.6s ease both;
}
.section-card h2 {
  font-size: 22px; font-weight: 700; color: var(--primary);
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 2px solid rgba(124,58,237,0.12);
}

/* ─── Bible verse banner ─── */
.verse-banner {
  background: linear-gradient(135deg, rgba(124,58,237,0.06), rgba(8,145,178,0.06));
  border-left: 4px solid var(--purple);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 28px;
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.75;
}
.verse-banner strong { color: var(--primary); font-style: normal; }

/* ─── App promo banner ─── */
.app-banner {
  background: linear-gradient(135deg, rgba(21,101,192,0.06), rgba(124,58,237,0.06));
  border: 1px solid rgba(21,101,192,0.2);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 28px;
  font-size: 14px;
  text-align: center;
}
.app-banner a { color: var(--accent); font-weight: 600; text-decoration: none; }
.app-banner a:hover { text-decoration: underline; }

/* ─── Hymns Table ─── */
.hymns-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.hymns-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
.hymns-table thead tr {
  background: linear-gradient(135deg, #1a237e, #4a1d96);
  color: #fff;
}
.hymns-table thead th {
  padding: 12px 16px; text-align: center;
  font-size: 13px; font-weight: 600; letter-spacing: 0.3px;
}
.hymns-table tbody tr {
  border-bottom: 1px solid rgba(210,210,215,0.5);
  transition: background 0.15s ease;
}
.hymns-table tbody tr:last-child { border-bottom: none; }
.hymns-table tbody tr:hover { background: rgba(124,58,237,0.04); }
.hymns-table tbody tr:nth-child(even) { background: rgba(240,242,255,0.5); }
.hymns-table tbody tr:nth-child(even):hover { background: rgba(124,58,237,0.06); }
.hymns-table td { padding: 12px 16px; vertical-align: top; }

.hymn-num {
  color: var(--text-secondary); font-size: 12px;
  font-weight: 600; width: 36px; min-width: 36px;
  padding-top: 14px !important;
}
.hymn-title-cell {
  font-weight: 700; color: var(--primary);
  font-size: 15px; width: 200px; min-width: 160px;
}
.hymn-title-cell .hymn-title-en {
  display: block; font-size: 11px; font-weight: 500;
  color: var(--text-secondary); margin-top: 3px;
}
.hymn-desc {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.65;
}
/* Now Playing highlight */
tr.now-playing-row {
  background: linear-gradient(90deg, rgba(124,58,237,0.08), rgba(6,182,212,0.08));
  transition: background 0.4s;
}
.now-playing-label {
  color: #e11d48 !important;
  font-weight: 900 !important;
  font-size: 14px !important;
}
.now-playing-label::before {
  content: '▶ ';
  animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.hymn-desc details {
  margin-top: 8px;
}
.hymn-desc details summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--purple);
  list-style: none;
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--purple);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
.hymn-desc details summary::-webkit-details-marker { display: none; }
.hymn-desc details[open] summary {
  background: var(--purple);
  color: #fff;
}
.hymn-lyrics {
  text-align: center;
  margin-top: 10px;
  line-height: 1.9;
}
.hymn-links {
  min-width: 380px;
  width: 420px;
}
.hymn-links a {
  display: block; margin-bottom: 5px;
  font-size: 13px; font-weight: 500;
  color: var(--accent); text-decoration: none;
  padding: 3px 0;
  transition: color 0.2s;
}
.hymn-links a:last-child { margin-bottom: 0; }
.hymn-links a:hover { color: var(--purple); text-decoration: underline; }
.hymn-links .no-link { display: block; color: var(--text-secondary); font-size: 13px; white-space: nowrap; }
.hymn-links .no-link a { display: inline; }
.pdf-icon { vertical-align: middle; }
.audio-label {
  display: block;
  font-size: 12px; font-weight: 500;
  color: var(--accent);
  margin-bottom: 2px;
  margin-top: 6px;
}
.hymn-links audio {
  display: block;
  width: 100%;
  height: 36px;
  margin-bottom: 8px;
}

/* ─── Search bar ─── */
.hymn-search-bar {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1.5px solid var(--purple);
  border-radius: 999px; padding: 8px 16px;
  margin-bottom: 14px; box-shadow: var(--shadow);
  max-width: 480px; transition: box-shadow 0.2s;
}
.hymn-search-bar:focus-within {
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15), var(--shadow);
}
.hymn-search-bar input {
  border: none; outline: none; flex: 1;
  font-size: 14px; background: transparent; color: var(--text);
}
.hymn-search-bar input::placeholder { color: var(--text-secondary); }
#hymnSearchClear {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); font-size: 14px;
  padding: 0; line-height: 1; display: none;
}
#hymnSearchClear:hover { color: var(--purple); }
#hymnSearchStatus {
  font-size: 12px; color: var(--text-secondary);
  margin-bottom: 8px; min-height: 18px; padding-left: 4px;
}

/* ─── Footer ─── */
footer {
  background: #0d1057; color: rgba(255,255,255,0.7);
  text-align: center; padding: 32px 24px;
  font-size: 14px; margin-top: 64px;
}
footer a { color: rgba(255,255,255,0.9); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .page-header h1 { font-size: 26px; }
  .container { padding: 0 8px; }
  .section-card { padding: 20px 8px; margin: 24px 0; }
  .hymns-table { font-size: 12px; min-width: 820px; }
  .hymn-title-cell { width: 140px; min-width: 120px; }
  .hymn-links { min-width: 280px; width: 300px; }
  .hymn-links audio { width: 100%; }
}

/* ─── Mobile card layout (≤640px) ─── */
@media (max-width: 640px) {
  /* Override the 768px wide-table rule */
  .hymns-table-wrapper { overflow-x: visible; }
  .hymns-table { min-width: 0 !important; font-size: 13px; }
  /* Reflow table → block cards */
  .hymns-table thead { display: none; }
  .hymns-table tbody, .hymns-table tr { display: block; }
  .hymns-table tr {
    border: 1px solid var(--border); border-radius: 14px;
    margin-bottom: 14px; padding: 12px 14px 10px;
    background: var(--card-bg); box-shadow: var(--shadow);
  }
  .hymns-table td {
    display: block; padding: 3px 0; border: none;
    width: auto !important; min-width: 0 !important;
  }
  /* Number chip + title on same line */
  .hymn-num {
    display: inline; font-size: 12px; font-weight: 700;
    color: var(--purple); background: rgba(124,58,237,0.08);
    border-radius: 999px; padding: 1px 7px; margin-right: 6px;
  }
  .hymn-title-cell {
    display: inline; font-size: 15px; font-weight: 700;
    color: var(--text); width: auto !important; min-width: 0 !important;
  }
  .hymn-title-cell img { display: none; }
  /* Description */
  .hymn-desc { font-size: 12px; color: var(--text-secondary); padding-top: 6px; line-height: 1.6; }
  /* Audio area */
  .hymn-links { width: 100% !important; min-width: 0 !important; padding-top: 6px; }
  .hymn-links audio { width: 100%; height: 34px; margin-bottom: 6px; }
  /* Now-playing card highlight */
  tr.now-playing-row {
    background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(6,182,212,0.08)) !important;
    border-color: rgba(124,58,237,0.3) !important;
  }
  /* Search bar full width */
  .hymn-search-bar { max-width: 100%; }
}
