/* /src/main/resources/public/css/resultCard.css */
/* Reine Styles für die Result-Ansicht – CSP-sicher, kein Inline-CSS */

/* --- Layout-Wrapper --- */
.wrapper.full-bleed {
  max-width: none;
  width: 95%;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* --- Grid für die Kacheln --- */
.grid-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  align-items: stretch;
}

@media (min-width: 700px) {
  .grid-cards {
    grid-template-columns: 3fr 1fr;
  }
  .tile--rest { grid-column: 1 / 2; }
  .tile--receipt { grid-column: 2 / 3; }
  .tile--signed { grid-column: 1 / -1; }
}

@media (min-width: 1100px) {
  .grid-cards {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .tile--rest { grid-column: 1 / span 2; grid-row: 1; }
  .tile--receipt { grid-column: 3 / 4; grid-row: 1; }
  .tile--signed { grid-column: 1 / -1; grid-row: 2; }
}

/* Kacheln gleich hoch innerhalb einer Zeile */
.grid-cards .tile {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Kundenbeleg horizontal zentrieren & lesbar umbrechen */
#tile-receipt .mono {
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.8rem;
}

/* Signierte Daten */
#tile-signed .mono {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.9rem;
}
.code.xml {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  line-height: 1.45;
}
.tile--signed { align-items: flex-start; height: auto; }

/* --- Weitere Informationen --- */
.tile--rest .rest-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.75rem;
}
.tile--rest .kv-group {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin: 0;
  background: #12162a;
  color: #e9eefb;
}
.kv-group h4 {
  margin: 0.25rem 0 0.75rem;
  font-weight: 600;
  background: rgba(255, 212, 90, 0.15);
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  color: #ffd45a;
  text-align: left;
}

/* Key-Value */
.kv {
  display: grid;
  grid-template-columns: clamp(8rem, 18ch, 12rem) 1fr;
  gap: 0.25rem 0.75rem;
  margin: 0;
  align-items: start;
}
.kv dt { color: #b8c2e0; white-space: nowrap; }
.kv dd { margin: 0; color: #e9eefb; overflow-wrap: break-word; }

/* Layout für große Screens */
@media (min-width: 1200px) {
  .tile--rest .rest-groups {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas:
      "station  station  operator"
      "trans    times    energy"
      "price    price    card"
      "hints    hints    hints";
    gap: 0.75rem;
  }
  .tile--rest .kv-group.area-station { grid-area: station; }
  .tile--rest .kv-group.area-operator { grid-area: operator; }
  .tile--rest .kv-group.area-trans { grid-area: trans; }
  .tile--rest .kv-group.area-times { grid-area: times; }
  .tile--rest .kv-group.area-energy { grid-area: energy; }
  .tile--rest .kv-group.area-price { grid-area: price; }
  .tile--rest .kv-group.area-card { grid-area: card; }
  .tile--rest .kv-group.area-hints { grid-area: hints; }
}

/* --- Aktionen unten --- */
.result-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
  padding-bottom: 8rem;
}

/* Buttons – einheitliches Primary-Design */
.tile .tile-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.tile .tile-actions .btn,
.tile .tile-actions .btn-secondary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(180deg, #ffd45a, #f0a500);
  color: #1b1b1b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.06s ease, filter 0.15s ease;
}
.tile .tile-actions .btn:hover,
.tile .tile-actions .btn-secondary:hover { filter: brightness(1.05); }
.tile .tile-actions .btn:active,
.tile .tile-actions .btn-secondary:active { transform: translateY(1px); }

/* Kontakt-Link besser sichtbar */
.kv-group.area-operator {
  text-align: center;
}
.kv-group.area-operator .operator-contact a {
  color: #ffb347;
  text-decoration: none;
  font-weight: 600;
}
.kv-group.area-operator .operator-contact a:hover {
  text-decoration: underline;
}

/* Preis-Tabelle */
.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #1b213a;
  border-radius: 8px;
  overflow: hidden;
}
.price-table thead { background: #2b3454; }
.price-table th,
.price-table td {
  padding: 0.5rem 0.75rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.price-table th.col-head {
  font-weight: 600;
  color: #ffd45a;
}
.price-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Hinweise-Kachel */
.kv-group.area-hints {
  font-size: 0.85rem;
  line-height: 1.4;
  background: #1c243d;
}
.kv-group.area-hints ul {
  padding-left: 1.25rem;
  margin: 0.25rem 0 0;
}
.kv-group.area-hints li { margin-bottom: 0.35rem; }

/* ===== SPEZIELL: Signierte-Daten-Button mittig, auch ohne .tile-actions ===== */

/* Falls der Button korrekt in .tile-actions liegt: */
.tile--signed .tile-actions {
  display:flex;
  align-self: anchor-center;
}

/* Falls der Button NICHT in .tile-actions liegt: als Fallback mittig */
.tile--signed .btn,
.tile--signed .btn-secondary,
.tile--signed button {
  display: inline-flex;
  margin-left: auto;
  margin-right: auto;   /* -> zentriert */
  min-width: 160px;
}
