/* =========================
   🌗 THEME VARIABLES
   ========================= */
:root {
  --bg: #0d1117;
  --bg-soft: #111827;
  --panel: #111827;
  --panel-2: #0f172a;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #00d8ff;
  --primary-2: #60a5fa;
  --accent: #8b5cf6;
  --border: #1f2937;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
  --radius: 12px;
  --hover: rgba(96,165,250,.12);
}

:root[data-theme="light"] {
  --bg: #f7fafc;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-2: #f3f4f6;
  --text: #111827;
  --muted: #4b5563;
  --primary: #2563eb;
  --primary-2: #0891b2;
  --accent: #7c3aed;
  --border: #e5e7eb;
  --shadow: 0 8px 24px rgba(0,0,0,.08);
}

/* =========================
   🧱 BASE STYLES
   ========================= */
* { box-sizing: border-box; }
/* Globalno prepreči podčrtavanje povezav */


html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
  position: relative;
}

/* Background Glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: background 0.5s ease, filter 0.5s ease;
}

:root[data-theme="dark"] body::before {
  background:
    radial-gradient(900px 700px at 15% 15%, rgba(0,216,255,0.1), transparent 70%),
    radial-gradient(1000px 800px at 85% 20%, rgba(139,92,246,0.08), transparent 70%),
    radial-gradient(1200px 800px at 50% 100%, rgba(0,255,150,0.06), transparent 80%),
    linear-gradient(180deg, rgba(0,0,0,0.45), rgba(10,10,20,0.95));
  filter: blur(8px) brightness(1.05);
}

:root[data-theme="light"] body::before {
  background:
    radial-gradient(900px 700px at 20% 10%, rgba(37,99,235,0.10), transparent 70%),
    radial-gradient(1000px 800px at 80% 0%, rgba(139,92,246,0.08), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,0.8), rgba(243,244,246,1));
  filter: blur(6px) brightness(1.05);
}

/* =========================
   🧭 HEADER
   ========================= */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 10;
  position: relative;
}

.logo a,
.nav-links a,
.btn-nav {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  margin: 0 8px;
}

/* =========================
   🌙 THEME TOGGLE
   ========================= */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  cursor: pointer;
  transition: all .2s;
}
.theme-toggle:hover {
  background: color-mix(in srgb, var(--primary) 16%, var(--panel-2));
  border-color: color-mix(in srgb, var(--primary) 36%, var(--border));
}
.theme-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--text);
}

/* =========================
   🧰 TOOLS (Editor Toolbar)
   ========================= */
.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.tools button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.tools button:hover {
  background: color-mix(in srgb, var(--primary) 20%, var(--panel-2));
  transform: translateY(-1px);
}
.tools img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* Controls (desno v editorju) */
header .controls {
  display: flex;
  gap: 10px;
  align-items: center;
}
header .controls label {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* START / STOP gumb */
#testBtn {
  background: var(--primary);
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}
#testBtn:hover {
  background: color-mix(in srgb, var(--primary) 80%, black);
}
#testBtn.stop {
  background: #d9534f;
}

/* =========================
   🎨 SORT BAR
   ========================= */
.sortbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--sort-bg);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  margin: 16px 0;
  transition: background .3s ease, color .3s ease;
  font-family: system-ui, sans-serif;
}
.sortbar .label {
  font-weight: 600;
  font-size: 14px;
}
.sortbar a {
  text-decoration: none;
  color: var(--sort-link);
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  transition: all 0.25s ease;
}
.sortbar a.active {
  background: var(--sort-active-bg);
  color: var(--sort-active-text);
}
:root[data-theme="light"] {
  --sort-bg: #f4f4f6;
  --sort-link: #333;
  --sort-active-bg: #e2e8f0;   /* svetlo siva namesto modre */
  --sort-active-text: #111827; /* temno besedilo */
}

:root[data-theme="dark"] {
  --sort-bg: rgba(30, 41, 59, 0.85);
  --sort-link: #e5e7eb;
  --sort-active-bg: #334155;   /* hladno siva v temni temi */
  --sort-active-text: #f3f4f6; /* svetlo besedilo */
}

.sortbar {
  font-size: 13px; /* ↓ manjša pisava */
}

.sortbar span {
  font-size: 12.5px; /* beseda "Razvrsti po:" rahlo manjša */
  opacity: 0.85;
}



/* =========================
   🌍 WORLD CARDS
   ========================= */
.worlds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  padding: 24px;
}
.world-card {
  background: var(--card-bg);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
  border: 1px solid rgba(255,255,255,0.1);
}
.world-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}

/* Header */
.card-header {
  background: var(--card-footer-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  font-weight: 600;
  font-size: 15px;
}
.card-header h3 {
  margin: 0;
  color: color-mix(in srgb, var(--primary-2) 70%, var(--text));
}
.card-header .plays {
  font-size: 13px;
  opacity: 0.8;
  color: var(--muted);
  letter-spacing: 0.3px;
}

/* Naslov v kartici – stalna tvoja modra */
.card-header h3.card-title > a:link,
.card-header h3.card-title > a:visited {
  color: color-mix(in srgb, var(--primary-2) 70%, var(--text)) !important;
  text-decoration: none;
  transition: color .2s ease, text-shadow .2s ease;
}

/* Hover/focus stanje */
.card-header h3.card-title > a:hover,
.card-header h3.card-title > a:focus {
  color: var(--primary) !important;              /* svetlejša modra */
  text-decoration: none;
  text-shadow: 0 0 6px color-mix(in srgb, var(--primary) 35%, transparent);
}

/* Active (klik) – brez vijolične */
.card-header h3.card-title > a:active {
  color: var(--primary-2) !important;
  text-decoration: none;
}


.card-header .plays::before {
  content: "🎮 ";
  opacity: 0.85;
  margin-right: 4px;
  font-size: 14px;
}


/* Thumbnail */
.card-thumbnail {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  border: none;
  border-radius: 12px 12px 0 0;
}
.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  display: block;
  transition: transform 0.3s ease;
  transform: scale(1.05);
}
.world-card:hover .card-thumbnail img {
  transform: scale(1.05);
}

/* Footer */
.card-footer {
  background: var(--card-footer-bg);
  color: var(--card-text);
  padding: 8px 10px 10px;
  font-size: 13px;
}
.author-line {
  display: flex;
  align-items: center;
  gap: 5px;
}
.author-line span {
  color: var(--card-text);
  opacity: 0.9;
}
.author-line a {
  color: color-mix(in srgb, var(--primary-2) 70%, var(--text));
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: color 0.2s ease;
}
.author-line a:hover {
  color: var(--primary-2);
  text-decoration: underline;
}
.record-line {
  margin-top: 3px;
  font-style: italic;
}
.record-line.dimmed {
  opacity: 0.7;
}

/* Light / Dark card variables */
:root[data-theme="light"] {
  --card-bg: #fff;
  --card-footer-bg: #f8f9fb;
  --card-title: #1f2937;
  --card-text: #333;
}
:root[data-theme="dark"] {
  --card-bg: #111827;
  --card-footer-bg: #1e293b;
  --card-title: #e5e7eb;
  --card-text: #d1d5db;
}

/* Buttons (Play/Edit) */
.world-card .actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.world-card .actions a {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  padding: 5px 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.25s ease;
}
.world-card .actions a:first-child {
  margin-right: 4px;
  background: #22c55e;
  color: #fff;
}
.world-card .actions a:last-child {
  margin-left: 4px;
  background: #3b82f6;
  color: #fff;
}
.world-card .actions a:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* =========================
   🎮 EDITOR LAYOUT
   ========================= */
main {
  position: relative;
  z-index: 3;
}

#canvas {
  background: var(--panel-2);
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
  display: block;
  margin: 0px auto;
}

.json-panel {
  display: none;
}

/* =========================
   📱 RESPONSIVE
   ========================= */
@media (max-width: 768px) {
  .theme-toggle { width: 36px; height: 36px; }
  .tools button { width: 32px; height: 32px; }
  .worlds-grid { gap: 16px; padding: 16px; }
}

/* =========================
   🧭 HEADER (header.php)
   ========================= */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px 16px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 10;
  position: relative;
}

.logo a {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-2);
  text-decoration: none;
  transition: color 0.3s ease;
}
.logo a:hover {
  color: var(--primary);
}

/* Navigacija */
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.nav-links a {
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.25s ease;
}
.nav-links a:hover {
  background: color-mix(in srgb, var(--primary) 20%, var(--panel));
}

/* =========================
   🔒 LOGIN BOX
   ========================= */
.login-box {
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Inputi */
.input-nav {
  padding: 6px 10px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.input-nav:focus {
  outline: none;
  border-color: var(--primary);
  background: color-mix(in srgb, var(--panel-2) 80%, var(--primary) 10%);
}

/* Gumbi */
.btn-nav {
  padding: 8px 12px;
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s ease;
}
.btn-nav:hover {
  background: color-mix(in srgb, var(--primary) 25%, var(--panel));
  color: #fff;
}
.btn-nav.logo-btn {
  font-weight: 700;
  font-size: 18px;
}

/* Responsive */
@media (max-width: 800px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .login-inline {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .input-nav {
    width: 100%;
  }
}

/* =========================
   📘 NAVODILA PAGE
   ========================= */
.instructions-container {
  max-width: 900px;
  margin: 40px auto;
  background: color-mix(in srgb, var(--panel-2) 90%, var(--bg) 10%);
  border-radius: 16px;
  padding: 32px 40px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  color: var(--text);
  line-height: 1.6;
}
.instructions-container h1 {
  text-align: center;
  font-size: 1.9rem;
  margin-bottom: 1.5rem;
  color: color-mix(in srgb, var(--primary-2) 75%, var(--text));
}
.instructions-container h2 {
  font-size: 1.3rem;
  margin-top: 1.4rem;
  margin-bottom: .6rem;
  color: var(--primary);
}
.instructions-container h3 {
  font-size: 1.1rem;
  margin-bottom: .4rem;
  color: var(--primary-2);
}
.instructions-container ol,
.instructions-container ul {
  margin-left: 1.4rem;
  margin-bottom: .8rem;
}
.instructions-container li {
  margin-bottom: .4rem;
}
.instructions-container table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: .95rem;
}
.instructions-container th,
.instructions-container td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
}
.instructions-container th {
  background: var(--panel);
  font-weight: 600;
}
.instructions-container code {
  background: var(--panel);
  padding: 2px 5px;
  border-radius: 5px;
  font-family: monospace;
}
.instructions-container a {
  color: var(--primary-2);
  text-decoration: none;
}
.instructions-container a:hover {
  text-decoration: underline;
}
.instructions-container footer {
  text-align: center;
  font-size: 0.85rem;
  margin-top: 2rem;
  color: var(--muted);
}

/* Tool ikone */
.tool-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tool-btn img {
  width: 24px;
  height: 24px;
}

/* =========================
   🎯 PLAY PAGE STYLING
   ========================= */

/* Glavni razpored */
.play-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  padding: 16px 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Platno */
.stage {
  position: relative;
  width: 1024px;
  height: 768px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.overlay {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}

/* Desni stranski panel */
#sidepanel {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

/* Informacijski blok */
#worldInfo {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  line-height: 1.5;
  transition: background 0.3s, border-color 0.3s;
}
#worldInfo b {
  color: var(--primary-2);
}
#worldInfo span,
#worldInfo small {
  color: var(--muted);
}

/* Nastavitve igre */
#settingsForm {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 0.3s ease, border-color 0.3s ease;
}
#settingsForm label {
  font-weight: 500;
  color: var(--text);
}
#settingsForm input,
#settingsForm select {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 6px 10px;
  width: 100%;
}
#settingsForm button[type="submit"] {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}
#settingsForm button[type="submit"]:hover {
  box-shadow: 0 0 15px color-mix(in srgb, var(--primary) 60%, transparent);
  transform: translateY(-1px);
}
#settingsForm button[type="submit"]:active {
  transform: translateY(1px);
}

/* Radio skupine */
.radio-group {
  display: flex;
  justify-content: flex-start;
  gap: 16px;
  margin: 10px 0 14px 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.radio-group input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* Države */
#selectedCountries {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
#selectedCountries img {
  border: 1px solid var(--border);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
#selectedCountries img:hover {
  transform: scale(1.1);
  border-color: var(--primary);
}

/* Dropdown za iskanje države */
#countryDropdown {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 180px;
  overflow-y: auto;
  z-index: 20;
}
#countryDropdown div[data-code] {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}
#countryDropdown div[data-code]:hover {
  background: var(--hover);
}
#countryDropdown img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* Checkbox */
.checkbox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.checkbox input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--panel-2);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}
.checkbox input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.checkbox input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  left: 3px;
  top: -1px;
  font-size: 14px;
  color: #fff;
  font-weight: bold;
}

/* Rezultati */
#resultsBox {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 20px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  font-size: 13px;
  line-height: 1.3;
}
#resultsBox .result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
}
#resultsBox .result-row:last-child {
  border-bottom: none;
}
#resultsBox .left {
  display: flex;
  align-items: center;
  gap: 6px;
}
#resultsBox .left span.position {
  font-size: 11px;
  width: 14px;
  text-align: right;
  color: var(--muted);
}
#resultsBox .left img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  object-fit: cover;
}
#resultsBox .left .name {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#resultsBox .right {
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  color: var(--primary-2);
}

/* Zvezdice */
#rating {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 14px;
}
#rating span {
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
#rating span:hover {
  transform: scale(1.2);
  color: gold;
}
#avgRating {
  text-align: center;
  margin-top: 6px;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Drsnik (število frnikul) */
.slider-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
#countRange {
  flex: 1;
  appearance: none;
  height: 6px;
  background: linear-gradient(to right, var(--primary), #ccc);
  border-radius: 4px;
  cursor: pointer;
}
#countRange::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 4px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}
#countRange::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

/* Responsive */
@media (max-width: 1100px) {
  .play-layout {
    flex-direction: column;
    align-items: center;
  }
  #sidepanel {
    width: 100%;
    max-width: 400px;
  }
}

/* 🎯 Popravek: canvas in overlay popolnoma poravnana */
.stage {
  position: relative;
  display: inline-block;
  line-height: 0; /* prepreči prazen rob zaradi inline-block */
}

.stage canvas {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  border: none;
  margin: 0;
  padding: 0;
}

#canvas, #overlay {
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
}

/* === Modern toggle switch === */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .slider {
  background-color: #0d6efd;
}

.toggle-switch input:checked + .slider:before {
  transform: translateX(18px);
}

/* 🌓 Dark mode */
[data-theme="dark"] .slider {
  background-color: #444;
}

[data-theme="dark"] .toggle-switch input:checked + .slider {
  background-color: #3b82f6;
}

/* 🩵 Manjša pisava in subtilen razmik */
.auto-fill-label {
  font-size: 12.5px;
  color: var(--card-text, #333);
  opacity: 0.85;
}

/* ===== ORODJA ===== */
.tools button {
  background: var(--tool-bg);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 6px;
  margin: 2px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.tools button img {
  width: 22px;
  height: 22px;
  display: block;
  filter: var(--tool-filter);
}

.tools button:hover {
  background: var(--tool-bg-hover);
  transform: translateY(-1px);
}

.tools button:active {
  transform: scale(0.96);
}

/* 🌙 Temna in 🌞 svetla tema */
:root[data-theme="light"] {
  --tool-bg: #f3f4f6;
  --tool-bg-hover: #e5e7eb;
  --tool-active: #dbeafe; /* nežno modro */
  --tool-filter: none;
}

:root[data-theme="dark"] {
  --tool-bg: #2d3748;
  --tool-bg-hover: #4a5568;
  --tool-active: #2563eb33; /* prosojna modra osvetlitev */
  --tool-filter: brightness(1.15);
}

/* ✳️ AKTIVNO orodje */
.tools button.active {
  background: var(--tool-active);
  box-shadow: 0 0 0 2px #3b82f6aa inset;
  transform: translateY(-1px);
}


/* 🔽 Puščice za sortiranje */
.sortbar a.active::after {
  content: attr(data-dir-icon);
  margin-left: 6px;
  font-size: 0.85em;
  opacity: 0.85;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.sortbar a[data-dir="asc"]::after {
  content: "▲";
}

.sortbar a[data-dir="desc"]::after {
  content: "▼";
}

/* =========================
   🔐 AUTH (Login / Register)
   ========================= */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 160px);
  padding: 40px 20px;
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.auth-card h2 {
  margin-bottom: 1.4rem;
  color: var(--primary-2);
  font-size: 1.5rem;
  font-weight: 700;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 500;
  color: var(--text);
  font-size: 0.95rem;
}

.auth-form input {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  background: color-mix(in srgb, var(--panel-2) 80%, var(--primary) 10%);
}

/* 🔧 Majhen gumb [Uredi] ob avtorju */
.edit-small-btn {
  font-size: 9px;
  font-weight: 600;
  color: var(--primary-2);
  background: color-mix(in srgb, var(--panel-2) 85%, var(--primary) 10%);
  border: 1px solid color-mix(in srgb, var(--primary-2) 50%, var(--border) 50%);
  border-radius: 8px;
  padding: 3px 8px;
  margin-left: 8px;
  text-decoration: none; /* 🚫 odstrani podčrtaj */
  transition: all 0.25s ease;
  opacity: 0.95;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.edit-small-btn:hover {
  background: color-mix(in srgb, var(--primary) 30%, var(--panel-2));
  color: #fff;
  border-color: var(--primary);
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 0 6px color-mix(in srgb, var(--primary) 50%, transparent);
  text-decoration: none; /* 🚫 še dodatno, za varnost */
}

.edit-small-btn::before {
  content: "✏️";
  font-size: 11px;
}

/* =========================
   📘 FOOTER PAGE
   ========================= */
.footer-container {
  max-width: 100%;
  margin: 5px auto;
  background: color-mix(in srgb, var(--panel-2) 90%, var(--bg) 10%);
  border-radius: 10px;
  padding: 1px 1px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  color: var(--text);
  line-height: 1.1;
}
.footer-container h1 {
  text-align: center;
  font-size: 1.0rem;
  margin-bottom: 1.5rem;
  color: color-mix(in srgb, var(--primary-2) 75%, var(--text));
}
.footer-container h2 {
  font-size: 1.3rem;
  margin-top: 1.4rem;
  margin-bottom: .6rem;
  color: var(--primary);
}
.footer-container h3 {
  font-size: 1.1rem;
  margin-bottom: .4rem;
  color: var(--primary-2);
}
.footer-container ol,
.footer-container ul {
  margin-left: 1.4rem;
  margin-bottom: .8rem;
}
.footer-container li {
  margin-bottom: .4rem;
}
.footer-container table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: .95rem;
}
.footer-container th,
.footer-container td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
}
.footer-container th {
  background: var(--panel);
  font-weight: 600;
}
.footer-container code {
  background: var(--panel);
  padding: 2px 5px;
  border-radius: 5px;
  font-family: monospace;
}
.footer-container a {
  color: var(--primary-2);
  text-decoration: none;
}
.footer-container a:hover {
  text-decoration: underline;
}
.footer-container footer {
  text-align: center;
  font-size: 0.85rem;
  margin-top: 2rem;
  color: var(--muted);
}

/* 🚫 Globalno izključi podčrtavanje vseh povezav */
a, a:visited, a:hover, a:focus, a:active {
  text-decoration: none !important;
}

:root {
  --title-link: #36A4C1;
  --title-link-hover: #36A4C1;
}

.card-header h3.card-title a,
.card-header h3.card-title a:link,
.card-header h3.card-title a:visited,
.card-header h3.card-title a:focus,
.card-header h3.card-title a:active { color: var(--title-link) !important; }

.card-header h3.card-title a:hover { color: var(--title-link-hover) !important; }

/* === 🔵 GLOBAL BLUE OVERRIDE (vse modre = #36A4C1) === */
:root,
:root[data-theme="light"],
:root[data-theme="dark"] {
  --primary: #36A4C1 !important;
  --primary-2: #36A4C1 !important;

  /* nežni efekti izpeljani iz iste barve */
  --hover: color-mix(in srgb, #36A4C1 18%, transparent) !important;
}

/* Naslov sveta – stalna barva (tudi hover) */
:root {
  --title-link: #36A4C1;
  --title-link-hover: #36A4C1;
}
.card-header h3.card-title a,
.card-header h3.card-title a:link,
.card-header h3.card-title a:visited,
.card-header h3.card-title a:focus,
.card-header h3.card-title a:active {
  color: var(--title-link) !important;
  text-decoration: none !important;
}
.card-header h3.card-title a:hover {
  color: var(--title-link-hover) !important;
  text-decoration: none !important;
}

/* Gumbi in stanja, ki so imeli hard-coded modre */
.world-card .actions a:last-child {           /* prej #3b82f6 */
  background: var(--primary) !important;
  color: #fff !important;
}
.tools button.active {                         /* prej box-shadow s #3b82f6aa */
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 66%, transparent) inset !important;
}

/* Toggle stikalo (prej #0d6efd / #3b82f6) */
.toggle-switch input:checked + .slider {
  background-color: var(--primary) !important;
}
[data-theme="dark"] .toggle-switch input:checked + .slider {
  background-color: var(--primary) !important;
}

/* Ikone/hoverji, ki miksajo na "primary" – naj uporabljajo isti odtenek */
.theme-toggle:hover {
  background: color-mix(in srgb, var(--primary) 16%, var(--panel-2)) !important;
  border-color: color-mix(in srgb, var(--primary) 36%, var(--border)) !important;
}
.nav-links a:hover {
  background: color-mix(in srgb, var(--primary) 20%, var(--panel)) !important;
}
.btn-nav:hover {
  background: color-mix(in srgb, var(--primary) 25%, var(--panel)) !important;
  color: #fff !important;
}
#settingsForm button[type="submit"] {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary) 100%) !important;
}

/* Avtorjeve povezave v kartici – iz iste barve */
.author-line a,
.author-line a:hover {
  color: var(--primary) !important;
  text-decoration: none !important;
}

/* Majhen gumb [Uredi] – obroba/ozadje izpeljana iz iste barve */
.edit-small-btn {
  color: var(--primary) !important;
  background: color-mix(in srgb, var(--panel-2) 85%, var(--primary) 10%) !important;
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border) 50%) !important;
}
.edit-small-btn:hover {
  background: color-mix(in srgb, var(--primary) 30%, var(--panel-2)) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
  box-shadow: 0 0 6px color-mix(in srgb, var(--primary) 50%, transparent) !important;
}

/* Drsniki, rating, itd. že uporabljajo var(--primary) – zdaj so avtomatsko #36A4C1 */

/* Logo poravnava in stil */
.logo .logo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 0;                 /* ne obnaša se kot gumb */
  background: transparent;
  border: 0;
  margin-top: 4px;
}

.logo .logo-link:hover {
  background: transparent;    /* brez hover ozadja */
}

.logo img {
  display: block;
  height: 40px;               /* prilagodi po želji */
  width: auto;
}

/* Če želiš ohraniti tudi tekst kot fallback, ga lahko skriješ vizualno: */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* 🌗 Logo zamenjava glede na temo */
.site-logo {
  display: block;
  height: 40px;       /* prilagodi višino logotipa */
  width: auto;
  transition: opacity 0.3s ease;
}

/* Ko je aktivna svetla tema, zamenjamo sliko */
:root[data-theme="light"] .site-logo {
  content: url("logo2.png");
}

/* (Neobvezno) gladek prehod ob menjavi teme */
html[data-theme="light"] .site-logo,
html[data-theme="dark"] .site-logo {
  transition: opacity 0.3s ease;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  
  background: var(--primary);
.share-btn:hover { background: color-mix(in srgb, var(--primary) 80%, black); }
  
  
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.share-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.share-btn:hover {
  background: #0d65d9;
  transform: translateY(-1px);
}


