/* ===================================================================
   VERBESSERTE KLEINANZEIGEN-DARSTELLUNG (Categories)
   Moderne Card-Struktur mit besserer UX und SEO
   =================================================================== */

/* Basis Card-Styling */
.classified-card {
  cursor: pointer;
  display: block;
}

/* Neues Grid-Layout mit verbesserter Struktur */
.lp-grid-boxes-container {
  display: grid;
  grid-template-columns: 180px 1fr 120px;
  grid-template-rows: auto 1fr auto;
  gap: 0;
  background: var(--color-bg-body, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  min-height: 160px;
  height: 160px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .lp-grid-boxes-container {
  background: #1a2332;
  border-color: rgba(232, 156, 10, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Bildspalte: volle Card-Höhe und ohne unteren "Baseline-Gap" */
.lp-grid-boxes-pic {
  grid-column: 1;
  grid-row: 1 / 4;
  height: 100%;
  align-self: stretch;
  overflow: hidden;
}

.lp-grid-boxes-pic > a {
  display: block;
  height: 100%;
}

.lp-grid-boxes-pic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hover-Effekt ohne Bewegung (ruhiger/seriöser) */
.lp-grid-boxes-container:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  border-color: rgba(232, 156, 10, 0.4);
}

html[data-theme="dark"] .lp-grid-boxes-container:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Content-Bereich (neu strukturiert) */
.classified-content {
  grid-column: 2;
  grid-row: 1 / 4;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0; /* Wichtig für text-overflow */
}

/* Meta-Informationen (Datum, Standort, Typ) */
.classified-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
  font-size: 11px;
  color: var(--color-text-muted, #6b7280);
  margin-bottom: 2px;
}

.classified-meta svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.classified-meta-time,
.classified-meta-location {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.classified-meta-location {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.classified-meta-badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.classified-meta-badge.offer {
  background: #dbeafe;
  color: #1e40af;
}

.classified-meta-badge.wanted {
  background: #fef3c7;
  color: #92400e;
}

html[data-theme="dark"] .classified-meta-badge.offer {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

html[data-theme="dark"] .classified-meta-badge.wanted {
  background: rgba(251, 191, 36, 0.2);
  color: #fcd34d;
}

/* Titel */
.lp-grid-boxes-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary, #111827);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.lp-grid-boxes-title a {
  color: inherit;
  text-decoration: none;
}

.lp-grid-boxes-title a:hover {
  color: #e89c0a;
}

html[data-theme="dark"] .lp-grid-boxes-title {
  color: #f3f4f6;
}

/* Beschreibung */
.lp-grid-boxes-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary, #6b7280);
  line-height: 1.5;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  flex: 1;
}

html[data-theme="dark"] .lp-grid-boxes-subtitle {
  color: #9ca3af;
}

/* Preis-Sektion (rechte Spalte) */
.classified-price-section {
  grid-column: 3;
  grid-row: 1 / 4;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--color-border, #e5e7eb);
}

html[data-theme="dark"] .classified-price-section {
  border-left-color: rgba(255, 255, 255, 0.1);
}

.classified-price-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.classified-price-badge .price-value {
  font-size: 18px;
  font-weight: 700;
  color: #16a34a;
  line-height: 1.2;
}

.classified-price-badge .price-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.classified-price-badge.negotiable .price-value {
  color: #ea580c;
}

.classified-price-badge.free .price-label {
  font-size: 13px;
  font-weight: 700;
  color: #16a34a;
}

html[data-theme="dark"] .classified-price-badge .price-value {
  color: #4ade80;
}

html[data-theme="dark"] .classified-price-badge.negotiable .price-value {
  color: #fb923c;
}

/* ===== 3D FLIP CARD ANIMATION ===== */
.price-flip-card {
  width: 100%;
  height: 100%;
  perspective: 1000px;
  cursor: pointer;
}

.price-flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.price-flip-card:hover .price-flip-card-inner {
  transform: rotateY(180deg);
}

.price-flip-card-front,
.price-flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.price-flip-card-front {
  z-index: 2;
  transform: rotateY(0deg);
}

.price-flip-card-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  padding: 12px;
}

html[data-theme="dark"] .price-flip-card-back {
  background: linear-gradient(135deg, #4c51bf 0%, #553c9a 100%);
}

/* Crypto-Preise auf der Rückseite */
.classified-crypto-prices-flip {
  font-size: 11px;
  line-height: 1.4;
  color: #ffffff;
  width: 100%;
}

.classified-crypto-prices-flip .crypto-line {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 0;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
  justify-content: center;
}

.classified-crypto-prices-flip .crypto-line img {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  filter: brightness(1.2);
}

.classified-crypto-prices-flip .crypto-amount {
  font-weight: 600;
  color: #ffffff;
}

/* Responsive Design */
@media (max-width: 768px) {
  .lp-grid-boxes-container {
    grid-template-columns: 1fr;
    grid-template-rows: 160px auto auto;
    min-height: auto;
    height: auto;
  }

  .lp-grid-boxes-pic {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: 160px;
  }

  .classified-content {
    grid-column: 1;
    grid-row: 2;
    padding: 12px;
  }

  .classified-price-section {
    grid-column: 1;
    grid-row: 3;
    border-left: none;
    border-top: 1px solid var(--color-border, #e5e7eb);
    padding: 12px;
    flex-direction: row;
    justify-content: space-between;
  }

  .classified-price-badge {
    flex-direction: row;
    gap: 8px;
  }

  .classified-meta {
    font-size: 12px;
  }

  .lp-grid-boxes-title {
    font-size: 15px;
  }

  .lp-grid-boxes-subtitle {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lp-grid-boxes-container,
n+  .price-flip-card-inner {
    transition: none !important;
  }

  .lp-grid-boxes-container:hover {
    transform: none !important;
  }

  .price-flip-card:hover .price-flip-card-inner {
    transform: none !important;
  }
}

@media (max-width: 480px) {
  .lp-grid-boxes-container {
    grid-template-rows: 140px auto auto;
  }

  .lp-grid-boxes-pic {
    height: 140px;
  }

  .classified-content {
    padding: 10px;
  }

  .classified-meta {
    font-size: 11px;
    gap: 8px;
  }

  .lp-grid-boxes-title {
    font-size: 14px;
  }

  .lp-grid-boxes-subtitle {
    font-size: 13px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .classified-price-badge .price-value {
    font-size: 16px;
  }
  
  .classified-crypto-prices-flip {
    font-size: 10px;
  }
  
  .classified-crypto-prices-flip .crypto-line img {
    width: 12px;
    height: 12px;
  }
}
