/* ============================================================
   OGÓLNE STYLE
   ============================================================ */

:root {
  --bg: #d7d8ba;
  --card: #fff;
  --muted: #6b7280;
  --accent: #ef4444;
}

* {
  box-sizing: border-box;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

body {
  margin: 0;
  background: var(--bg);
  color: #111;
}

label {
  display: block;
  margin: 8px 0;
}

input,
textarea,
select {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.btn {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.ghost {
  background: transparent;
  border: 1px solid #e5e7eb;
}

.btn.danger {
  background: #fee2e2;
  color: #991b1b;
}

/* ============================================================
   WIDOK PUBLICZNY MAPY
   ============================================================ */

#mapTitle {
    font-size: 2.4rem;
    font-weight: 500;
    color: #2b2a28;
    letter-spacing: 0.5px;
    text-transform: none;
    text-align: center;
    margin: 32px 0 40px;
    position: relative;
    font-family: "Playfair Display", Georgia, serif;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* delikatna linia dekoracyjna pod tytułem */
#mapTitle::after {
    content: "";
    display: block;
    width: 80px;
    height: 3px;
    margin: 12px auto 0;
    background: linear-gradient(90deg, #bca77c, #dfd4bb, #bca77c);
    border-radius: 2px;
}


.public.container {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 0;
  min-height: calc(100vh - 64px);
}

/* --- Sekcja opisu --- */
.public .desc {
  position: relative;
  width: 35%;
  height: 70vh;
  background: rgba(255, 255, 255, 0.97);
  padding: 48px 44px;
  border-radius: 22px;
  overflow-y: auto;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08), inset 0 2px 8px rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  align-self: center;
  scroll-padding-bottom: 60px;
  transition: box-shadow 0.3s ease, transform 0.3s ease, background 0.3s ease;
  text-align: justify;          
  text-justify: inter-word;
}

/* efekt “światła” */
.public .desc:hover {
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.08),
    0 4px 10px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.98);
}

/* cienka ramka wewnętrzna */
.public .desc::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

/* ---------- Scrollbar: CSS-only ---------- */

/* WebKit browsers (Chrome, Safari, Edge Chromium) */
.public .desc::-webkit-scrollbar {
  width: 16px;
}

.public .desc::-webkit-scrollbar-track {
  background: linear-gradient(180deg, #f9f6ef 0%, #f1ece2 100%);
  border-left: 1px solid rgba(180, 170, 150, 0.25);
  border-radius: 12px;
  margin: 8px 0;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.04);
}

.public .desc::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d7d2c8 0%, #c2b9aa 45%, #b6ab9b 100%);
  border: 1px solid rgba(120, 110, 90, 0.4);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 2px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.12);
  transition: all 0.18s ease;
}

.public .desc::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #e0d9cc 0%, #cabfae 45%, #bbae9b 100%);
  border-color: rgba(100, 90, 70, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 2px 4px rgba(0, 0, 0, 0.14);
}

.public .desc::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, #c8bfae 0%, #b2a692 100%);
}

/* Firefox */
.public .desc {
  scrollbar-width: thin;
  scrollbar-color: #b6a88e #f7f3e8;
}

/* --- Tekst opisu --- */
.public .desc h3 {
  font-size: 1.55rem;
  font-weight: 600;
  color: #181818;
  margin-bottom: 1rem;
  letter-spacing: -0.2px;
}

.public .desc p {
  color: #333;
  line-height: 1.7;
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* --- Obszar mapy --- */
.public .mapArea {
  width: 65%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.public .canvas {
  position: relative;
  background: var(--bg);
  overflow: visible;
  width: 100%;
}

.public .canvas > img {
  width: 100%;
  height: auto;
  display: block;
}

/* --- Hotspoty i tooltip --- */

.hotspot {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 10;
    opacity: 0.35;
    transition:
        opacity 0.35s ease,
        transform 0.35s ease,
        box-shadow 0.35s ease,
        background-color 0.5s ease;
    /* 🔹 płynna zmiana koloru */
}

/* Aktywne / kliknięte */
.hotspot.active {
    outline: 3px solid rgba(239, 68, 68, 0.18);
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    background: rgba(239, 68, 68, 0.8);
}

/* Efekt po najechaniu */
.hotspot:hover {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    background: #ff4a4a;
    /* 🔹 zmiana koloru z płynnym przejściem */
}

/* --- Tooltip elegancki, z animacją --- */

/* -------------- tooltip (jeśli wewnątrz .hotspot) --------------- */
.tooltip {
  position: absolute;
  left: 24px;
  top: -6px;
  padding: 6px;
  background: #fffdf4;        /* bez zmian, jak prosiłeś */
  border-radius: 10px;
  border: 1px solid rgba(160,150,120,0.35);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.4);
  z-index: 999;
  pointer-events: none;      /* zapobiega migotaniu przy hover */
  /* crucial: nie używaj display do show/hide */
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity 0.38s ease, transform 0.38s cubic-bezier(.22,1,.36,1);
  will-change: opacity, transform;
}

/* visible state - używane gdy tooltip ma być widoczny */
.tooltip.visible,
.hotspot:hover .tooltip {    /* zachowujemy też selektor hover jeśli tooltip jest w DOMie jako child */
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 0.08s; /* lekkie opóźnienie wejścia */
}

/* delikatne opóźnienie wygasania - ustawiamy tylko transition-delay przy wyjściu jeśli chcemy */
.tooltip.hiding {
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  transition-delay: 0s;
}

/* image - bez wymuszania rozmiaru (pełny rozmiar pliku) */
.tooltip img {
  display: block;
  object-fit: contain;
  border-radius: 6px;
}


/* ============================================================
   PANEL ADMINISTRACYJNY
   ============================================================ */

main.admin-container {
  display: flex;
  gap: 20px;
  padding: 20px;
  align-items: flex-start;
}

aside.sidebar {
  width: 260px;
  background: var(--card);
  padding: 16px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.04);
}

.map-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.canvas-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

/* --- Wyświetlanie tła mapy --- */
#canvas {
  position: relative;
  width: 100%;
  min-height: 480px;
  background: none !important;
  border-radius: 12px;
  overflow: visible;
}

#canvas img#bgImage {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  position: relative;
  z-index: 0;
  background: #fdfae9;
  border-radius: 12px;
}

.admin-point {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  z-index: 10;
}

/* --- Panel boczny --- */
.panel {
  width: 300px;
  background: var(--card);
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.04);
}

#mapsList {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
}

#mapsList .map-item {
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
}

#mapsList .map-item.active {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.08);
}

/* --- Modal --- */
.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999 !important;
  pointer-events: auto;
}

.modal-content {
  position: relative;
  z-index: 100000 !important;
  background: var(--card);
  padding: 18px;
  border-radius: 12px;
  width: 520px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  animation: fadeInUp 0.25s ease;
}

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

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ============================================================
   LOGIN / KARTY
   ============================================================ */
.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.card {
  background: var(--card);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.06);
  width: 360px;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #333;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  z-index: 999999;
}

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

.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
.toast.info { background: #2563eb; }


/* ============================================================
   RESPONSYWNOŚĆ
   ============================================================ */
@media (max-width: 1024px) {
  .public.container {
    flex-direction: column-reverse;
  }

  .public .mapArea,
  .public .desc {
    width: 100%;
  }

  .public .desc {
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    margin-top: 16px;
  }
}

@media (max-width: 900px) {
  .canvas {
    min-height: 300px;
  }
}

/* Upewniamy się, że cała aplikacja mieści się w oknie przeglądarki */
html, body {
  margin: 0;
  height: 100vh;
  overflow: hidden; /* usuwa globalny pionowy suwak */
}



