/* ─────────────────────────────────────────────────────────────────────
   marketplace.css — Gemeinsame Styles für Marketplace, Anzeige,
   Meine Anzeigen. Kein Inline-CSS in den HTML-Dateien.
   ───────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0f1117;
  --surface:     #181b23;
  --surface-2:   #1e2230;
  --border:      #2a2d38;
  --text:        #f1f5f9;
  --muted:       #94a3b8;
  --green:       #10b981;
  --green-hover: #0ea271;
  --blue:        #3b82f6;
  --purple:      #7c3aed;
  --purple-soft: #a78bfa;
  --amber:       #f59e0b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--text); }

/* ─── PAGE HEADER ─── */
.page-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.page-header-title {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f1f5f9, var(--purple), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header-nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

.page-header-nav a {
  font-size: 14px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.page-header-nav a:hover { color: var(--text); }

/* ─── FILTER BAR ─── */
.filter-bar {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.filter-toggles {
  display: flex;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.filter-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.filter-btn:not(:last-child) { border-right: 1px solid var(--border); }
.filter-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.filter-btn.active { background: var(--green); color: #000; }

.sort-select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  outline: none;
}
.sort-select:focus { border-color: var(--green); }
.sort-select option { background: var(--surface); color: var(--text); }

/* ─── RESULTS INFO ─── */
.results-info {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 16px 24px 0;
  font-size: 14px;
  color: var(--muted);
}

/* ─── GRID ─── */
.grid-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 24px;
  flex: 1;
}

.block-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ─── CARD ─── */
.block-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.block-card:hover {
  transform: translateY(-3px);
  border-color: var(--green);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.12);
  color: inherit;
}

.card-placeholder {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-cluster-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.card-cluster-tiles {
  display: grid;
  gap: 3px;
}

.card-cluster-tile {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
}

.card-cluster-label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.card-single-placeholder {
  text-align: center;
}

.card-single-coords {
  font-family: monospace;
  font-size: 18px;
  font-weight: 700;
  color: rgba(255,255,255,0.25);
}

.card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.card-position {
  font-size: 12px;
  color: var(--muted);
  font-family: monospace;
}

.card-owner {
  font-size: 12px;
  color: var(--muted);
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.card-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--green);
}

.card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* ─── BADGES ─── */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-sale { background: rgba(124,58,237,0.15); color: var(--purple); }
.badge-rent { background: rgba(59,130,246,0.15); color: var(--blue); }
.badge-cluster {
  background: rgba(124,58,237,0.15);
  color: var(--purple-soft);
  border: 1px solid rgba(124,58,237,0.3);
}

/* ─── BUTTONS ─── */
.btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: default; }

.btn-primary {
  background: linear-gradient(90deg, #047857 0%, #10b981 40%, #34d399 60%, #10b981 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transition: left 0.5s;
}
.btn-primary:hover:not(:disabled)::after { left: 100%; }
.btn-primary:hover:not(:disabled) { box-shadow: 0 0 20px rgba(16,185,129,0.4); }

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }

.btn-amber { background: var(--amber); color: #000; }
.btn-amber:hover:not(:disabled) { background: #e08c05; }

.btn-danger { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #f87171; }
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,0.25); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.visible { opacity: 1; }

/* ─── LOADING / SPINNER ─── */
.loading {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
  font-size: 1rem;
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
}
.empty-state svg { margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 1.3rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 0.95rem; }

/* ─── PAGINATION ─── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 32px 24px 48px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.page-btn {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  min-width: 40px;
  text-align: center;
}
.page-btn:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--green);
}
.page-btn.active { background: var(--green); color: #000; border-color: var(--green); }
.page-btn:disabled { opacity: 0.3; cursor: default; }
.page-ellipsis { color: var(--muted); font-size: 14px; padding: 0 4px; }

/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
footer a { color: var(--muted); text-decoration: none; margin: 0 12px; }
footer a:hover { color: var(--text); }
footer .footer-brand { margin-bottom: 8px; }

/* ─── DETAIL PAGE (anzeige.html) ─── */
.container {
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 16px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 20px;
}
.back-link:hover { color: var(--text); }

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.detail-image {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  display: block;
}

.detail-placeholder {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.detail-cluster-grid {
  display: grid;
  gap: 4px;
}

.detail-cluster-tile {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
}

.detail-cluster-label {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.detail-single-coords {
  font-family: monospace;
  font-size: 20px;
  font-weight: 700;
  color: rgba(255,255,255,0.25);
}

.detail-body { padding: 28px; }

.detail-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.detail-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.detail-badge-rent { background: rgba(16,185,129,.15); color: var(--green); }
.detail-badge-sale { background: rgba(59,130,246,.15); color: var(--blue); }

.detail-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 10px;
  line-height: 1.2;
}

.detail-description {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.detail-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 28px;
}
.detail-price { font-size: 36px; font-weight: 800; color: var(--green); }
.detail-price-label { font-size: 16px; color: var(--muted); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.info-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.info-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.info-value { font-size: 15px; font-weight: 600; }

.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.detail-actions .btn { padding: 13px 24px; font-size: 15px; }

/* ─── CHECKOUT / RENT / SALE FORM ─── */
.checkout-form {
  margin-top: 20px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.checkout-form-label {
  font-size: 13px;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.checkout-form-select,
.checkout-form-input,
.checkout-form-textarea {
  width: 100%;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.checkout-form-textarea { resize: vertical; }

.checkout-total {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.checkout-dates {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.checkout-hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.checkout-sb-heading {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.checkout-sb-heading span {
  color: var(--muted);
  font-weight: normal;
}

.checkout-field {
  margin-bottom: 10px;
}

.checkout-field-label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.checkout-hint {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 16px;
}

.checkout-checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  margin-bottom: 10px;
  cursor: pointer;
}
.checkout-checkbox input { margin-top: 2px; flex-shrink: 0; }

/* ─── EDIT LISTING FORM ─── */
.edit-listing-form {
  margin-top: 20px;
  padding: 20px;
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 10px;
}

.edit-listing-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 16px;
}

.edit-listing-actions {
  display: flex;
  gap: 10px;
}
.edit-listing-actions .btn { flex: 1; }

/* ─── NOT FOUND ─── */
.not-found {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
}
.not-found h2 { font-size: 22px; margin-bottom: 10px; color: var(--text); }
.not-found a { color: var(--green); margin-top: 16px; display: inline-block; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .block-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .block-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .container { padding: 16px 8px; }
  .detail-body { padding: 20px; }
  .detail-price { font-size: 28px; }

  /* Header: Logo links, Nav rechts — nie umbrechen */
  .page-header {
    flex-wrap: nowrap;
    align-items: center;
  }
  .page-header-nav {
    gap: 10px;
    flex-shrink: 0;
  }
  .page-header-nav a {
    font-size: 13px;
  }

  /* Anzeige-Buttons: alle full-width untereinander, kompakter */
  .detail-actions {
    flex-direction: column;
  }
  .detail-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 0 18px;
    height: 40px;
    font-size: 13px;
    line-height: 1;
  }
}
