/* =========================================================
   Rapalska meja – Urejevalnik  |  Skupna oblika
   ========================================================= */

/* ── Temna tema (privzeto) ───────────────────────────────── */
:root {
  --bg:       #0f1117;
  --bg2:      #181c27;
  --bg3:      #1f2535;
  --border:   #2d3450;
  --border2:  #3d4870;
  --accent:   #4a7fa5;
  --accent2:  #5a9ec7;
  --accent-glow: rgba(74,127,165,.18);
  --gold:     #c8a84b;
  --gold2:    #e2c97e;
  --red:      #c0392b;
  --red2:     #e74c3c;
  --green:    #27ae60;
  --green2:   #2ecc71;
  --yellow:   #e67e22;
  --text:     #d8e0f0;
  --text2:    #8892b0;
  --text3:    #5a6480;
  --radius:   6px;
  --radius2:  10px;
  --shadow:   0 4px 24px rgba(0,0,0,.45);
  --font:     'Source Serif 4', Georgia, serif;
  --mono:     'JetBrains Mono', 'Courier New', monospace;
}

/* ── Svetla tema ─────────────────────────────────────────── */
html.light {
  --bg:       #f4f5f7;
  --bg2:      #ffffff;
  --bg3:      #eaecf2;
  --border:   #d0d4e0;
  --border2:  #b8bdd0;
  --accent:   #2d6e9e;
  --accent2:  #1a5c8a;
  --accent-glow: rgba(45,110,158,.12);
  --gold:     #a07828;
  --gold2:    #c89830;
  --red:      #b02020;
  --red2:     #c0392b;
  --green:    #1e8c4e;
  --green2:   #27ae60;
  --yellow:   #c96a00;
  --text:     #1a1f2e;
  --text2:    #3a4260;
  --text3:    #7a849a;
  --shadow:   0 4px 24px rgba(0,0,0,.12);
}

/* ── Theme toggle gumb ───────────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border2);
  color: var(--text2);
  border-radius: 20px;
  padding: .22rem .55rem;
  cursor: pointer;
  font-size: .85rem;
  line-height: 1;
  transition: all .15s;
  font-family: var(--font);
}
.theme-toggle:hover { background: var(--bg3); color: var(--text); }

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

/* Gladek prehod med temama */
body, .navbar, .sidebar, .edit-panel, .map-panel, .admin-sidebar, .admin-content,
.card, .field-row, .modal, .login-card, input, select, textarea, .btn {
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

html { font-size: 15px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Tipografija ─────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font); font-weight: 600; line-height: 1.2; }
h1 { font-size: 1.6rem; letter-spacing: .01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
a  { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navigacija ──────────────────────────────────── */
.navbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: .65rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.35);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: .03em;
  white-space: nowrap;
}
.navbar-brand .dot {
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  display: inline-block;
}
.navbar-spacer { flex: 1; }
.navbar-user {
  font-size: .85rem;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.navbar-user strong { color: var(--text); }
.nav-links { display: flex; gap: .25rem; }
.nav-link {
  padding: .35rem .75rem;
  border-radius: var(--radius);
  font-size: .85rem;
  color: var(--text2);
  cursor: pointer;
  transition: background .15s, color .15s;
  border: none;
  background: none;
  font-family: var(--font);
}
.nav-link:hover { background: var(--bg3); color: var(--text); }
.nav-link.active { background: var(--accent-glow); color: var(--accent2); }

/* ── Gumbi ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) { background: var(--accent2); border-color: var(--accent2); }
.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--border2);
}
.btn-secondary:hover:not(:disabled) { background: var(--border); }
.btn-danger {
  background: transparent;
  color: var(--red2);
  border-color: var(--red);
}
.btn-danger:hover:not(:disabled) { background: rgba(192,57,43,.15); }
.btn-success {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.btn-success:hover:not(:disabled) { background: var(--green2); }
.btn-gold {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}
.btn-gold:hover:not(:disabled) { background: rgba(200,168,75,.1); }
.btn-sm { padding: .28rem .65rem; font-size: .8rem; }
.btn-xs { padding: .2rem .45rem; font-size: .75rem; }

/* ── Formulari ───────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: .8rem;
  color: var(--text2);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}
.form-group .field-desc {
  font-size: .78rem;
  color: var(--text3);
  margin-top: .25rem;
}
input, select, textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: var(--radius);
  padding: .5rem .75rem;
  font-size: .9rem;
  font-family: var(--font);
  transition: border .15s, box-shadow .15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea { resize: vertical; min-height: 90px; }
select { cursor: pointer; }
input[type="file"] {
  padding: .4rem;
  cursor: pointer;
}
.current-val {
  font-size: .82rem;
  color: var(--text3);
  margin-bottom: .3rem;
  padding: .3rem .6rem;
  background: var(--bg);
  border-radius: 4px;
  border-left: 2px solid var(--border2);
}
.current-val span { color: var(--text2); }

/* ── Kartice ─────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  overflow: hidden;
}
.card-header {
  padding: .85rem 1.2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.card-header h2, .card-header h3 {
  font-size: 1rem;
  color: var(--text);
}
.card-header .card-actions { margin-left: auto; display: flex; gap: .5rem; }
.card-body { padding: 1.2rem; }

/* ── Badge ───────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 20px;
  font-size: .73rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-pending  { background: rgba(230,126,34,.15);  color: var(--yellow); border: 1px solid rgba(230,126,34,.3); }
.badge-approved { background: rgba(39,174,96,.12);   color: var(--green2); border: 1px solid rgba(39,174,96,.3); }
.badge-rejected { background: rgba(192,57,43,.12);   color: var(--red2);   border: 1px solid rgba(192,57,43,.3); }
.badge-count {
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  padding: .1rem .45rem;
  font-size: .72rem;
  font-weight: 700;
}

/* ── Tabele ──────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th {
  text-align: left;
  padding: .6rem .9rem;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: .65rem .9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ── Obvestila ───────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}
.alert-success { background: rgba(39,174,96,.1);  color: var(--green2); border: 1px solid rgba(39,174,96,.25); }
.alert-error   { background: rgba(192,57,43,.1);  color: var(--red2);   border: 1px solid rgba(192,57,43,.25); }
.alert-info    { background: rgba(74,127,165,.1); color: var(--accent2);border: 1px solid rgba(74,127,165,.25); }
.alert-warn    { background: rgba(230,126,34,.1); color: var(--yellow); border: 1px solid rgba(230,126,34,.25); }

/* ── Toast obvestila ─────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
.toast {
  padding: .75rem 1.15rem;
  border-radius: var(--radius);
  font-size: .875rem;
  box-shadow: var(--shadow);
  animation: slideIn .25s ease;
  pointer-events: all;
  max-width: 320px;
}
.toast-success { background: #1a3a2a; color: var(--green2); border: 1px solid rgba(46,204,113,.3); }
.toast-error   { background: #2d1515; color: var(--red2);   border: 1px solid rgba(231,76,60,.3); }
.toast-info    { background: #162232; color: var(--accent2);border: 1px solid rgba(90,158,199,.3); }
@keyframes slideIn {
  from { opacity:0; transform: translateX(20px); }
  to   { opacity:1; transform: translateX(0); }
}

/* ── Modal ───────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 1.05rem; }
.modal-close {
  background: none; border: none;
  color: var(--text2); cursor: pointer;
  font-size: 1.3rem; line-height: 1;
  padding: .1rem .3rem;
  border-radius: 4px;
}
.modal-close:hover { background: var(--bg3); color: var(--text); }
.modal-body   { padding: 1.25rem; }
.modal-footer { padding: .9rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: .5rem; justify-content: flex-end; }

/* ── Nalagalec slik ──────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  color: var(--text2);
  font-size: .875rem;
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent2);
}
.upload-area input { display: none; }

/* ── Slike gallery ───────────────────────────────── */
.img-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: .6rem;
}
.img-thumb {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 1;
  cursor: pointer;
  transition: border-color .15s;
}
.img-thumb:hover { border-color: var(--accent2); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── Razno ───────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 1rem 0; }
.text-muted { color: var(--text2); }
.text-small { font-size: .82rem; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.ml-auto { margin-left: auto; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 2rem; color: var(--text3); gap: .6rem;
  font-size: .9rem;
}
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text3);
  font-size: .9rem;
}
.empty-state .icon { font-size: 2rem; margin-bottom: .5rem; }

/* ── Iskalno polje ───────────────────────────────── */
.search-box {
  position: relative;
}
.search-box input {
  padding-left: 2rem;
}
.search-box::before {
  content: '⌕';
  position: absolute;
  left: .6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 1.1rem;
  pointer-events: none;
}

/* ── Checkbox ────────────────────────────────────── */
input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 700px) {
  h1 { font-size: 1.25rem; }
  .navbar { padding: .5rem .9rem; }
  .hide-mobile { display: none !important; }
}
