/* --- BASIS VARIABLEN --- */
:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --primary: #3b82f6;
  --accent: #10b981;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  --transition: all 0.2s ease-in-out;
}

body {
  background-color: var(--bg-dark);
  margin: 0;
  font-family:
    "Inter",
    -apple-system,
    sans-serif;
  color: var(--text-main);
  line-height: 1.4;
  font-size: 14px;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* --- KAUF-BENACHRICHTIGUNG (Alert) --- */
.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.8rem 1.2rem;
  border-radius: 0.8rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- HEADER & FILTER --- */
.filter-bar {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(12px);
  padding: 0.7rem 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 1rem;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.brand-title {
  font-size: 1.4rem;
  font-weight: 900;
  margin: 0;
  cursor: pointer;
}
.brand-title span {
  color: var(--primary);
}

.filter-form {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.select-input {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.5rem 0.8rem;
  border-radius: 0.6rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.select-input:hover {
  border-color: var(--primary);
}

.clear-btn {
  color: #f43f5e;
  font-size: 1.2rem;
  text-decoration: none;
}

/* --- USER NAV (Login & User Pill) --- */
.btn-login-header {
  background: var(--primary);
  color: white;
  text-decoration: none;
  padding: 0.5rem 1.2rem;
  border-radius: 0.6rem;
  font-weight: 700;
  font-size: 0.85rem;
  transition: var(--transition);
  display: inline-block;
  border: 1px solid transparent;
}

.btn-login-header:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}

.user-pill {
  background: #111827;
  border: 1px solid var(--border);
  padding: 0.4rem 0.8rem;
  border-radius: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-link-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition);
}
.user-link-wrapper:hover {
  color: var(--primary);
}

.user-name {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: capitalize;
}

.logout-link {
  color: var(--text-muted);
  text-decoration: none;
  border-left: 1px solid var(--border);
  padding-left: 8px;
  font-size: 1.1rem;
  transition: var(--transition);
}
.logout-link:hover {
  color: #f43f5e;
}

/* --- VEHICLE GRID --- */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.vehicle-card {
  background: var(--bg-card);
  border-radius: 1.2rem;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.vehicle-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.card-content {
  padding: 1.2rem;
}

.vehicle-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.brand-label {
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.model-name {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
}

.price-tag {
  color: var(--accent);
  font-weight: 900;
  font-size: 1.3rem;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.3rem 0.6rem;
  border-radius: 0.6rem;
}

/* STATS (KM, PS) */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin: 1.2rem 0;
}

.stat-item {
  background: rgba(15, 23, 42, 0.4);
  padding: 0.6rem;
  border-radius: 0.8rem;
  text-align: center;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
}
.stat-val {
  font-size: 1rem;
  font-weight: 800;
}

.badge-list {
  display: flex;
  gap: 0.5rem;
}
.badge {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  padding: 0.3rem 0.6rem;
  border-radius: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
}

/* --- KAUFEN BUTTON --- */
.action-area {
  margin-top: 1.2rem;
}
.btn-buy {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.8rem;
  border-radius: 0.8rem;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}
.btn-buy:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}

/* --- CARD FOOTER & OWNER INFO --- */
.card-footer {
  background: rgba(15, 23, 42, 0.2);
  padding: 0.75rem 1.2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin-top: auto;
}

.owner-info {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-weight: 700;
}

.owner-details {
  text-transform: capitalize;
  white-space: nowrap;
}

/* --- MOBILE OPTIMIERUNG --- */
@media (max-width: 768px) {
  .filter-bar {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    position: relative;
    top: 0;
  }

  .filter-form {
    width: 100%;
    flex-wrap: wrap;
  }
  .select-input {
    flex: 1;
    min-width: 100px;
  }

  .vehicle-grid {
    grid-template-columns: 1fr !important;
  }

  .user-name {
    display: none;
  }
  .model-name {
    font-size: 1.5rem;
  }

  /* Auf dem Handy Login-Button zentrieren */
  .btn-login-header {
    width: 100%;
    text-align: center;
  }
}
