/* ==========================================================================
   Song Search Studio - Modern PWA Dark Theme
   Mobile-First, Glassmorphic, Optimized for iOS & Android
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Kantumruy+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-main: #070A11;
  --bg-surface: #0E1526;
  --bg-card: #131E35;
  --bg-card-hover: #192745;
  --bg-elevated: #1C2B4C;
  --border-subtle: #1E293B;
  --border-card: rgba(56, 189, 248, 0.15);
  --border-glow: rgba(56, 189, 248, 0.4);

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --accent-cyan: #38BDF8;
  --accent-blue: #2563EB;
  --accent-emerald: #10B981;
  --accent-purple: #A855F7;
  --accent-amber: #F59E0B;
  --accent-rose: #F43F5E;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.25);

  --font-km: 'Kantumruy Pro', 'Khmer OS Battambang', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-en: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;

  --bottom-nav-height: 64px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-km);
  font-size: 14.5px;
  line-height: 1.6;
  overflow-x: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
  position: relative;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 21, 38, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.brand-wrapper:hover {
  opacity: 0.9;
}

.brand-wrapper:active {
  transform: scale(0.97);
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.2px;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 400;
  color: var(--accent-cyan);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-header {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-header:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  color: #FFFFFF;
}

.btn-install-pwa {
  background: linear-gradient(135deg, #2563EB, #06B6D4);
  color: #FFFFFF;
  border: none;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.35);
  animation: pulse-glow 2.5s infinite;
}

#btnAdminModal {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #FCD34D;
}

#btnAdminModal:hover {
  background: rgba(245, 158, 11, 0.3);
  border-color: #F59E0B;
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(6, 182, 212, 0.3); }
  50% { box-shadow: 0 0 18px rgba(6, 182, 212, 0.6); }
}

/* Search Bar Container */
.search-section {
  padding: 14px 16px 8px 16px;
}

.search-box-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1.5px solid #2563EB;
  border-radius: var(--radius-lg);
  padding: 4px 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.search-box-wrapper:focus-within {
  border-color: var(--accent-cyan);
  background: var(--bg-card-hover);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

.search-icon {
  font-size: 18px;
  color: var(--accent-cyan);
  margin-right: 8px;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #FFFFFF;
  font-family: var(--font-km);
  font-size: 15px;
  font-weight: 500;
  padding: 8px 0;
}

.search-input::placeholder {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 13.5px;
}

.btn-clear-search {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  display: none;
}

.btn-clear-search:hover {
  color: #FFFFFF;
}

/* Categories Bar (Horizontal Pills) */
.categories-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.categories-bar::-webkit-scrollbar {
  display: none;
}

.category-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.category-pill:hover {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: #334155;
}

.category-pill.active {
  background: var(--accent-blue);
  color: #FFFFFF;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.4);
}

.category-pill.cat-fellowship.active {
  background: #059669;
  border-color: #34D399;
}

.category-pill.cat-purple-book.active {
  background: #7C3AED;
  border-color: #C084FC;
}

.category-pill.cat-purple.active {
  background: #D97706;
  border-color: #FCD34D;
}

.category-pill.cat-kora.active {
  background: #0891B2;
  border-color: #67E8F9;
}

.category-pill.cat-selected.active {
  background: linear-gradient(135deg, #059669, #10B981);
  border-color: #6EE7B7;
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

/* Results Status Bar */
.results-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 18px 8px 18px;
  font-size: 12px;
  color: var(--text-dim);
}

.song-count-highlight {
  color: var(--accent-cyan);
  font-weight: 700;
}

/* Song Results List */
.song-list-container {
  padding: 4px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.song-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  contain: content;
  content-visibility: auto;
  contain-intrinsic-size: 72px;
  transition: background 0.15s ease, border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}

.song-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.song-card:active {
  transform: scale(0.99);
}

.song-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.song-number-badge {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--accent-amber);
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 13px;
  min-width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.song-meta-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.song-title-text {
  font-size: 14.5px;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-subtitle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

.tag-pdf {
  background: rgba(239, 68, 68, 0.2);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.tag-pdf:hover {
  background: rgba(239, 68, 68, 0.38);
  border-color: #ef4444;
  color: #fff;
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.tag-pdf:active {
  transform: scale(0.96);
}

.tag-chord {
  background: rgba(16, 185, 129, 0.2);
  color: #6EE7B7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.tag-listen {
  background: rgba(14, 165, 233, 0.18);
  color: #7DD3FC;
  border: 1px solid rgba(14, 165, 233, 0.45);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  outline: none;
  flex-shrink: 0;
}

.tag-listen:hover {
  background: rgba(14, 165, 233, 0.35);
  border-color: #38BDF8;
  color: #FFFFFF;
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
}

.tag-listen:active {
  transform: scale(0.96);
}

.tag-select {
  background: rgba(59, 130, 246, 0.15);
  color: #93C5FD;
  border: 1px solid rgba(59, 130, 246, 0.45);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  outline: none;
}

.tag-select:hover {
  background: rgba(59, 130, 246, 0.35);
  border-color: #60A5FA;
  color: #FFFFFF;
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.tag-select:active {
  transform: scale(0.96);
}

.tag-select.is-selected {
  background: rgba(16, 185, 129, 0.25);
  color: #6EE7B7;
  border-color: rgba(16, 185, 129, 0.65);
}

.tag-select.is-selected:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #FCA5A5;
  border-color: #EF4444;
}

.tag-key {
  background: rgba(245, 158, 11, 0.2);
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-family: var(--font-en);
}

.song-card-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-delete-selected {
  background: rgba(239, 68, 68, 0.16);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-delete-selected:hover {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #DC2626;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.45);
  transform: translateY(-1px);
}

.btn-delete-selected:active {
  transform: scale(0.95);
}

.btn-clear-all-selected {
  background: rgba(239, 68, 68, 0.15);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.18s ease;
}

.btn-clear-all-selected:hover {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #DC2626;
}

.btn-modal-select {
  background: rgba(59, 130, 246, 0.15);
  color: #93C5FD;
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 5px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-modal-select:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: #60A5FA;
  color: #FFFFFF;
}

.btn-modal-select.is-selected {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.35), rgba(5, 150, 105, 0.45));
  color: #6EE7B7;
  border-color: #10B981;
}

/* Modal Live Setlist Navigation Player Bar */
.modal-setlist-nav-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(11, 16, 29, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 30;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.nav-player-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: #FFFFFF;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.nav-player-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.nav-player-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.nav-player-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.nav-player-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 140px;
  transition: all 0.2s ease;
}

.nav-player-info:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.45);
}

.nav-player-main-text {
  font-size: 12.5px;
  font-weight: 700;
  color: #FCD34D;
}

.nav-player-sub-text {
  font-size: 10.5px;
  color: var(--accent-cyan);
}

/* Quick Setlist Drawer Inside Modal */
.setlist-quick-drawer {
  position: absolute;
  bottom: 60px;
  left: 12px;
  right: 12px;
  max-width: 480px;
  margin: 0 auto;
  max-height: 55vh;
  background: #0f172a;
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  z-index: 45;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slide-up 0.18s ease-out;
}

.setlist-drawer-header {
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 13px;
  color: #93C5FD;
}

.setlist-quick-items {
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(55vh - 45px);
}

.setlist-drawer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.15s ease;
}

.setlist-drawer-item:hover {
  background: rgba(59, 130, 246, 0.22);
}

.setlist-drawer-item.active {
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.setlist-item-num {
  font-size: 11px;
  font-weight: 800;
  color: #FCD34D;
  background: rgba(245, 158, 11, 0.15);
  border-radius: 4px;
  padding: 2px 6px;
  min-width: 22px;
  text-align: center;
}

.setlist-item-info {
  flex: 1;
  min-width: 0;
}

.setlist-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setlist-item-meta {
  font-size: 11px;
  color: var(--text-dim);
}

.setlist-item-active-dot {
  color: #10B981;
  font-size: 12px;
  font-weight: bold;
}

.btn-star {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.btn-star.starred {
  color: var(--accent-amber);
  transform: scale(1.15);
}

.btn-star.needs-repair {
  color: #EF4444 !important;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.75);
  animation: pulseRedStar 2s infinite ease-in-out;
}

.btn-star.needs-repair.starred {
  color: #F87171 !important;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.7), 0 0 6px #EF4444;
}

.btn-star.needs-repair:hover {
  transform: scale(1.3) !important;
}

@keyframes pulseRedStar {
  0%, 100% {
    transform: scale(1.1);
    opacity: 0.95;
    filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.5));
  }
  50% {
    transform: scale(1.28);
    opacity: 1;
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.9));
  }
}

.tag-broken-lines {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #FCA5A5 !important;
  border: 1px solid rgba(239, 68, 68, 0.55) !important;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.tag-broken-lines:hover {
  background: rgba(239, 68, 68, 0.4) !important;
  color: #FFFFFF !important;
  border-color: #EF4444 !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
  transform: translateY(-1px);
}

.btn-filter-broken {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #FCA5A5;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-filter-broken:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.btn-filter-broken.active {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #EF4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

/* Empty State / Loading State */
.state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.state-icon {
  font-size: 42px;
  margin-bottom: 12px;
  opacity: 0.8;
}

.state-title {
  font-size: 16px;
  font-weight: 600;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.state-desc {
  font-size: 13px;
  color: var(--text-dim);
  max-width: 320px;
}

/* Song Detail View (Modal / Full-Screen Sheet) */
.song-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-main);
  z-index: 100;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.song-modal.active {
  display: flex;
  animation: slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Modal Header Bar */
.modal-header {
  position: sticky;
  top: 0;
  background: rgba(14, 21, 38, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 20;
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.btn-modal-back {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: #FFFFFF;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-song-title-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.modal-title-main {
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-title-sub {
  font-size: 11.5px;
  color: var(--accent-cyan);
}

/* Modal Toolbar (Transpose, Chords Toggle, Font Size, Sheet) */
.modal-toolbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.toolbar-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.toolbar-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
}

.toolbar-btn.active {
  background: var(--accent-blue);
  color: #FFFFFF;
  border-color: var(--accent-cyan);
}

.toolbar-btn-sheet {
  background: linear-gradient(135deg, #059669, #10B981);
  color: #FFFFFF;
  border: none;
  font-weight: 700;
}

.key-badge-display {
  background: rgba(245, 158, 11, 0.2);
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-family: var(--font-en);
  font-size: 12px;
}

/* Lyrics Content Area */
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px 80px 18px;
  user-select: text;
}

.song-card-header-view {
  background: linear-gradient(135deg, #1E1B4B, #0F172A);
  border: 1px solid #312E81;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 20px;
}

.song-header-title {
  font-size: 17px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.song-header-meta {
  font-size: 12.5px;
  color: #A5B4FC;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Lyrics Styling with Chord Badges */
.lyrics-container {
  font-size: 15px;
  line-height: 1.85;
  color: #F8FAFC;
}

.line-space {
  height: 16px;
}

.section-badge {
  display: inline-block;
  background: #312E81;
  color: #E0E7FF;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  margin-bottom: 4px;
}

/* Chord-Over-Lyrics Style (សៀវភៅមេត្រីភាព & Bracketed Chords) */
.chord-pro-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-top: 8px;
  margin-bottom: 12px;
  line-height: 1.6;
}

.chord-pair {
  display: inline-flex;
  flex-direction: column;
  vertical-align: bottom;
  margin-right: 0px;
}

.chord-above {
  font-family: var(--font-en), monospace;
  font-weight: 700;
  color: #F59E0B;
  font-size: 13.5px;
  letter-spacing: 0.5px;
  line-height: 1.25;
  user-select: none;
  min-height: 17px;
  padding-right: 6px;
}

.lyric-syllable {
  font-size: inherit;
  color: #F8FAFC;
  white-space: pre-wrap;
  line-height: 1.6;
  font-family: var(--font-km);
}

.lyric-line-chords {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  margin-bottom: 6px;
}

.chord-pill {
  background: rgba(56, 189, 248, 0.18);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 12.5px;
  padding: 1px 5px;
  border-radius: 4px;
  margin: 0 3px;
  user-select: none;
}

.traditional-chord-line {
  font-family: var(--font-en);
  font-weight: 700;
  color: #F59E0B;
  font-size: 13.5px;
  letter-spacing: 0.5px;
  white-space: pre-wrap;
  margin-top: 6px;
}

.lyric-line, .lyric-text {
  font-size: inherit;
  color: #F8FAFC;
}

/* Bottom Navigation Bar (Mobile) */
.bottom-nav {
  display: none !important;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  padding: 6px 4px;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  flex: 1;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #FCA5A5;
}
.btn-logout:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #EF4444;
  color: #FFFFFF;
}

.nav-icon {
  font-size: 20px;
  margin-bottom: 2px;
}

.nav-item.active {
  color: var(--accent-cyan);
}

.nav-item.active .nav-icon {
  transform: translateY(-2px);
}

/* Toast Notifications */
.toast-msg {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #10B981;
  color: #FFFFFF;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 200;
  white-space: nowrap;
}

.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Generic Modal / Install Guide */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 22px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.step-num {
  background: var(--accent-blue);
  color: #FFFFFF;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.step-text {
  font-size: 13.5px;
  color: #E2E8F0;
  line-height: 1.5;
}

/* PDF Viewer Modal */
.pdf-viewer-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-main);
  z-index: 120;
  display: none;
  flex-direction: column;
}

.pdf-viewer-modal.active {
  display: flex;
}

/* Live Setlist Controls in Sheet Music Header (Next to Fit Page - No image obstruction) */
.pdf-setlist-header-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: var(--radius-full);
  padding: 2px 4px;
}

.btn-pdf-nav {
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-pdf-nav:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.35);
  color: #60A5FA;
}

.btn-pdf-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-pdf-setlist {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 11.5px;
  color: #FFFFFF;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.btn-pdf-setlist:hover {
  background: rgba(59, 130, 246, 0.38);
  border-color: #60A5FA;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.pdf-viewer-modal .setlist-quick-drawer {
  position: absolute;
  top: 54px;
  bottom: auto;
  left: 12px;
  right: 12px;
  max-width: 440px;
  margin: 0 auto;
  max-height: 65vh;
  z-index: 150;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85);
  border-color: rgba(56, 189, 248, 0.5);
}

.pdf-scroll-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  background: #0B0F19;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  -webkit-overflow-scrolling: touch;
}

.pdf-canvas-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  margin: auto;
}

/* Sheet Music Image Styling */
.sheet-music-img {
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease-out;
  transform-origin: top center;
}

/* Default Fit Page: Whole page fits within viewport (no excessive height or huge zoom) */
.pdf-canvas-wrapper.fit-page .sheet-music-img {
  max-height: calc(100dvh - 84px);
  max-height: calc(100vh - 84px);
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Fit Width: Stretches across the full screen width */
.pdf-canvas-wrapper.fit-width .sheet-music-img {
  max-width: 100%;
  width: 100%;
  max-height: none;
  height: auto;
}

.pdf-page-canvas {
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  max-width: 100%;
  height: auto !important;
}

.pdf-frame-wrapper {
  flex: 1;
  width: 100%;
  height: 100%;
  background: #1E293B;
  border: none;
}

/* ==========================================================================
   Security & Passcode Lock Screen
   ========================================================================== */
.lock-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 10, 17, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lock-screen-overlay.active {
  display: flex;
}

.lock-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6), var(--shadow-glow);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
}

.lock-icon-wrapper {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #1E1B4B, #0F172A);
  border: 1.5px solid var(--accent-cyan);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.lock-title {
  font-size: 18px;
  font-weight: 700;
  color: #FFFFFF;
}

.lock-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.lock-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.passcode-input-wrapper {
  position: relative;
  width: 100%;
}

.passcode-input {
  width: 100%;
  background: var(--bg-card);
  border: 1.5px solid #2563EB;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 16px;
  font-family: var(--font-en);
  letter-spacing: 2px;
  color: #FFFFFF;
  text-align: center;
  outline: none;
  transition: all 0.2s ease;
}

.passcode-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
}

.lock-error-msg {
  color: #F87171;
  font-size: 12.5px;
  font-weight: 600;
  display: none;
}

.btn-unlock {
  background: linear-gradient(135deg, #2563EB, #06B6D4);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
  transition: all 0.2s ease;
}

.btn-unlock:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.45);
}

.btn-request-passcode {
  background: transparent;
  border: 1px dashed var(--border-subtle);
  color: var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-request-passcode:hover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
}

.remember-login-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.shake {
  animation: shake 0.45s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.admin-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.admin-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #CBD5E1;
}

.admin-input {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: #FFFFFF;
  font-size: 13.5px;
  outline: none;
}

.admin-input:focus {
  border-color: var(--accent-cyan);
}

/* Admin Security Control Panel Sections */
.admin-card-section {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: left;
}

.admin-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #FFFFFF;
}

.admin-section-title {
  font-weight: 700;
}

.admin-section-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.45;
}

/* Passcode Cards List */
.passcode-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.passcode-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: all 0.2s ease;
}

.passcode-card-item:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: var(--bg-card-hover);
}

.passcode-card-item.expired-item {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.04);
}

.passcode-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.passcode-code-badge-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.passcode-code-val {
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 13px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  cursor: pointer;
  transition: all 0.15s ease;
}

.passcode-code-val:hover {
  background: rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

.passcode-label-tag {
  font-size: 12px;
  color: #E2E8F0;
  font-weight: 600;
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2.5px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-expired {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-unlimited {
  background: rgba(139, 92, 246, 0.15);
  color: #A78BFA;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.passcode-card-meta {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  flex-wrap: wrap;
  gap: 6px;
}

.passcode-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
  gap: 6px;
}

.renew-btn-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.btn-micro {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-micro:hover {
  background: var(--accent-blue);
  color: #FFFFFF;
  border-color: var(--accent-cyan);
}

.btn-micro.btn-danger {
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

.btn-micro.btn-danger:hover {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #EF4444;
}

/* Donation & Support Buttons & Modal */
.btn-donate {
  background: linear-gradient(135deg, #BE123C, #E11D48);
  color: #FFFFFF;
  border: 1px solid rgba(251, 113, 133, 0.4);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(225, 29, 72, 0.35);
  transition: all 0.2s ease;
}

.btn-donate:hover {
  background: linear-gradient(135deg, #E11D48, #F43F5E);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.5);
}

.btn-donate-link {
  background: rgba(244, 63, 94, 0.12);
  border: 1px dashed rgba(244, 63, 94, 0.4);
  color: #FDA4AF;
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
}

.btn-donate-link:hover {
  border-color: #FB7185;
  background: rgba(244, 63, 94, 0.22);
}

.donation-blessing-text {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
  font-style: italic;
}

.donation-qr-card {
  background: #FFFFFF;
  color: #0F172A;
  border-radius: 16px;
  padding: 16px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  margin: 0 auto 12px auto;
  max-width: 290px;
}

.khqr-badge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid #F1F5F9;
}

.khqr-tag {
  background: #E11D48;
  color: #FFFFFF;
  font-weight: 900;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 1px;
  font-family: var(--font-en);
}

.bank-tag {
  font-size: 12px;
  font-weight: 700;
  color: #0284C7;
}

.qr-image-wrapper {
  width: 210px;
  height: 210px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F8FAFC;
  border: 2px dashed #CBD5E1;
  border-radius: 12px;
  overflow: hidden;
}

.donation-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.donation-account-info {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1.5px solid #F1F5F9;
  text-align: center;
}

.account-name {
  font-size: 14px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: 0.5px;
}

.account-number-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.account-number {
  font-family: var(--font-en);
  font-size: 15px;
  font-weight: 700;
  color: #0284C7;
  letter-spacing: 1.5px;
}

.donation-notice-box {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #38BDF8;
  line-height: 1.45;
  text-align: center;
/* Lock Screen Tabs (Login / Register) */
.lock-tabs-bar {
  display: flex;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
  width: 100%;
  gap: 4px;
}

.lock-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.lock-tab-btn.active {
  background: var(--accent-blue);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.register-form-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.reg-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reg-field-label {
  font-size: 12px;
  font-weight: 600;
  color: #CBD5E1;
}

.reg-input {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 13.5px;
  color: #FFFFFF;
  outline: none;
  transition: border-color 0.2s ease;
}

.reg-input:focus {
  border-color: var(--accent-cyan);
}

.btn-register-submit {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
  margin-top: 4px;
}

.btn-register-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

/* User Limit Progress Bar */
.user-limit-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 6px;
}

.user-limit-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38BDF8, #2563EB);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.user-limit-bar-fill.warning {
  background: linear-gradient(90deg, #F59E0B, #EF4444);
}

/* Pending Request Cards in Admin */
.pending-request-card {
  background: var(--bg-card);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.pending-request-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pending-request-name {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pending-request-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.btn-approve {
  background: #059669;
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s ease;
}

.btn-approve:hover {
  background: #10B981;
}

.btn-reject {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-reject:hover {
  background: #EF4444;
  color: #FFFFFF;
}

/* ==========================================================================
   Admin Context Menu (Right-Click on Song)
   ========================================================================== */
.admin-context-menu {
  position: fixed;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 16px rgba(245, 158, 11, 0.25);
  min-width: 250px;
  max-width: 320px;
  padding: 6px;
  font-family: var(--font-km);
  animation: contextMenuPop 0.15s ease-out;
  user-select: none;
}

@keyframes contextMenuPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.context-menu-header {
  padding: 8px 10px 6px 10px;
}

.context-menu-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #FBBF24;
  background: rgba(245, 158, 11, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  margin-bottom: 4px;
}

.context-menu-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.context-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 6px;
}

.context-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 9px 10px;
  border-radius: 8px;
  color: #F1F5F9;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.context-menu-item:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  transform: translateX(2px);
}

.context-menu-item:active {
  transform: scale(0.98);
}

.context-menu-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.context-menu-text {
  display: flex;
  flex-direction: column;
}

.context-menu-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.context-menu-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
}

/* 3-dots button on song cards */
.btn-more-options {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94A3B8;
  font-size: 19px;
  font-weight: bold;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-right: 4px;
}

.btn-more-options:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.5);
  color: #FBBF24;
  transform: scale(1.08);
}

.btn-more-options:active {
  transform: scale(0.95);
}

/* Upload Modal Styles */
.upload-tabs-bar {
  display: flex;
  gap: 6px;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 6px;
}

.upload-tab {
  flex: 1;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.upload-tab:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
}

.upload-tab.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.8), rgba(6, 182, 212, 0.8));
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.35);
}

.upload-dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.45);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: #38BDF8;
  background: rgba(56, 189, 248, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.15);
}

.upload-tab-pane {
  display: none;
}

.upload-tab-pane.active {
  display: block;
}

/* ==========================================================================
   Song Requests & Comment Feature (សំណូមពរបទថ្មីរឺបទមិនទាន់មាន)
   ========================================================================== */
.btn-song-request {
  background: rgba(168, 85, 247, 0.16);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #D8B4FE;
  font-weight: 600;
  white-space: nowrap;
}

.btn-song-request:hover {
  background: rgba(168, 85, 247, 0.3);
  border-color: #C084FC;
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.4);
}

.btn-req-label-full {
  display: inline;
}

.btn-req-label-short {
  display: none;
}

@media (max-width: 640px) {
  .btn-req-label-full {
    display: none;
  }
  .btn-req-label-short {
    display: inline;
  }
}

.song-request-card {
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border-color: rgba(168, 85, 247, 0.35);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(168, 85, 247, 0.2);
}

.song-request-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.song-request-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.req-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.req-label {
  font-size: 12px;
  font-weight: 600;
  color: #E2E8F0;
}

.req-required {
  color: #F87171;
  font-weight: bold;
}

.req-input, .req-textarea {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: #FFFFFF;
  font-family: var(--font-km);
  font-size: 13.5px;
  padding: 9px 12px;
  transition: all 0.2s ease;
  width: 100%;
}

.req-input:focus, .req-textarea:focus {
  outline: none;
  border-color: #A855F7;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.25);
}

.req-textarea {
  resize: vertical;
  min-height: 70px;
}

.req-buttons-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn-submit-request {
  background: linear-gradient(135deg, #8B5CF6, #D946EF);
  color: #FFFFFF;
  border: none;
  padding: 10px 18px;
  font-weight: 700;
  flex: 1;
  justify-content: center;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.4);
}

.btn-submit-request:hover {
  background: linear-gradient(135deg, #7C3AED, #C026D3);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.btn-req-telegram {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93C5FD;
  padding: 10px 14px;
  text-decoration: none;
  white-space: nowrap;
}

.btn-req-telegram:hover {
  background: rgba(59, 130, 246, 0.28);
  border-color: #3B82F6;
  color: #FFFFFF;
}

.req-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.req-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.req-history-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #F1F5F9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.req-badge {
  background: #A855F7;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: bold;
  padding: 1px 7px;
  border-radius: 12px;
}

.song-requests-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.req-empty-state {
  text-align: center;
  padding: 22px 14px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
}

.req-item-card {
  background: rgba(19, 30, 53, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}

.req-item-card:hover {
  border-color: rgba(168, 85, 247, 0.35);
  background: rgba(25, 39, 69, 0.85);
}

.req-item-card.is-completed {
  opacity: 0.78;
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(6, 78, 59, 0.15);
}

.req-item-top {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.req-item-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.req-song-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #FFFFFF;
  word-break: break-word;
}

.req-status-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}

.req-status-pending {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #FCD34D;
}

.req-status-done {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6EE7B7;
}

.req-artist {
  font-size: 11.5px;
  color: #93C5FD;
}

.req-link {
  font-size: 11.5px;
  color: #38BDF8;
  text-decoration: underline;
  word-break: break-all;
}

.req-item-comment {
  font-size: 12px;
  color: #E2E8F0;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 6px 9px;
  line-height: 1.45;
}

.req-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  font-size: 11px;
}

.req-user-info {
  color: var(--text-dim);
}

.req-admin-actions {
  display: flex;
  gap: 6px;
}

.req-btn-delete {
  color: #FCA5A5 !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

.req-btn-delete:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #FFFFFF !important;
}


