/* Osnovni stilovi */
html, body, *, *::before, *::after {
  box-sizing: border-box;
}
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  background: #f7f9fb;
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
}

/* Top bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-auth {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-link {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}
.login-link:hover {
  text-decoration: underline;
}

/* Jezički meni */
.lang-switcher {
  position: relative;
}
.lang-globe-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5em;
  color: #1e90ff;
  padding: 0 7px;
}
.lang-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 110%;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 24px #1e90ff22;
  min-width: 150px;
  z-index: 100;
  padding: 8px 0;
}
.lang-dropdown.open {
  display: block;
}
.lang-dropdown a {
  display: block;
  padding: 10px 20px;
  color: #222;
  text-decoration: none;
  font-size: 1em;
  transition: background 0.13s;
}
.lang-dropdown a:hover,
.lang-dropdown a.active {
  background: #f7f9fb;
  color: #1e90ff;
}

/* Layout stranice */
.page-layout {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

/* Sidebar */
.sidebar {
  position: static;
  width: 340px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px #0001;
  padding: 28px 22px;
  margin: 28px 0 28px 28px;
  min-width: 240px;
  max-width: 340px;
  overflow-x: hidden;
  overflow-y: auto;
  word-break: break-word;
  box-sizing: border-box;
}
.sidebar input,
.sidebar select,
.sidebar button,
.sidebar .edit-btn {
  max-width: 100%;
  box-sizing: border-box;
  word-break: break-word;
}
.sidebar-details div {
  margin-bottom: 10px;
  font-size: 1.08em;
}
.sb-label {
  color: #007bff;
  font-weight: 600;
  min-width: 90px;
  display: inline-block;
}
.sidebar-estimate {
  background: #f7f9fb;
  padding: 13px 14px;
  border-radius: 10px;
  margin: 18px 0 10px 0;
  font-size: 1em;
  color: #1b2430;
  box-shadow: 0 1px 4px #0001;
}
.sidebar-currency {
  margin: 14px 0 0 0;
  font-size: 1em;
}
.sidebar-currency select {
  font-size: 1em;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #fff;
  margin-left: 6px;
}

/* Link za mapu */
.show-map-link {
  display: inline-block;
  margin: 18px 0 0 0;
  color: #007bff;
  text-decoration: underline;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1em;
  padding: 0;
}
.show-map-link:hover {
  color: #0056b3;
}

/* Glavni sadržaj */
.main-wrap {
  flex: 1;
  max-width: 700px;
  margin: 36px 0 36px 0;
}

/* Filteri */
.filters {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  background: #fff;
  border-radius: 12px;
  padding: 12px 0;
  box-shadow: 0 2px 8px #0001;
}

/* Kartice vozila */
.vehicle-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 10px #0002;
  margin: 22px 0;
  padding: 0;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  transition: box-shadow 0.18s;
  border: 1px solid #f3f3f3;
}
.vehicle-card:hover {
  box-shadow: 0 6px 24px #007bff22;
}
.vehicle-card img {
  width: 120px;
  height: 82px;
  object-fit: cover;
  border-radius: 12px;
  margin: 18px;
  background: #f7f9fb;
  cursor: zoom-in;
}
.vehicle-info {
  flex: 1;
  padding: 18px 0 18px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
}
.vehicle-type {
  font-weight: 600;
  font-size: 1.13em;
  color: #007bff;
  margin-bottom: 3px;
}
.vehicle-badges {
  margin: 3px 0 0 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.vehicle-badge {
  display: inline-flex;
  align-items: center;
  background: #f0f4fa;
  color: #444;
  border-radius: 5px;
  padding: 2px 9px;
  font-size: 0.97em;
  gap: 5px;
  position: relative;
  cursor: pointer;
  outline: none;
}
.vehicle-rating {
  margin-top: 4px;
  font-size: 1.03em;
  color: #f8b400;
  display: flex;
  align-items: center;
  gap: 5px;
  position: relative;
}
.vehicle-price-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  min-width: 140px;
  padding: 0 32px 0 18px;
}
.vehicle-price {
  font-size: 1.22em;
  font-weight: 700;
  color: #007bff;
}
.vehicle-fixed-label {
  font-size: 0.97em;
  color: #888;
  margin-bottom: 12px;
}
.book-btn {
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 13px 32px;
  font-weight: 700;
  font-size: 1.08em;
  cursor: pointer;
  margin-bottom: 8px;
  transition: background 0.14s;
}
.book-btn:hover {
  background: #0056b3;
}

/* Tooltip za badge i ocenu */
.vehicle-badge[data-tooltip]:hover::after,
.vehicle-badge[data-tooltip]:focus::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 120%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 0.97em;
  white-space: nowrap;
  z-index: 100;
  opacity: 1;
  pointer-events: none;
  box-shadow: 0 2px 8px #0002;
}
.vehicle-badge[data-tooltip]:hover::before,
.vehicle-badge[data-tooltip]:focus::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 112%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top: 7px solid #222;
  z-index: 101;
}
.vehicle-badge[data-tooltip]::after,
.vehicle-badge[data-tooltip]::before {
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.vehicle-badge[data-tooltip]:hover::after,
.vehicle-badge[data-tooltip]:focus::after,
.vehicle-badge[data-tooltip]:hover::before,
.vehicle-badge[data-tooltip]:focus::before {
  opacity: 1;
}
.vehicle-rating[data-tooltip]:hover::after,
.vehicle-rating[data-tooltip]:focus::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 120%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 0.97em;
  white-space: nowrap;
  z-index: 100;
  opacity: 1;
  pointer-events: none;
  box-shadow: 0 2px 8px #0002;
}
.vehicle-rating[data-tooltip]:hover::before,
.vehicle-rating[data-tooltip]:focus::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 112%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top: 7px solid #222;
  z-index: 101;
}
.vehicle-rating[data-tooltip]::after,
.vehicle-rating[data-tooltip]::before {
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.vehicle-rating[data-tooltip]:hover::after,
.vehicle-rating[data-tooltip]:focus::after,
.vehicle-rating[data-tooltip]:hover::before,
.vehicle-rating[data-tooltip]:focus::before {
  opacity: 1;
}

/* Responsive za manje ekrane */
@media (max-width: 900px) {
  .page-layout {
    flex-direction: column;
    gap: 0;
  }
  .sidebar {
    position: static;
    width: 100%;
    max-width: 100vw;
    border-radius: 0;
    box-shadow: none;
    padding: 18px 10px;
    margin: 10px 0 0 0;
  }
  .main-wrap {
    margin: 10px 0;
    max-width: 100vw;
  }
  .filters {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border-radius: 0;
    box-shadow: none;
    padding: 10px 0 7px 0;
  }
  .vehicle-card {
    flex-direction: column;
    margin: 16px 0;
    border-radius: 16px;
    box-shadow: 0 4px 18px #0002;
    border: 1px solid #e0e6ed;
    background: #fff;
    overflow: hidden;
    padding: 0;
    transition: box-shadow 0.18s, border 0.18s;
  }
  .vehicle-card:not(:last-child) {
    margin-bottom: 22px;
  }
  .vehicle-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
    margin: 0;
    background: #f7f9fb;
    cursor: zoom-in;
  }
  .vehicle-info, .vehicle-price-wrap {
    padding: 16px 14px;
  }
  .vehicle-type {
    font-size: 1.15em;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 6px;
  }
  .vehicle-badges {
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
  }
  .vehicle-badge {
    background: #f0f4fa;
    color: #333;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 1em;
    margin-bottom: 4px;
  }
  .vehicle-rating {
    font-size: 1.08em;
    color: #f8b400;
    margin-bottom: 6px;
  }
  .vehicle-desc {
    font-size: 1em;
    color: #444;
    margin-bottom: 10px;
  }
  .vehicle-price-wrap {
    align-items: flex-start;
    padding: 0 0 16px 14px;
    min-width: unset;
  }
  .vehicle-price {
    font-size: 1.22em;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 4px;
  }
  .vehicle-fixed-label {
    font-size: 0.97em;
    color: #888;
    margin-bottom: 10px;
  }
  .book-btn {
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 0;
    width: 100%;
    font-weight: 700;
    font-size: 1.09em;
    cursor: pointer;
    margin-top: 10px;
    min-height: 48px;
    box-shadow: 0 2px 8px #007bff11;
    transition: background 0.14s;
  }
  .book-btn:active,
  .book-btn:hover {
    background: #0056b3;
  }
  /* Modal za mapu i slike - prilagođeno za mobilni */
  .modal-content {
    padding: 8px !important;
    max-width: 98vw !important;
    border-radius: 12px !important;
  }
  #map {
    height: 220px !important;
    border-radius: 10px !important;
  }
}

/* Modal overlay za mapu */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.18);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open {
  display: flex;
}
.modal-content {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  max-width: 900px;
  width: 98vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
#map {
  width: 100%;
  height: 400px;
  border-radius: 12px;
  margin-bottom: 10px;
}
#closeMapBtn {
  align-self: flex-end;
  margin-bottom: 10px;
  background: #007bff;
  border: none;
  border
.input-error {
  color: #d32f2f;
  font-size: 0.97em;
  min-height: 18px;
  margin-top: 2px;
}
input:invalid {
  border-color: #d32f2f;
}
input:valid {
  border-color: #4caf50;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.edit-btn {
  background: #f0f4fa;
  color: #007bff;
  border: none;
  border-radius: 7px;
  padding: 8px 16px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background 0.14s, color 0.14s, box-shadow 0.14s;
  box-shadow: 0 2px 8px #007bff11;
}
.edit-btn:hover, .edit-btn:focus {
  background: #007bff;
  color: #fff;
  outline: none;
}
.edit-btn .fa-pen {
  font-size: 1.1em;
}
@media (max-width: 900px) {
  .edit-btn .edit-text { display: none; }
  .edit-btn { padding: 8px 12px; }
}
#cmp-overlay {
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.45);
  z-index:9998;
}

#cmp {
  display:none;
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  z-index:9999;
}

.cmp-box {
  max-width:900px;
  margin:0 auto;
  background:#fff;
  color:#222;
  border-radius:16px 16px 0 0;
  padding:32px;
  box-shadow:0 -10px 40px rgba(0,0,0,0.25);
}

.cmp-actions {
  display:flex;
  gap:12px;
  margin-top:20px;
  flex-wrap:wrap;
}

.cmp-btn {
  padding:14px 22px;
  font-weight:700;
  border:none;
  border-radius:10px;
  cursor:pointer;
}

.cmp-btn.accept { background:#28a745; color:#fff; }
.cmp-btn.reject { background:#dc3545; color:#fff; }
.cmp-btn.save   { background:#ffc107; color:#222; }
