/* ---------- SNAPNU.DK MASTER CSS ---------- */
/* Sæt standard til dark, hvis ingen klasse er fundet */
:root {
  --bg: #0e0e11;
  --text: #f1f1f1;
  --panel: #15151a;
  --border: #2a2a33;
  --primary-gradient: linear-gradient(135deg, #00d2ff 0%, #9d50bb 100%);
  --primary-shadow: rgba(157, 80, 187, 0.4);
  /* ... behold dine andre variabler her ... */
}

/* Eksplicit definition af Dark mode */
.theme-dark {
  --bg: #0e0e11;
  --text: #f1f1f1;
  --panel: #15151a;
  --border: #2a2a33;
}

/* Eksplicit definition af Light mode */
.theme-light {
  --bg: #ffffff;
  --text: #111111;
  --panel: #f6f7f9;
  --border: #dfe1e5;
  --input-bg: #ffffff;
  --btn: #ededf1;
  --btn-border: #cfd3da;
  --btn-text: #111111;
}

/* ---------- BASE ---------- */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  margin: 0;
  scroll-behavior: smooth; /* Premium: smooth scrolling */
  -webkit-overflow-scrolling: touch; /* iOS touch smooth */
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.5;
  touch-action: manipulation; /* Premium: bedre touch feedback */
}

/* ---------- LINKS ---------- */
a {
  color: var(--link);
  text-decoration: none;
  transition: opacity .2s;
}

a:hover {
  opacity: .7;
}

/* ---------- CONTAINER ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- HEADER ---------- */
header {
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 65px;
}

.logo-img {
  max-height: 38px;
  width: auto;
  display: block;
}

/* ---------- CARDS ---------- */
.card {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 16px;
  padding: 20px;
  margin: 20px 0;
}

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3 {
  letter-spacing: -0.5px;
  margin-top: 0;
}

.small {
  opacity: .8;
  font-size: .9rem;
}

.muted {
  color: var(--muted);
}

/* ---------- BUTTONS ---------- */
.btn, .btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--btn-border);
  background: var(--btn);
  color: var(--btn-text);
  padding: 12px 24px;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all .2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: scale(.96);
}

.btn-sm {
  padding: 6px 14px;
  font-size: .85rem;
  border-radius: 8px;
}

.btn-primary {
    /* Bagrund: En synlig farve (f.eks. mørk lilla/blå gradient) */
    background: linear-gradient(90deg, #00d2ff, #9d50bb) !important;
    
    /* Tekstfarve: Hvid (sikrer kontrast) */
    color: #ffffff !important; 
    
    /* Knap-opbygning */
    display: inline-block !important;
    padding: 16px 32px !important;
    border-radius: 50px !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    text-align: center !important;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(157, 80, 187, 0.5);
}

.btn-primary:active {
  transform: scale(0.96);
}

.btn-muted {
  background: var(--btn);
  border-color: var(--btn-border);
}

.btn-del {
  background: #5b2532;
  border-color: #8a3a4a;
  color: #fff !important;
}

/* ---------- INPUTS ---------- */
input[type=text],
input[type=password],
input[type=email],
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

input:focus {
  border-color: #9d50bb;
  box-shadow: 0 0 6px rgba(157,80,187,0.3);
}

/* ---------- MEDIA GRID ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

@media (min-width:600px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
  }
}

.grid a {
  display: block;
  aspect-ratio: 1/1;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  position: relative;
  border: 1px solid var(--border);
}

.grid img,
.grid video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.grid a:hover img {
  transform: scale(1.08);
}

/* ---------- MESSAGES ---------- */
.msg {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 15px;
  font-weight: 500;
}

.msg.ok {
  background: var(--panel);
  border: 1px solid var(--border);
}

.msg.error {
  background: #3a1f23;
  border: 1px solid #6b2e36;
  color: #ffbaba;
}

/* ---------- ADMIN TABLE ---------- */
.table-container {
  overflow-x: auto;
  margin: 15px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

th, td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: .6;
}

/* ---------- MODALS ---------- */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
}

.modal.open {
  display: block;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
}

.modal__dialog {
  position: relative;
  z-index: 2;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: min(600px, 95vw);
  margin: 10vh auto;
  max-height: 85vh;
  overflow-y: auto;
  padding: 25px;
}

.modal--auth .modal__dialog {
  height: 550px;
  padding: 0;
  overflow: hidden;
}

.modal__frame {
  width: 100%;
  height: 100%;
  border: none;
}

.modal__close {
  position: absolute;
  right: 15px;
  top: 15px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
}

/* ---------- SCROLL LOCK ---------- */
html.modal-open,
body.modal-open {
  overflow: hidden !important;
}

/* ---------- LIGHTBOX ---------- */
.lb {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2000;
  background: rgba(0,0,0,.95);
  backdrop-filter: blur(10px);
}

.lb.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb__inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb__img,
.lb__video {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  box-shadow: 0 0 40px rgba(0,0,0,.5);
}

.lb__close {
  position: absolute;
  top: 30px;
  right: 30px;
  font-size: 2rem;
  color: #fff;
  z-index: 2100;
}

.lb__prev,
.lb__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 4rem;
  color: #fff;
  padding: 30px;
  opacity: .3;
  transition: .2s;
  cursor: pointer;
}

.lb__prev:hover,
.lb__next:hover {
  opacity: 1;
}

.lb__prev { left: 10px; }
.lb__next { right: 10px; }

.lb__dl {
  position: absolute;
  bottom: 40px;
  color: #fff;
  background: rgba(255,255,255,.1);
  padding: 10px 25px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,.2);
}

/* ---------- MOBILE NAV ---------- */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  font-size: 11px;
  font-weight: 600;
  opacity: .6;
  cursor: pointer;
}

.mobile-nav-item.active {
  opacity: 1;
  color: #9d50bb;
}

.mobile-nav .material-icons {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 3px;
}

@media (max-width: 768px) {
  .mobile-nav {
    display: flex;
  }
}

/* ---------- MOBILE TABLE FIX ---------- */
@media (max-width: 600px) {
  table, thead, tbody, th, td, tr {
    display: block;
  }
  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  tr {
    border: 1px solid var(--border);
    margin-bottom: 15px;
    border-radius: 12px;
    padding: 10px;
    background: var(--panel);
  }
  td {
    border: none;
    position: relative;
    padding-left: 0;
    margin-bottom: 10px;
  }
  .btn-sm {
    width: 100%;
    justify-content: center;
    margin-bottom: 5px;
  }
}