/* ===== ROOT VARIABLES ===== */
:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --card: #1a1a1a;
  --border: #2a2a2a;
  --accent: #e8c840;
  --accent2: #ff5f1f;
  --text: #f0ede6;
  --muted: #888;
  --green: #3ddc84;
}

/* ===== RESET ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-full {
  height: 44px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}
.logo-icon {
  height: 36px;
  width: auto;
  object-fit: contain;
  display: none;
}

nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}
nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.2s;
}
nav a:hover { color: var(--text); }
nav a.active { color: var(--accent) !important; }

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* ===== BUTTONS ===== */
.btn {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 0.55rem 1.4rem;
  font-family: "DM Sans", sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: 0.2s;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: #f5d840; transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
  transform: none;
}
.btn-sm { padding: 0.4rem 1rem; font-size: 0.8rem; }

/* ===== HAMBURGER ===== */
#hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* ===== MOBILE MENU ===== */
#mobileMenu {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: rgba(10,10,10,0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
  gap: 1rem;
  z-index: 99;
}
#mobileMenu a {
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
#mobileMenu a:last-of-type { border-bottom: none; }
#mobileMenu a.active { color: var(--accent); }
#mobileAuthButtons {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
#mobileAuthButtons .btn { flex: 1; text-align: center; }

/* ===== FOOTER ===== */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
}
.footer-logo {
  margin-bottom: 0.75rem;
}
.footer-logo img {
  height: 48px;
  width: auto;
  object-fit: contain;
}
.footer-desc { color: var(--muted); font-size: 0.875rem; line-height: 1.7; }
.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 1rem;
}
.footer-col a {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: "Space Mono", monospace;
}

/* ===== SECTION TITLES ===== */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.section-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.05em;
}
.section-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ===== LISTING CARD ===== */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.listing-card {
  background: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: 0.25s;
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
}
.listing-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.listing-img {
  height: 180px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.listing-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.listing-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(232,200,64,0.08));
}
.listing-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.listing-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.listing-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  line-height: 1.3;
}
.listing-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.listing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.listing-price {
  font-family: "Space Mono", monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}
.listing-location {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.status-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.5rem;
}
.status-novo { background: var(--green); color: #000; }
.status-polovno { background: var(--accent2); color: #fff; }
.status-hitno { background: #ff1f1f; color: #fff; animation: pulse 1.5s infinite; }

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

.favorite-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.6);
  border: none;
  color: var(--muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: 0.2s;
  z-index: 2;
}
.favorite-btn:hover { color: #ff5f5f; background: rgba(0,0,0,0.8); }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 2.5rem;
  width: 90%;
  max-width: 480px;
  position: relative;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.25rem;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--text); }
.modal h3 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: "DM Sans", sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: 0.2s;
  margin-bottom: -1px;
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ===== FORMS ===== */
.form-input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.85rem 1rem;
  font-family: "DM Sans", sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--muted); }
textarea.form-input { resize: vertical; min-height: 100px; }
.form-group { display: flex; flex-direction: column; gap: 0.75rem; }
.form-row { display: flex; gap: 0.75rem; }
.form-row .form-input { flex: 1; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--green);
  color: #000;
  padding: 1rem 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  z-index: 9000;
  transform: translateY(100px);
  opacity: 0;
  transition: 0.3s;
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ===== SEARCH BAR ===== */
.search-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}
.search-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.search-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.85rem 1.25rem;
  font-family: "DM Sans", sans-serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus { border-color: var(--accent); }
.filter-select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.85rem 1.25rem;
  font-family: "DM Sans", sans-serif;
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  min-width: 160px;
}

/* ===== PAGE HEADER ===== */
.page-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 3rem 2rem;
}
.page-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.page-hero h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: 0.02em;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.page-hero h1 em { font-style: normal; color: var(--accent); }
.page-hero p { color: var(--muted); font-size: 1rem; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
  font-family: "Space Mono", monospace;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text); }

/* ===== PAGINATION ===== */
.paginacija {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.paginacija button {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-family: "Space Mono", monospace;
  font-size: 0.8rem;
  transition: 0.2s;
}
.paginacija button:hover,
.paginacija button.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* ===== CATEGORY SLIDER ===== */
.cat-slider-wrap { position: relative; padding: 0; overflow: visible; }
.cat-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: 0.2s;
}
.cat-slider-btn:hover { border-color: var(--accent); color: var(--accent); }
.cat-slider-btn.left { left: -24px; }
.cat-slider-btn.right { right: -24px; }
.cat-grid {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 4px 0;
}
.cat-grid::-webkit-scrollbar { display: none; }
.cat-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1.75rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
  text-decoration: none;
  color: var(--text);
  display: block;
  flex: 0 0 130px;
  min-width: 130px;
}
.cat-card:hover {
  border-color: var(--accent);
  background: rgba(232,200,64,0.05);
  transform: translateY(-2px);
}
.cat-icon { display: block; margin: 0 auto 0.75rem; width: 44px; height: 44px; }
.cat-icon svg { width: 100%; height: 100%; }
.cat-name { font-size: 0.85rem; font-weight: 600; }
.cat-count { font-size: 0.72rem; color: var(--muted); margin-top: 0.3rem; font-family: "Space Mono", monospace; }

/* ===== HERO SLIDER ===== */
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease-in-out; }
.hero-slide.active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; filter: contrast(1.05) brightness(0.9); }
.slide-fade-left { position: absolute; top: 0; left: 0; bottom: 0; width: 40px; background: linear-gradient(to right, var(--bg), transparent); z-index: 2; }
.slide-fade-top { position: absolute; top: 0; left: 0; right: 0; height: 40px; background: linear-gradient(to bottom, var(--bg), transparent); z-index: 2; }
.slide-fade-bottom { position: absolute; bottom: 0; left: 0; right: 0; height: 40px; background: linear-gradient(to top, var(--bg), transparent); z-index: 2; }
.slide-fade-right { position: absolute; top: 0; right: 0; bottom: 0; width: 40px; background: linear-gradient(to left, var(--bg), transparent); z-index: 2; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .logo-full { display: none; }
  .logo-icon { display: block; }
  nav { display: none; }
  #hamburger { display: block; }

  .listing-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .cat-slider-btn { display: none; }
  .cat-slider-wrap { padding: 0; }
}

@media (max-width: 600px) {
  header { padding: 0 1rem; height: 56px; }
  #authButtons { gap: 0.4rem; }
  #authButtons .btn, #userButtons .btn { padding: 0.4rem 0.75rem; font-size: 0.75rem; }
  .listing-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
  .section-header { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
  .search-inner { flex-direction: column; padding: 0 1rem; }
  .search-input, .filter-select { width: 100%; min-width: unset; }
  .logo img { height: 32px; }
  #mobileMenu { top: 56px; }
}
