@import url('https://fonts.googleapis.com/css2?family=Anton&family=Space+Grotesk:wght@400;600;700&display=swap');

:root {
  /* System Colors - TEMA SCURO UFFICIALE (Refined & Softer) */
  --background: #08080c;
  --foreground: #f4f4f6;
  --card: #121216; /* Card background */
  --primary: #e1ff00; /* Neon Lime */
  --primary-foreground: #000000;
  --secondary: #ff00a0; /* Neon Magenta */
  --muted: #1e1e24;
  --muted-foreground: #8e8e9f;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hard: rgba(255, 255, 255, 0.15);
  
  /* Variabili per Admin JS */
  --accent-color: var(--primary);
  --error-color: #ff3b30; /* Softer red */
  
  /* Fonts */
  --font-display: 'Anton', impact, sans-serif; 
  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  padding: 24px 16px;
  max-width: 520px; /* Refined mobile-first layout width */
  margin: 0 auto;
}

/* Typography Utility */
.text-display {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h1, h2, h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(2.2rem, 8vw, 3rem);
  color: var(--foreground);
  text-align: center;
}

p {
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* Evidenziatori (Refined Badges) */
.text-block-yellow {
  background-color: var(--primary);
  color: #000;
  padding: 6px 14px;
  font-weight: 700;
  display: inline-block;
  border-radius: 9999px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.text-block-pink {
  background-color: var(--secondary);
  color: #fff;
  padding: 6px 14px;
  font-weight: 700;
  display: inline-block;
  border-radius: 9999px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Modern Rounded Inputs & Forms */
input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 16px 20px;
  font-size: 1.75rem;
  font-family: var(--font-display);
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 20px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 14px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

input::placeholder {
  color: #52525b;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 20px rgba(225, 255, 0, 0.15);
}

/* Premium Rounded Buttons */
button {
  width: 100%;
  background: var(--foreground);
  color: #000000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 24px;
  font-size: 1.2rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 14px;
  margin-bottom: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.12);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

button.primary {
  background: var(--primary);
  color: #000000;
  border: none;
}

button.primary:hover {
  box-shadow: 0 8px 24px rgba(225, 255, 0, 0.25);
}

button.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--foreground);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

button.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

button:disabled {
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted-foreground);
  border-color: rgba(255, 255, 255, 0.04);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Elegant Softer Card */
.brutalist-card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 24px;
  margin-bottom: 20px;
  border-radius: 20px;
}

.brutalist-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(225, 255, 0, 0.04);
}

/* Singers List (Sleek Rounded Rows) */
.singers-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 30px;
}

.singer-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  gap: 16px;
}

.singer-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(4px);
}

.singer-item.selected {
  background: rgba(225, 255, 0, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(225, 255, 0, 0.08);
}

.singer-item.selected .singer-name {
  color: var(--primary);
}

.singer-number {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--muted-foreground);
  width: 36px;
  transition: color 0.2s ease;
}

.singer-item:hover .singer-number {
  color: var(--foreground);
}

.singer-item.selected .singer-number {
  color: var(--primary);
}

.singer-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Classifica / Leaderboard */
.leaderboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--card);
  border-radius: 16px;
  margin-bottom: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  gap: 16px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.leaderboard-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Podium Items Styling */
.leaderboard-item:nth-child(1) {
  border-color: rgba(255, 0, 160, 0.3);
  background: linear-gradient(135deg, var(--card), rgba(255, 0, 160, 0.05));
  box-shadow: 0 8px 30px rgba(255, 0, 160, 0.12);
}
.leaderboard-item:nth-child(2) {
  border-color: rgba(225, 255, 0, 0.3);
  background: linear-gradient(135deg, var(--card), rgba(225, 255, 0, 0.04));
  box-shadow: 0 8px 30px rgba(225, 255, 0, 0.10);
}
.leaderboard-item:nth-child(3) {
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, var(--card), rgba(255, 255, 255, 0.03));
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.05);
}

.leaderboard-rank {
  font-family: var(--font-display);
  font-size: 1.75rem;
  width: 36px;
  text-align: center;
  color: var(--muted-foreground);
}
.leaderboard-item:nth-child(1) .leaderboard-rank { color: var(--secondary); font-size: 2.2rem; }
.leaderboard-item:nth-child(2) .leaderboard-rank { color: var(--primary); font-size: 2rem; }
.leaderboard-item:nth-child(3) .leaderboard-rank { color: #fff; font-size: 1.75rem; }

.leaderboard-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  flex: 1;
  text-transform: uppercase;
}

.leaderboard-votes {
  font-family: var(--font-display);
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.leaderboard-item:nth-child(1) .leaderboard-votes {
  color: var(--secondary);
  background: rgba(255, 0, 160, 0.1);
  border-color: rgba(255, 0, 160, 0.15);
}

.leaderboard-item:nth-child(2) .leaderboard-votes {
  color: var(--primary);
  background: rgba(225, 255, 0, 0.1);
  border-color: rgba(225, 255, 0, 0.15);
}

/* Admin Panel */
.admin-section {
  background: var(--card);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 20px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.admin-section h2 {
  font-size: 1.35rem;
  color: var(--primary);
  margin-bottom: 15px;
}

.flex-row {
  display: flex;
  gap: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 15px;
  font-family: var(--font-sans);
}

th, td {
  text-align: left;
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

th {
  color: var(--muted-foreground);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

td {
  color: var(--foreground);
  font-size: 0.95rem;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 90%;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  background: rgba(18, 18, 22, 0.9);
  backdrop-filter: blur(12px);
  color: var(--foreground);
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(225, 255, 0, 0.04);
  font-weight: 600;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toast.error {
  border-color: rgba(255, 0, 160, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 0, 160, 0.08);
}

.toast.success {
  border-color: rgba(225, 255, 0, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(225, 255, 0, 0.08);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modals & Overlays */
.overlay {
  position: fixed;
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  background: rgba(5, 5, 8, 0.85); /* Dark, refined overlay instead of bright white */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(12px);
}

.overlay.hidden { display: none; }

.modal-content {
  background: var(--card);
  padding: 40px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(225, 255, 0, 0.08);
  width: 90%;
  max-width: 400px;
  text-align: center;
}

.modal-content h2 { 
  margin-bottom: 20px; 
  color: var(--primary);
}
