/* Reset globalny */
*,
*::after,
*::before {
  box-sizing: border-box;
}

:root {
  --sidebar-w: 20rem;
  --sidebar-right-w: 0;
  --header-h: 3rem;
  --sidebar-right-mobile: 0;

  --teal: #2e9a92;
  --orange: #ff4714;
  --pink: #e5027e;
  --violet-200: #37173f;
  --violet-400: #442563;
  --violet-600: #13100d;
  @media (height < 700px) {
    --header-h: 2.5rem;
  }
  @media (width > 1200px) {
    --sidebar-w: 30rem;
  }
}

body.results-open:not(:has(#results-list:empty)) {
  --sidebar-right-w: 20rem;
  --sidebar-right-mobile: auto;
}

/* Podstawowe style html/body */
html,
body {
  margin: 0;
  padding: 0;
  height: 100dvh;
  font-family: "Acumin Pro", "Acumin", Arial, sans-serif !important;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  background-color: var(--orange);

  @media (width > 800px) {
    max-height: 100vh;
    overflow: hidden;
  }
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
}

h4 {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}
/* Main / sidebar */
.main-content {
  display: grid;
  grid-template-areas:
    "top-bar"
    "aside"
    "sidebar-right"
    "main";
  grid-template-rows: 0 1fr var(--sidebar-right-mobile) 80vh;
  grid-template-columns: 1fr;
  aside {
    overflow: auto;
    grid-area: aside;
  }

  .top-bar {
    grid-area: top-bar;
    padding: 0.5rem 1rem;
    justify-content: end;
    display: flex;
    button {
      display: none;
    }
  }

  .sidebar-right {
    grid-area: sidebar-right;
  }

  main {
    grid-area: main;
  }

  @media (width > 800px) {
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    grid-template-areas:
      "aside top-bar top-bar"
      "aside main sidebar-right";
    grid-template-rows: var(--header-h) 1fr;
    grid-template-columns: var(--sidebar-w) 1fr var(--sidebar-right-w);
    .top-bar {
      button {
        display: block;
      }
    }
  }

  > * {
    overflow: hidden;
  }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-right-extension {
  position: absolute !important;
  top: 0;
  right: 0;
  height: var(--header-h) !important;
  width: var(--bar-collapsed);
  background: var(--violet-200);
  z-index: 1000 !important;
  pointer-events: none;
  transition: width 0.3s ease;
}

.sidebar-right {
  background-color: var(--orange);
  color: #ffffff;
  z-index: 1;
}

/* Info bar */
.info-bar {
  background-color: var(--orange);
  color: #ffffff;
  text-align: center;
  padding: 8px 16px;
  font-size: 1rem;
}

/* Footer */
footer {
  background-color: var(--violet-200);
  color: #fff;
  text-align: center;
  padding: 4px;
  font-size: 0.9rem;
  flex-shrink: 0;
  width: 100%;
}

/* Sidebar wyników */
#sidebarResults {
  background: var(--violet-200);
  color: #fff;
  overflow: auto;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

#sidebarResults.visible {
  transform: translateX(0);
}

/* Map container */
#map {
  width: 100% !important;
  flex: 1 1 auto;
  z-index: 0;
  height: 100vh;
}

/* Popup styles */
.leaflet-popup-content {
  line-height: 1.4;
}

.leaflet-popup-content .popup-title {
  margin: 0 0 8px 0;
  font-weight: 700;
  font-size: 0.95rem;
}

.leaflet-popup-content .type-badge {
  display: block;
  width: 100%;
  margin: 6px 0 12px 0;
  text-align: center;
  border-radius: 6px;
}

.leaflet-popup-content .popup-body p {
  margin: 6px 0;
  font-size: 0.8rem;
}

.leaflet-popup-content .popup-icons {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.leaflet-popup-content .help-icons img,
.result-content .contact-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.popup-body .contact-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 6px;
}

/* About page */
.about-link {
  text-align: center;
  margin-top: 24px;
  margin-bottom: 24px;
  font-size: 0.95rem;
  text-decoration: underline;
  color: #555;
}
.about-link a {
  color: inherit;
}

.about-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 16px;
  font-size: 1.05rem;
  line-height: 1.6;
}
.about-page h1,
.about-page h2 {
  margin-top: 2em;
  font-weight: bold;
}
.about-page ul {
  margin-left: 1.2em;
  padding-left: 0;
}
.about-page a {
  color: var(--teal);
  text-decoration: underline;
}
.about-page a:hover {
  text-decoration: none;
}
.about-page details summary {
  cursor: pointer;
  font-weight: bold;
  margin-top: 1em;
}
.about-page .thanks {
  margin-top: 3em;
  font-style: italic;
  text-align: center;
  font-size: 1.1rem;
}

.partners {
  margin-top: 48px;
  text-align: center;
  font-size: 1rem;
  color: #fff;
}

.partners .logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.partners img {
  max-height: 70px;
  max-width: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.desktop-only {
  display: inline-flex;
}
.mobile-only {
  display: none !important;
}

/* WRAPPER INPUTA musi mieć relative */
.input-col {
  position: relative;
}

/* LISTA SUGGESTIONS */
.suggestions-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 100%; /* pod inputem */
  left: 0;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  background: #fff; /* kontrast */
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  color: #333; /* widoczny tekst */
  display: none; /* domyślnie ukryte */
  font-family: "Arial", sans-serif;
  &:empty {
    border-color: transparent;
    background-color: transparent;
  }
}

.suggestions-list li {
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.2s;
  color: #333; /* widoczny tekst */
}

.suggestions-list li:hover,
.suggestions-list li.active {
  background-color: #f0f0f0;
}

/* --- SHOW PO FOCUS --- */
.input-col input:focus + .suggestions-list {
  display: block;
}

/* --- DESKTOP --- */
@media (min-width: 769px) {
  .suggestions-list {
    font-size: 16px;
    border-color: #5f2b75;
  }
  .suggestions-list li:hover {
    background-color: #e5d4f0;
  }
}

/* --- MOBILE --- */
@media (max-width: 768px) {
  .suggestions-list {
    font-size: 14px;
    max-height: 180px;
    border-color: #e5007e;
  }
  .suggestions-list li {
    padding: 12px 16px;
  }
}
