/* ============================================
   Radio DM Community – RDM.radiodm.pl
   Dark neon disco theme
   ============================================ */

:root {
  --bg-deep: #0a0a0f;
  --bg-main: #111118;
  --bg-card: #1a1a24;
  --bg-card-hover: #22222e;
  --bg-elevated: #252532;

  --cyan: #00e5ff;
  --magenta: #ff2eb6;
  --gold: #ffd700;
  --purple: #b14eff;

  --text: #e8e8f0;
  --text-muted: #9a9ab0;
  --text-dim: #6a6a80;

  --border: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 229, 255, 0.25);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --glow-cyan: 0 0 20px rgba(0, 229, 255, 0.35);
  --glow-magenta: 0 0 20px rgba(255, 46, 182, 0.35);
  --glow-gold: 0 0 24px rgba(255, 215, 0, 0.4);

  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Orbitron", "Inter", sans-serif;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
  position: relative;
}

/* Particles canvas */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* Layout */
.wrapper {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem 4rem;
}

/* ========== HEADER ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  box-shadow: var(--glow-cyan);
}

.logo span {
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.08);
}

.nav-link.active {
  color: var(--bg-deep);
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  box-shadow: var(--glow-cyan);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem 0.35rem 0.5rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.user-chip:hover {
  border-color: var(--cyan);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--magenta), var(--purple));
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ========== HERO ========== */
.hero {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, var(--cyan), var(--magenta), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 1.5rem;
  font-size: 1.05rem;
}

.hero-links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  color: #0a0a0f;
  box-shadow: var(--glow-cyan);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(0, 229, 255, 0.5);
}

.btn-outline {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--cyan);
}

.btn-outline:hover {
  background: rgba(0, 229, 255, 0.1);
}

.btn-gold {
  background: linear-gradient(90deg, var(--gold), #ffaa00);
  color: #1a1200;
  box-shadow: var(--glow-gold);
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

.btn-xs {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
}

.btn-block {
  width: 100%;
}

.btn-vote {
  background: rgba(255, 46, 182, 0.15);
  color: var(--magenta);
  border: 1px solid rgba(255, 46, 182, 0.4);
}

.btn-vote:hover:not(:disabled) {
  background: rgba(255, 46, 182, 0.3);
}

.btn-vote:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ========== CARDS & SECTIONS ========== */
.section {
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 1.2em;
  background: linear-gradient(var(--cyan), var(--magenta));
  border-radius: 2px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

/* Hit card */
.hit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
}

.hit-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow);
}

.hit-card.hit-winner {
  border-color: var(--gold);
  box-shadow: var(--glow-gold);
}

.hit-rank {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: rgba(0, 0, 0, 0.7);
  color: var(--cyan);
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  z-index: 2;
}

.winner-badge {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: linear-gradient(90deg, var(--gold), #ffaa00);
  color: #1a1200;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  z-index: 2;
}

.hit-thumb {
  aspect-ratio: 16/9;
  background: var(--bg-elevated);
  overflow: hidden;
}

.hit-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.no-thumb {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  opacity: 0.4;
}

.hit-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hit-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.hit-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.hit-nick {
  color: var(--cyan);
}

.hit-votes {
  color: var(--magenta);
}

.hit-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  flex: 1;
}

.hit-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
}

/* Contest card */
.contest-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s;
}

.contest-card:hover {
  border-color: var(--border-glow);
}

.contest-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.contest-header h3 {
  font-size: 1.1rem;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-active {
  background: rgba(0, 229, 255, 0.15);
  color: var(--cyan);
}

.badge-closed {
  background: rgba(255, 46, 182, 0.15);
  color: var(--magenta);
}

.contest-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.entry-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.entry-rank {
  color: var(--gold);
  font-weight: 700;
  min-width: 1.5rem;
}

.entry-title {
  flex: 1;
}

.entry-votes {
  color: var(--magenta);
  font-size: 0.85rem;
}

/* Podium */
.podium-current {
  background: linear-gradient(145deg, var(--bg-card), #1f1a10);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--glow-gold);
}

.podium-badge {
  display: inline-block;
  background: linear-gradient(90deg, var(--gold), #ffaa00);
  color: #1a1200;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.podium-content {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.podium-thumb {
  width: 160px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.podium-content h2 {
  font-size: 1.4rem;
  margin-bottom: 0.35rem;
}

.podium-nick {
  color: var(--text-muted);
}

.podium-votes {
  color: var(--magenta);
  font-weight: 600;
  margin-top: 0.25rem;
}

.podium-empty {
  text-align: center;
  padding: 2.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.podium-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

/* Hall of Fame */
.hof-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hof-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.hof-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #ffaa00);
  color: #1a1200;
  font-weight: 800;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
}

.hof-nick {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Forms */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 520px;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
}

.form-group small {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.form-group textarea {
  min-height: 90px;
  resize: vertical;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.modal-header {
  margin-bottom: 1.25rem;
  text-align: center;
}

.modal-header h2 {
  font-size: 1.3rem;
  margin-bottom: 0.35rem;
}

.modal-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Toast */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.3s;
  max-width: 320px;
  font-size: 0.95rem;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-color: rgba(0, 229, 255, 0.5);
}

.toast-error {
  border-color: rgba(255, 46, 182, 0.5);
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.empty-small {
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

/* Admin specific */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  min-height: 70vh;
}

.admin-sidebar {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--border);
  height: fit-content;
  position: sticky;
  top: 80px;
}

.admin-nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  transition: all 0.15s;
}

.admin-nav-btn:hover,
.admin-nav-btn.active {
  background: rgba(0, 229, 255, 0.1);
  color: var(--cyan);
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.status-pending { color: var(--gold); }
.status-approved { color: var(--cyan); }
.status-rejected { color: var(--magenta); }
.status-winner { color: var(--gold); font-weight: 700; }

.admin-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  text-align: center;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--cyan);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

/* Utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .nav {
    justify-content: center;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .admin-nav-btn {
    width: auto;
    flex: 1;
    text-align: center;
  }

  .podium-content {
    flex-direction: column;
    text-align: center;
  }

  .podium-thumb {
    width: 100%;
    max-width: 280px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.6rem;
  }

  .nav-link {
    padding: 0.4rem 0.65rem;
    font-size: 0.85rem;
  }
}

/* YouTube embed */
.yt-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  margin: 0.75rem 0;
}

.yt-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Widget for main site */
.rdm-podium-widget {
  background: linear-gradient(145deg, #1a1a24, #1f1a10);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 12px;
  padding: 1.25rem;
  color: #e8e8f0;
  font-family: system-ui, sans-serif;
  max-width: 360px;
}

.rdm-podium-widget .badge {
  display: inline-block;
  background: linear-gradient(90deg, #ffd700, #ffaa00);
  color: #1a1200;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.rdm-podium-widget h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.rdm-podium-widget a {
  color: #00e5ff;
}

/* ========== Connection Banner ========== */
.connection-banner {
  display: none;
  position: sticky;
  top: 0;
  z-index: 200;
  background: linear-gradient(90deg, #3a1020, #1a0a12);
  border-bottom: 1px solid rgba(255, 46, 182, 0.4);
  color: #ffb0d8;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
}

.connection-banner.visible {
  display: flex;
}

.connection-banner .conn-retry {
  background: rgba(255, 46, 182, 0.2);
  border: 1px solid rgba(255, 46, 182, 0.5);
  color: #ff2eb6;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
}

.connection-banner .conn-retry:hover {
  background: rgba(255, 46, 182, 0.35);
}

/* Loading */
.loading-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0, 229, 255, 0.2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  margin: 0 auto 0.75rem;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-state .error-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.cache-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 0.75rem;
  padding: 0.35rem;
  background: rgba(0, 229, 255, 0.06);
  border-radius: 6px;
}
