/* ===== Glasovanje o repertoarju — style.css =====
   Dark, warm, music-themed. Mobile-first. No external assets. */

:root {
  --bg: #14100c;
  --bg-alt: #1c1610;
  --card-bg: #241b14;
  --card-bg-2: #2c2116;
  --border: #3a2c1e;
  --gold: #e0ab4c;
  --gold-strong: #f2c368;
  --orange: #e0722f;
  --text: #f4ecdd;
  --text-dim: #b9a98e;
  --text-faint: #85765f;
  --danger: #d1503a;
  --danger-bg: #3a1f18;
  --success: #6fbf8b;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 20% 0%, #241a10 0%, var(--bg) 55%);
  color: var(--text);
  font-family: var(--font);
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  padding-bottom: 2rem;
}

.bg-notes {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  font-size: 8rem;
  color: rgba(224, 171, 76, 0.04);
  display: flex;
  justify-content: space-between;
  padding: 2rem;
  letter-spacing: 4vw;
  overflow: hidden;
  user-select: none;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-strong); }

.container {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

/* ---------- top bar (user) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: rgba(20, 16, 12, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 1rem;
  flex-wrap: wrap;
}
.brand { font-weight: 700; color: var(--gold-strong); font-size: 1.05rem; }
.topnav { display: flex; gap: 0.9rem; }
.topnav a { color: var(--text-dim); font-size: 0.92rem; padding: 0.2rem 0; border-bottom: 2px solid transparent; }
.topnav a.active { color: var(--gold-strong); border-bottom-color: var(--gold); }
.whoami { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; color: var(--text-dim); }
.whoami .logout { color: var(--text-faint); font-size: 0.8rem; }

/* ---------- flash messages ---------- */
.flashes { margin-bottom: 1rem; }
.flash {
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  transition: opacity 0.6s ease;
}
.flash-error { background: var(--danger-bg); color: #ffb4a3; border: 1px solid var(--danger); }
.flash-success { background: #17301f; color: #a9e6bd; border: 1px solid var(--success); }
.flash.fade-out { opacity: 0; }

/* ---------- generic ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
}
.page-title { font-size: 1.4rem; margin: 0.4rem 0 0.6rem; color: var(--gold-strong); }
.section-title { font-size: 1.1rem; margin: 1.6rem 0 0.6rem; color: var(--gold); }
.subtitle { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 1rem; }
.hint { color: var(--text-faint); font-size: 0.8rem; }
.empty-state { color: var(--text-dim); padding: 1.5rem 0; text-align: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-strong);
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease;
  min-height: 44px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--gold), var(--orange)); color: #1a1208; border: none; }
.btn-ghost { border-color: var(--border); color: var(--text-dim); }
.btn-block { width: 100%; }
.btn-small { padding: 0.4rem 0.8rem; font-size: 0.82rem; min-height: 34px; }

/* ---------- entry / hero ---------- */
.hero-card {
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.4rem;
  margin-top: 2rem;
  box-shadow: var(--shadow);
}
.hero-note { font-size: 2.4rem; color: var(--gold); margin-bottom: 0.4rem; }
.hero-card h1 { font-size: 1.5rem; margin: 0 0 0.6rem; color: var(--gold-strong); }
.hero-card .lead { color: var(--text-dim); margin-bottom: 1.4rem; font-size: 0.95rem; }

.entry-form, .suggest-form, .song-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
}
.entry-form label, .suggest-form label, .song-form label {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}
input[type="text"], input[type="password"], input[type="number"], textarea {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; flex-direction: row; margin-top: 0.7rem; color: var(--text-dim); font-size: 0.9rem; }
.entry-form button, .suggest-form button, .song-form button { margin-top: 1rem; }
.hint { margin-top: 0.8rem; }

/* ---------- voting page ---------- */
.vote-header { margin: 0.6rem 0 1rem; }
.progress-label { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 0.35rem; }
.progress-bar {
  height: 8px;
  background: var(--bg-alt);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  transition: width 0.35s ease;
}
.legend { font-size: 0.78rem; color: var(--text-faint); margin-top: 0.5rem; }

.unrated-banner {
  background: var(--card-bg-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.song-list { display: flex; flex-direction: column; gap: 0.9rem; }

.song-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.song-card.pulse { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224, 171, 76, 0.25), var(--shadow); }

.song-info { margin-bottom: 0.7rem; }
.song-title { font-size: 1.15rem; margin: 0 0 0.25rem; color: var(--text); }
.song-meta { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--text-faint); }
.badge {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--gold);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.song-rate { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.rating-notes { display: flex; gap: 0.35rem; }
.note-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-faint);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.note-btn:active { transform: scale(0.9); }
.note-btn.filled {
  background: linear-gradient(135deg, var(--gold), var(--orange));
  border-color: var(--orange);
  color: #1a1208;
  animation: noteFill 0.3s ease;
}
@keyframes noteFill {
  0% { transform: scale(0.7) rotate(-15deg); }
  60% { transform: scale(1.15) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}

.save-indicator {
  opacity: 0;
  color: var(--success);
  font-size: 1.3rem;
  transform: scale(0.5);
}
.save-indicator.show {
  animation: savePop 0.9s ease forwards;
}
@keyframes savePop {
  0% { opacity: 0; transform: scale(0.5); }
  25% { opacity: 1; transform: scale(1.2); }
  40% { transform: scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: scale(1); }
}

.veto-btn {
  margin-top: 0.85rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-faint);
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.veto-btn:hover { border-color: var(--danger); color: var(--danger); }
.veto-btn.is-active {
  border: 1px solid var(--danger);
  background: var(--danger-bg);
  color: #ffb4a3;
}

.song-card.is-vetoed { border-color: var(--danger); }
.song-card.is-vetoed .song-rate { display: none; }
.vetoed-overlay {
  display: none;
  text-align: center;
  color: #ffb4a3;
  font-size: 0.85rem;
  padding: 0.4rem;
  background: var(--danger-bg);
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}
.song-card.is-vetoed .vetoed-overlay { display: block; }

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 1.4rem; gap: 0.6rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%) translateY(20px);
  background: var(--card-bg-2);
  border: 1px solid var(--gold);
  color: var(--text);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 50;
  box-shadow: var(--shadow);
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-error { border-color: var(--danger); color: #ffb4a3; }

/* ---------- suggestions ---------- */
.suggestion-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  flex-wrap: wrap;
}
.suggestion-title { font-weight: 600; }
.suggestion-artist { color: var(--text-faint); font-size: 0.85rem; margin-left: 0.3rem; }
.tag {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid var(--border);
}
.tag-pending { color: var(--gold); border-color: var(--gold); }
.tag-active { color: var(--success); border-color: var(--success); }
.tag-rejected { color: var(--danger); border-color: var(--danger); }
.tag-active.tag { background: rgba(111, 191, 139, 0.1); }

/* ---------- done page ---------- */
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin: 1.2rem 0; }
.summary-box { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.8rem 0.4rem; }
.summary-number { display: block; font-size: 1.5rem; font-weight: 700; color: var(--gold-strong); }
.summary-label { font-size: 0.72rem; color: var(--text-faint); }
.veto-summary { color: #ffb4a3; }
.done-actions { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.4rem; }

/* ---------- admin ---------- */
.admin-shell { display: flex; flex-direction: column; gap: 1rem; }
.admin-header { display: flex; justify-content: space-between; align-items: center; }
.admin-nav { display: flex; gap: 0.6rem; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 0.6rem; }
.admin-nav a { color: var(--text-dim); font-size: 0.85rem; padding: 0.3rem 0.6rem; border-radius: 999px; }
.admin-nav a.active { color: #1a1208; background: linear-gradient(135deg, var(--gold), var(--orange)); }
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.8rem; }
.lang-filter { display: flex; gap: 0.4rem; }
.lang-filter .tag { cursor: pointer; }
.lang-filter .tag-active, .tag.tag-active { background: linear-gradient(135deg, var(--gold), var(--orange)); color: #1a1208; }
.export-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.admin-table { border-collapse: collapse; width: 100%; font-size: 0.85rem; min-width: 520px; }
.admin-table th, .admin-table td { padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.admin-table th { background: var(--bg-alt); color: var(--gold); position: sticky; top: 0; }
.admin-table tr:hover td { background: rgba(224, 171, 76, 0.05); }
.row-inactive td { opacity: 0.5; }
.row-warning td { background: rgba(209, 80, 58, 0.08); }
.row-actions { display: flex; gap: 0.4rem; }
.row-actions form { display: inline; }

.mini-hist { display: flex; gap: 0.25rem; align-items: flex-end; height: 34px; }
.mini-bar-wrap { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; width: 14px; }
.mini-bar { width: 100%; background: linear-gradient(180deg, var(--gold), var(--orange)); border-radius: 2px 2px 0 0; min-height: 2px; }
.mini-bar-label { font-size: 0.6rem; color: var(--text-faint); }

.matrix-wrap { max-height: 70vh; overflow: auto; }
.matrix-table th, .matrix-table td { text-align: center; }
.sticky-col { position: sticky; left: 0; background: var(--card-bg); text-align: left !important; z-index: 2; }
.matrix-table th.sticky-col { background: var(--bg-alt); z-index: 3; }
.cell-veto { color: var(--danger); }
.cell-empty { color: var(--text-faint); }
.cell-rating { font-weight: 700; color: var(--gold); }

.warning-banner {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  color: #ffb4a3;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.ip-row { font-size: 0.8rem; }
.ip-shared code { color: var(--danger); }

.suggestion-admin-list { display: flex; flex-direction: column; gap: 0.7rem; }
.suggestion-admin-card { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.suggestion-admin-actions { display: flex; gap: 0.5rem; }

/* ---------- responsive ---------- */
@media (min-width: 640px) {
  .container { padding: 1.5rem 1.5rem 3rem; }
  .song-rate { justify-content: flex-start; }
  .rating-notes { gap: 0.5rem; }
}

.page-admin .container { max-width: 1100px; }
