/* ============================================
   custom.css — ogloszenia.wln.pl
   ============================================ */

/* —— 1. ZMIENNE KOLORÓW ——————————————————————————————— */
:root {
  --c-primary:   #2563eb;
  --c-primary-h: #1d4ed8;
  --c-primary-bg:#eff6ff;
  --c-success:   #16a34a;
  --c-muted:     #6b7280;
  --c-border:    #e5e7eb;
  --c-surface:   #f9fafb;
  --c-text:      #111827;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
}

/* —— 2. GLOBALNE ————————————————————————————————————— */
body {
  background: #f3f4f6;
  color: var(--c-text);
  font-size: 15px;
}

/* —— 3. NAVBAR —————————————————————————————————————— */
.navbar {
  background: #fff !important;
  border-bottom: 1px solid var(--c-border);
  box-shadow: none;
  padding: 0.5rem 1rem;
}

.navbar-brand {
  font-weight: 600;
  font-size: 17px;
  color: var(--c-primary) !important;
  display: flex;
  align-items: center;
  gap: 6px;
}

.navbar-brand .bi-geo-alt-fill {
  font-size: 18px;
}

.navbar .nav-link {
  color: var(--c-muted) !important;
  font-size: 14px;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}

.navbar .nav-link:hover {
  background: var(--c-primary-bg);
  color: var(--c-primary) !important;
}

.navbar .btn-primary {
  background: var(--c-primary);
  border-color: var(--c-primary);
  font-size: 13px;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
}

.navbar .btn-primary:hover {
  background: var(--c-primary-h);
  border-color: var(--c-primary-h);
}

.navbar .nav-link.btn,
a.nav-link[href*="login"],
a.nav-link[href*="loguj"] {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  color: var(--c-text) !important;
  font-size: 13px;
}

/* —— 4. HERO / NAGŁÓWEK STRONY ————————————————————— */
.filter-bar {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  padding: 1.25rem 1.5rem !important;
  margin-bottom: 1rem !important;
}

.filter-bar::before {
  content: "Znajdź ogłoszenie w swoim regionie";
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 0.75rem;
}

#filterForm .form-control,
#filterForm .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--c-border);
  font-size: 14px;
  height: 40px;
  background: var(--c-surface);
}

#filterForm .form-control:focus,
#filterForm .form-select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#filterForm .btn-primary,
#filterForm button[type="submit"] {
  background: var(--c-primary);
  border-color: var(--c-primary);
  border-radius: var(--radius-sm);
  height: 40px;
  font-size: 14px;
  font-weight: 500;
  padding: 0 20px;
}

#filterForm .btn-primary:hover {
  background: var(--c-primary-h);
}

/* —— 5. MAPA ——————————————————————————————————————— */
#map {
  height: 280px !important;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  overflow: hidden;
}

.col-lg-8:has(#map) {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* —— 6. PANEL BOCZNY ———————————————————————————————— */
.col-md-4 {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  padding: 1rem !important;
}

.col-md-4 h5,
.col-md-4 .fw-bold {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--c-border);
}

#latestList > div,
#latestList > a,
.col-md-4 .list-group-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 13px;
}

#latestList > div:last-child,
#latestList > a:last-child {
  border-bottom: none;
}

/* —— 7. SEKCJA NAJNOWSZYCH OGŁOSZEŃ ———————————————— */
#adsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 0.5rem;
}

#adsGrid > div,
#adsGrid > a {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: var(--c-text);
  display: block;
}

#adsGrid > div:hover,
#adsGrid > a:hover {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.06);
}

/* —— 8. NAGŁÓWEK SEKCJI OGŁOSZEŃ ——————————————————— */
h2.h5,
section > h2,
.container h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 0.75rem;
}

a[href*="ogloszenia"],
.btn-outline-primary {
  border-radius: var(--radius-sm);
  font-size: 13px;
}

/* —— 9. BADGE KATEGORII ——————————————————————————— */
.badge,
span.badge {
  font-size: 11px;
  font-weight: 500;
  border-radius: 20px;
  padding: 3px 9px;
}

.badge.bg-primary,
span.badge.bg-primary {
  background: var(--c-primary-bg) !important;
  color: var(--c-primary) !important;
}

.badge.bg-secondary,
span.badge.bg-secondary {
  background: #f3f4f6 !important;
  color: var(--c-muted) !important;
}

/* —— 10. BADGE "NOWE" ————————————————————————————— */
#newBadge,
.badge-new {
  background: #dcfce7 !important;
  color: #15803d !important;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

/* —— 11. EMPTY STATE ————————————————————————————— */
#adsGrid:empty::after,
#adsGrid > p:only-child {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--c-muted);
  font-size: 14px;
}

#adsGrid:empty {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  background: #fff;
  border: 1px dashed var(--c-border);
  border-radius: var(--radius-md);
}

#adsGrid:empty::after {
  content: "Brak ogłoszeń w tej kategorii. Bądź pierwszy — dodaj ogłoszenie!";
  font-size: 14px;
  color: var(--c-muted);
  max-width: 280px;
  line-height: 1.6;
}

/* —— 12. FOOTER ————————————————————————————————— */
footer {
  background: #1e293b !important;
  color: #94a3b8;
  border-top: none;
}

footer h5,
footer .fw-bold {
  color: #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

footer a {
  color: #94a3b8 !important;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.15s;
}

footer a:hover {
  color: #e2e8f0 !important;
}

footer p,
footer small {
  font-size: 12px;
  color: #64748b;
}

/* —— 13. RESPONSYWNOŚĆ —————————————————————————— */
@media (max-width: 768px) {
  #map {
    height: 220px !important;
  }

  .filter-bar {
    padding: 1rem !important;
  }

  .filter-bar::before {
    font-size: 16px;
  }

  #adsGrid {
    grid-template-columns: 1fr;
  }

  .col-md-4 {
    margin-top: 1rem;
  }
}

/* —— 14. ANIMACJA WEJŚCIA KART ————————————————— */
#adsGrid > div,
#adsGrid > a {
  animation: fadeUp 0.25s ease both;
}

#adsGrid > *:nth-child(1) { animation-delay: 0.05s; }
#adsGrid > *:nth-child(2) { animation-delay: 0.10s; }
#adsGrid > *:nth-child(3) { animation-delay: 0.15s; }
#adsGrid > *:nth-child(4) { animation-delay: 0.20s; }

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