/* Basestil */

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  background: #edffde;
  color: #111827;
}

.page {
  min-height: 100vh;
}

/* Sørg for at header og main er midtstilt og har samme bredde */

.site-header,
.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 24px 0;
}

/* Header / topp */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  font-family: inherit;
  font-size: 14px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
}

/* "Logg inn" – diskret knapp */
.btn-skjult {
  border-color: #cbd5e1;
  background: #f8fafc;
}

/* "Registrer deg" – primær */
.btn-outline {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.main {
  padding-bottom: 40px;
}

.welcome-section {
  margin-top: 32px;
  text-align: center;
}

.welcome-section h2 {
  margin: 0;
  font-size: 26px;
}

.welcome-section p {
  margin-top: 8px;
  color: #6b7280;
}

.toplist-section {
  margin-top: 28px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 20px 20px 16px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.toplist-section h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.section-subtitle {
  margin: 0 0 10px;
  font-size: 13px;
  color: #6b7280;
}

/* ---- FILTER WRAPPER - CENTER EVERYTHING ---- */

.filter-wrapper {
  margin-top: 30px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;     /* <— midtstiller ALT */
  gap: 12px;
}

.filter-header {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: #6b7280;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* <— midtstilling av knappene */
  gap: 10px;
  width: 100%;
  max-width: 900px;
}

.filter-group .pill {
  margin: 0; 
}

@media (max-width: 500px) {
  .filter-group {
    flex: 1 1 140px;
  }
}

/* Piller/valgknapper */

.pill {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid #d1d5db;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: 
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.7);
}

/* Hover  */
.pill:hover {
  background: #f8fafc;
  border-color: #000000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
  color: #000000;
}

/* Aktive knapper */
.pill-active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
  box-shadow: 0 4px 14px rgba(17,24,39,0.25);
}

.pill-active:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(17,24,39,0.35);
}

.toplist {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.toplist-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  margin-bottom: 6px;
  background: linear-gradient(90deg, #ffffff, #f7fbf2);
  border: 1px solid #e5e7eb;
  transition: transform 150ms ease-out, box-shadow 150ms ease-out,
    border-color 150ms ease-out, background 150ms ease-out;
}

.toplist-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  border-color: #cbd5f5;
  background: #ffffff;
}

/* Rank-sirkel */

.rank {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  color: #1f2933;
  background: #e0f2c6;
}

/* Navn + metric */

.title {
  font-size: 14px;
  font-weight: 500;
}

.metric,
.score {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
}

@media (max-width: 700px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    align-self: stretch;
    justify-content: flex-end;
  }

  .filter-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .toplist-item {
    grid-template-columns: 24px 1fr;
    grid-template-rows: auto auto;
  }

  .metric,
  .score {
    justify-self: flex-start;
    margin-left: 28px;
    margin-top: 2px;
  }
}

/* -------- MODAL OVERRIDE FIX -------- */

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 28px 28px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
  position: relative;
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Close X */
.modal-content .close {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 24px;
  cursor: pointer;
}

/* Form */
.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-content input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 14px;
}

.modal-content .btn-primary {
  width: 100%;
  margin-top: 6px;
  padding: 10px 0;
  border-radius: 999px;
  background: #111827;
  color: #fff;
}

.error-message {
  color: #e72020;
  margin-top: 6px;
  font-size: 14px;
}

.auth-bunntekst {
  margin-top: 14px;
  font-size: 14px;
  text-align: center;
}

/* ---- CENTER MODAL CONTENT ---- */

.modal-content {
  text-align: center;
}

/* Sentrum-juster heading */
.modal-content h2 {
  text-align: center;
  width: 100%;
  margin-bottom: 20px;
}

/* Inputfeltene skal fortsatt være full width, men sentrert i layouten */
.modal-content form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center; /* <– centrering */
}

/* Selve input-feltene */
.modal-content input {
  width: 100%;
  max-width: 330px; /* <– hindrer dem i å være for brede */
  margin: 6px 0;
}

/* Knapp */
.modal-content .btn-primary {
  max-width: 330px;
  width: 100%;
}

/* "Har du ikke konto" teksten */
.auth-bunntekst {
  text-align: center;
  width: 100%;
}


.nav-link {
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 6px;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: #111827;
  text-decoration: underline;
}

.back-button-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 40px;
  margin-bottom: 20px;
}

.back-button {
  padding: 12px 24px;
  background: #111827;
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.back-button:hover {
  background: #000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

  
.metric-blurred {
  filter: blur(5px);
}

/* Info-banner for dummy-data */
.info-banner {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.info-warning {
  background-color: rgba(255, 193, 7, 0.15);
  border: 1px solid rgba(255, 193, 7, 0.6);
  color: #644000;
}

.welcome-user {
  margin-right: 12px;
  font-size: 0.9rem;
  opacity: 0.8;
}

.toplist-blurred {
  filter: blur(5px);
  opacity: 1;
  pointer-events: none;
  user-select: none;
}

.info-warning {
  background-color: rgba(255, 193, 7, 0.08); /* lysere gult */
  border: 1px solid rgba(255, 193, 7, 0.35); 
  color: #7c5a00; /* litt mykere tekstfarge */
  opacity: 0.95;
  text-align: center;
}

.btn-omoss {
  font-family: inherit;
  font-size: 14px;
  padding: 7px 16px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #374151;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-omoss:hover {
  background: #ffffff;
  border-color: #94a3b8;
  color: #111827;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.btn {
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-skjult:hover {
  background: #ffffff;
  border-color: #94a3b8;
  color: #111827;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.btn-outline:hover {
  background: #000000;
  border-color: #000000;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

