/* ============================================================
 * lieblingsplaetze.css
 * Styling fuer das Lieblingsplaetze-Feature (Karte + Modals + Tabelle).
 * Uebernimmt die CSS-Variablen aus styles-modern.css, fallbacks sind drin.
 * ============================================================ */

.lieblingsplaetze {
  --lp-accent: var(--color-accent, #4C864E);
  --lp-accent-dark: var(--color-accent-dark, #355f37);
  --lp-text: var(--color-text, #1f2937);
  --lp-muted: var(--color-text-muted, #6b7280);
  --lp-surface: #ffffff;
  --lp-border: #e5e7eb;
  --lp-border-strong: #cbd5e1;
  --lp-shadow: 0 2px 4px rgba(15, 23, 42, 0.05), 0 4px 12px rgba(15, 23, 42, 0.06);
  --lp-radius: 10px;

  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--lp-text);
}

.lieblingsplaetze .lp-toolbar {
  margin-bottom: 1.5rem;
}

.lieblingsplaetze .lp-intro {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--lp-muted);
}

.lieblingsplaetze #lp-map {
  box-shadow: var(--lp-shadow);
}

/* ---------- Tabelle ---------- */
.lieblingsplaetze .lp-table-wrap {
  margin-top: 2rem;
}

.lieblingsplaetze .lp-table-wrap h2 {
  margin: 0 0 .5rem 0;
}

.lieblingsplaetze .lp-hint {
  color: var(--lp-muted);
  font-size: .9rem;
  margin: 0 0 1rem 0;
}

.lieblingsplaetze .lp-liste {
  width: 100%;
  border-collapse: collapse;
  background: var(--lp-surface);
  border-radius: var(--lp-radius);
  overflow: hidden;
  box-shadow: var(--lp-shadow);
}

.lieblingsplaetze .lp-liste th,
.lieblingsplaetze .lp-liste td {
  text-align: left;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--lp-border);
}

.lieblingsplaetze .lp-liste th {
  background: #f1f5f9;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--lp-muted);
}

.lieblingsplaetze .lp-liste tr:last-child td {
  border-bottom: 0;
}

.lieblingsplaetze .lp-liste tr:hover td {
  background: #f8fafc;
  cursor: pointer;
}

/* ---------- Modals ---------- */
.lp-modal {
  border: 0;
  padding: 0;
  border-radius: var(--lp-radius, 10px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  max-width: min(92vw, 560px);
  width: 100%;
}

.lp-modal.lp-modal-wide {
  max-width: min(92vw, 720px);
}

.lp-modal::backdrop {
  background: rgba(15, 23, 42, 0.4);
}

.lp-form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.lp-form h3 {
  margin: 0 0 .25rem 0;
}

.lp-form-hint {
  font-size: .85rem;
  color: #4C864E;
  margin: 0;
}

.lp-form label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-weight: 600;
  font-size: .9rem;
  color: #1f2937;
}

.lp-form input[type="text"],
.lp-form input[type="email"],
.lp-form textarea,
.lp-form select {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  padding: .65rem .8rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #1f2937;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.lp-form input:focus-visible,
.lp-form textarea:focus-visible,
.lp-form select:focus-visible {
  outline: none;
  border-color: #4C864E;
  box-shadow: 0 0 0 3px rgba(76, 134, 78, 0.15);
}

.lp-form textarea {
  min-height: 80px;
  resize: vertical;
}

.lp-form .lp-note {
  color: #6b7280;
  font-size: .8rem;
  font-weight: 400;
}

.lp-form .lp-consent {
  flex-direction: row;
  align-items: flex-start;
  gap: .5rem;
  font-weight: 400;
  font-size: .9rem;
  line-height: 1.45;
}

.lp-form .lp-consent input {
  margin-top: .25rem;
}

/* Honeypot verstecken */
.lp-form .lp-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.lp-form .lp-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
}

.lp-form .lp-error {
  background: #FEE2E2;
  color: #991B1B;
  padding: .6rem .8rem;
  border-radius: 6px;
  font-size: .9rem;
  margin: 0;
}

.lp-btn-primary,
.lp-btn-secondary {
  display: inline-block;
  padding: .65rem 1.25rem;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: 0;
  transition: background 150ms ease, transform 150ms ease;
}

.lp-btn-primary {
  background: #4C864E;
  color: #fff;
}
.lp-btn-primary:hover { background: #355f37; transform: translateY(-1px); }

.lp-btn-secondary {
  background: #f1f5f9;
  color: #1f2937;
}
.lp-btn-secondary:hover { background: #e2e8f0; }

.lp-like-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .4rem .8rem;
  font-size: .9rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 999px;
  cursor: pointer;
  transition: all 150ms ease;
}
.lp-like-btn:hover { border-color: #4C864E; color: #4C864E; }
.lp-like-btn.liked {
  background: #4C864E;
  color: #fff;
  border-color: #4C864E;
}

/* ---------- Detail-Modal ---------- */
.lp-detail {
  padding: 1.5rem;
  font-family: system-ui, sans-serif;
}

.lp-detail header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: .5rem;
}

.lp-detail h3 {
  margin: 0;
}

.lp-detail h4 {
  margin: 1rem 0 .25rem 0;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6b7280;
}

.lp-detail p {
  margin: 0 0 .5rem 0;
}

.lp-suggestions {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lp-suggestions li {
  padding: .75rem 0;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}

.lp-suggestions li:last-child {
  border-bottom: 0;
}

.lp-suggestions .lp-suggestion-meta {
  color: #9ca3af;
  font-size: .8rem;
  margin-top: .25rem;
}

.lp-suggest-form-wrap {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
}

.lp-suggest-form-wrap summary {
  cursor: pointer;
  font-weight: 600;
  color: #4C864E;
}

.lp-detail footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

/* ---------- Sterne (Read-only + Picker) ---------- */
.lp-stars {
  display: inline-flex;
  gap: 1px;
  font-size: 1rem;
  color: #cbd5e1;
  letter-spacing: 1px;
}
.lp-stars.lp-stars-big {
  font-size: 1.5rem;
}
.lp-stars span.on {
  color: #f59e0b;
}
.lp-stars-meta {
  font-size: .85rem;
  color: #6b7280;
  margin-left: .4rem;
}

.lp-rating-block {
  background: #f8fafc;
  border-radius: 8px;
  padding: .9rem 1rem;
  margin: .5rem 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.lp-rating-display {
  padding-bottom: .6rem;
  border-bottom: 1px solid #e5e7eb;
}

.lp-rating-picker-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
}

.lp-rating-label {
  font-size: .85rem;
  font-weight: 600;
  color: #1f2937;
}

.lp-rating-stars {
  display: inline-flex;
  gap: .15rem;
}

.lp-star {
  background: none;
  border: 0;
  padding: 0 .1rem;
  font-size: 1.6rem;
  line-height: 1;
  color: #cbd5e1;
  cursor: pointer;
  transition: color 120ms ease, transform 120ms ease;
}
.lp-star:hover { transform: scale(1.1); }
.lp-star.on { color: #f59e0b; }

.lp-rating-hint {
  font-size: .85rem;
  color: #6b7280;
}

.lp-rating-summary {
  font-size: .9rem;
  color: #1f2937;
  font-weight: 600;
}
.lp-rating-summary.lp-muted {
  color: #6b7280;
  font-weight: 400;
}

.lp-btn-link {
  background: none;
  border: 0;
  padding: 0;
  color: #4C864E;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}
.lp-btn-link:hover { color: #355f37; }

/* ---------- Responsive Card-View (unter 720px) ---------- */
@media (max-width: 720px) {
  .lieblingsplaetze .lp-table-wrap {
    max-width: 100%;
    overflow-x: hidden;
  }

  .lieblingsplaetze .lp-liste,
  .lieblingsplaetze .lp-liste thead,
  .lieblingsplaetze .lp-liste tbody,
  .lieblingsplaetze .lp-liste tr,
  .lieblingsplaetze .lp-liste td {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .lieblingsplaetze .lp-liste {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
    table-layout: fixed;
  }

  .lieblingsplaetze .lp-liste thead {
    position: absolute;
    left: -9999px;
    top: -9999px;
  }

  .lieblingsplaetze .lp-liste tr {
    background: var(--lp-surface);
    border-radius: var(--lp-radius);
    box-shadow: var(--lp-shadow);
    margin-bottom: .9rem;
    padding: .4rem .25rem;
    border: 1px solid var(--lp-border);
  }

  .lieblingsplaetze .lp-liste tr:hover td {
    background: transparent;
  }

  .lieblingsplaetze .lp-liste td {
    border-bottom: 1px solid var(--lp-border);
    padding: .6rem .9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: right;
  }

  .lieblingsplaetze .lp-liste td:last-child {
    border-bottom: 0;
  }

  .lieblingsplaetze .lp-liste td::before {
    content: attr(data-label);
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--lp-muted);
    font-weight: 600;
    flex: 0 0 auto;
    text-align: left;
  }

  /* Stars in der Card-View kompakter, damit sie mit langen Titeln
     nicht horizontal aus der Karte rauslaufen */
  .lieblingsplaetze .lp-liste .lp-stars {
    font-size: .95rem;
  }
  .lieblingsplaetze .lp-liste .lp-stars-meta {
    display: block;
    margin: .2rem 0 0 0;
    font-size: .75rem;
  }
}
