/* -------------------------------------------------------
   Translogix – GAME UI (helles Theme)
   Datei: assets/css/game.css
------------------------------------------------------- */

/* Body-Scope fürs Spiel */
body.game-body{ display:flex; flex-direction:column; min-height:100vh; }

/* Stats-Bar */
.stats-bar{ background:#f6f9fd; border-bottom:1px solid var(--border); }
.stats-row{ display:flex; gap:1.25rem; align-items:center; padding:.45rem 0; }
.stat{ display:inline-flex; align-items:center; gap:.4rem; padding:.2rem .4rem; }
.stat i{ color:var(--primary); opacity:.9; }
.stat-label{ color:var(--text-dim); font-weight:600; font-size:.9rem; }
.stat-value{ font-weight:800; color:var(--text); }

/* Trennerpunkte ab md */
@media (min-width: 801px){
  .stats-row .stat + .stat{ position:relative; margin-left:.6rem; }
  .stats-row .stat + .stat::before{
    content:""; position:absolute; left:-.75rem; top:50%;
    width:4px; height:4px; background:#cfd8e3; border-radius:50%; transform:translateY(-50%);
  }
}

/* Dashboard */
.kpi{ display:grid; gap:10px; grid-template-columns:repeat(4,1fr); margin:.6rem auto 1rem; }
.kpi-card{ background:var(--card); border:1px solid var(--border); border-radius:var(--radius);
  padding:1rem; box-shadow:var(--shadow-sm); }
.kpi-card h3{ margin:0 0 .35rem; color:var(--text-dim); font-size:.95rem; }
.kpi-value{ font-size:1.6rem; font-weight:800; }
.kpi-sub{ margin-top:.2rem; color:var(--text-dim); }
.progress{ width:100%; height:8px; background:#eef2f7; border-radius:999px; margin-top:.5rem; overflow:hidden; }
.progress span{ display:block; height:100%; background:linear-gradient(90deg,var(--primary),#54a0de); }

.dash-grid{ display:grid; grid-template-columns:1.2fr 1fr; gap:10px; margin-bottom:1.5rem; }
.panel{ background:var(--card); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-sm); display:flex; flex-direction:column; }
.panel-head{ display:flex; justify-content:space-between; align-items:center; padding:.8rem 1rem; border-bottom:1px solid var(--border); }
.panel-head h2{ margin:0; font-size:1.05rem; color:var(--primary-hover); }
.panel-body{ padding:.8rem 1rem; }

/* Quick Actions */
.quick-actions{ display:grid; grid-template-columns:repeat(2,1fr); gap:.6rem; }
.qa{ display:block; text-decoration:none; padding:.75rem; border:1px dashed var(--border);
  border-radius:10px; color:var(--text); background:#fbfcfe; }
.qa:hover{ border-color:var(--primary); background:#f1f7fe; }

/* Tabelle */
.table-wrap{ overflow:auto; }
.tbl{ width:100%; border-collapse:collapse; font-size:.95rem; }
.tbl th,.tbl td{ padding:.6rem .5rem; border-bottom:1px solid var(--border); text-align:left; }
.tbl thead th{ color:var(--text-dim); font-weight:700; }

/* Fleet */
.fleet{ list-style:none; margin:0; padding:0; display:grid; gap:.6rem; }
.fleet li{ display:grid; grid-template-columns:60px 1fr auto; gap:.6rem; align-items:center; padding:.5rem;
  border:1px solid var(--border); border-radius:10px; background:#fbfcfe; }
.fleet img{ width:60px; height:40px; object-fit:cover; border-radius:6px; }
.fleet-name{ font-weight:700; }
.badge{ display:inline-block; padding:.25rem .5rem; border-radius:999px; font-size:.8rem; border:1px solid var(--border); }
.badge.ok{ background:#e9f9ef; color:#2c7a4b; border-color:#bfe8cd; }
.badge.idle{ background:#eef1f6; color:#495369; border-color:#dbe1ea; }
.badge.warn{ background:#fff5e6; color:#8a5a11; border-color:#f3d5a6; }

/* Map + Sidebar */
.map-shell{ display:grid; grid-template-columns:320px 1fr; gap:10px; padding:.8rem 0 1.2rem; }
.map-sidebar{
  background:var(--bg-soft); border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow-sm); padding:.6rem .6rem .8rem; position:sticky; top:calc(60px + 42px + 8px);
  max-height:calc(100vh - 120px); overflow:auto;
}
.sb-head{ display:flex; align-items:center; gap:.5rem; padding:.2rem .2rem .5rem; border-bottom:1px solid var(--border); margin-bottom:.6rem; }
.sb-toggle{ border:1px solid var(--border); background:#f5f8fc; border-radius:8px; padding:.35rem .6rem; cursor:pointer; }
.sb-section{ margin:.6rem 0; }
.sb-label{ font-size:.9rem; color:var(--text-dim); display:block; margin-bottom:.25rem; }
.sb-search{ display:grid; grid-template-columns:1fr auto; gap:.4rem; }
.sb-search input{ height:38px; border:1px solid var(--border); border-radius:8px; background:var(--bg); color:var(--text); padding:0 .8rem; }
.sb-list{ list-style:none; padding:0; margin:0; display:grid; gap:.35rem; }
.sb-list li{ display:flex; justify-content:space-between; gap:.6rem; padding:.45rem .55rem; border:1px solid var(--border); border-radius:8px; background:#fbfcfe; cursor:pointer; }
.sb-list li:hover{ border-color:var(--primary); background:#f1f7fe; }
.sb-detail{ border:1px dashed var(--border); border-radius:8px; padding:.6rem .7rem; background:#fbfcfe; }

.map-panel{ display:flex; flex-direction:column; gap:.5rem; }
.map-head{ display:flex; align-items:center; justify-content:space-between; gap:.6rem; }
.map-head h1{ margin:0; color:var(--primary); }
.map-actions{ display:flex; gap:.4rem; flex-wrap:wrap; }
.map-container{
  height:calc(100vh - 220px); min-height:520px; background:#eef4fb;
  border:1px solid var(--border); border-radius:var(--radius); overflow:hidden;
}
.pin{ width:18px; height:18px; border-radius:50%; border:2px solid #fff; box-shadow:0 1px 4px rgba(0,0,0,.25); }
.pin-city{ background:#1E73BE; } .pin-depot{ background:#2ECC71; }

/* Footer (Game) */
.game-footer{ background:var(--bg-soft); border-top:1px solid var(--border); text-align:center; padding:1rem; color:var(--text-dim); }

/* Responsive */
@media (max-width: 1100px){
  .kpi{ grid-template-columns:repeat(2,1fr); }
  .dash-grid{ grid-template-columns:1fr; }
  .map-shell{ grid-template-columns:280px 1fr; }
}
@media (max-width: 980px){
  .stats-row{ flex-direction:column; align-items:flex-start; gap:.2rem; }
  .map-shell{ grid-template-columns:1fr; }
  .map-sidebar{ position:relative; top:auto; max-height:none; }
  .map-container{ height:calc(100vh - 260px); min-height:420px; }
}
@media (max-width: 640px){
  .quick-actions{ grid-template-columns:1fr; }
  .fleet li{ grid-template-columns:50px 1fr auto; }
}
/* ==== Company Setup Styles ==== */

/* Step-Header */
.setup-steps {
  display:flex; gap:.6rem; margin:.6rem 0 1rem;
}
.setup-steps .step {
  display:inline-flex; align-items:center; gap:.45rem;
  padding:.35rem .6rem; border-radius:999px; border:1px solid var(--border);
  background:#fff; color:var(--text-dim); font-weight:600; font-size:.9rem;
}
.setup-steps .step span {
  display:inline-grid; place-items:center; width:20px; height:20px; border-radius:50%;
  background:#eef4fb; color:var(--primary); font-size:.8rem; font-weight:800;
}
.setup-steps .step.active { border-color:#cfe3f7; color:var(--primary); background:#f6f9ff; }
.setup-steps .step.done   { color:#4b5563; }

/* Icon Grid Chips */
.icon-grid {
  display:grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap:.6rem;
}
.icon-tile {
  display:flex; align-items:center; gap:.5rem;
  padding:.6rem .8rem; border-radius:12px; border:1px solid var(--border);
  background:#fff; cursor:pointer; box-shadow:var(--shadow-sm);
}
.icon-tile .icon-face i { font-size:1.2rem; color:var(--primary); }
.icon-tile .icon-name   { font-size:.9rem; color:var(--text-dim); text-transform:lowercase; }
.icon-tile input        { display:none; }
.icon-tile:hover        { border-color:#cde0f5; background:#f7fbff; }
.icon-tile input:checked ~ .icon-name { color:var(--primary); font-weight:700; }
.icon-tile input:checked + .icon-face i { filter: drop-shadow(0 0 0.4px var(--primary)); }

/* Color Presets */
.color-pick-wrap { display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; }
.color-swatches  { display:flex; gap:.4rem; }
.color-swatches button {
  width:28px; height:28px; border-radius:8px; border:1px solid var(--border);
  background: var(--swatch,#1E73BE); cursor:pointer; box-shadow:var(--shadow-sm);
}
.color-swatches button.active { outline: 2px solid #a3c7f3; }

/* Map Search Bar */
.map-searchbar {
  display:grid; grid-template-columns: 1fr auto; gap:.4rem;
  margin-bottom:.4rem;
}
.map-searchbar input {
  height:38px; border:1px solid var(--border); border-radius:8px;
  background:var(--bg); color:var(--text); padding:0 .8rem;
}

/* Map Picker */
.map-picker {
  height:380px; min-height:320px; background:#eef4fb;
  border:1px solid var(--border); border-radius:12px;
  overflow:hidden; box-shadow: var(--shadow-sm);
}

/* Preview Card */
.company-card.pretty {
  align-items:center; gap:1rem; padding:1rem; border-radius:16px;
  background:#fff;
  box-shadow: 0 8px 26px rgba(16,24,40,.06), inset 0 0 0 1px var(--border);
}
.company-mark {
  --brand:#1E73BE; width:64px; height:64px; border-radius:16px;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand), #ffffff 28%));
  display:grid; place-items:center; color:#fff; position:relative;
  box-shadow: 0 10px 24px rgba(0,0,0,.10);
}
.company-mark .mark-badge {
  position:absolute; bottom:-8px; right:-8px; font-size:.7rem; font-weight:800;
  background:#111827; color:#fff; padding:.15rem .4rem; border-radius:999px;
  box-shadow:0 4px 10px rgba(0,0,0,.14);
}
.company-mark .mark-icon i { font-size:1.5rem; color:#fff; }
.company-mark .mark-icon span { font-size:1.2rem; font-weight:900; color:#fff; letter-spacing:.5px; }

.company-meta .company-name { font-size:1.2rem; font-weight:900; }
.small { font-size:.88rem; }

/* Responsive Tweaks */
@media (max-width: 980px) {
  .icon-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .icon-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

/* ==== Form Inputs (einheitlich) ==== */
.setup-form .form-row { margin-bottom: .9rem; }
.setup-form label { display:block; font-weight:700; margin-bottom:.35rem; }

/* Basis-Feld */
.input {
  width: 100%;
  max-width: 460px;
  height: 40px;
  padding: 0 .85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.input::placeholder { color: #9aa5b1; }

/* Fokus & Hover */
.input:hover { background:#f4f7fb; }
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,115,190,.12);
  background:#fff;
}

/* Textarea (falls später genutzt) */
.textarea {
  width: 100%;
  max-width: 720px;
  min-height: 96px;
  padding: .6rem .85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}
.textarea:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(30,115,190,.12); background:#fff; }

/* Color-Picker neben Presets schön einreihen */
.color-pick-wrap input[type="color"] {
  width: 48px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0;
  background:#fff;
  cursor: pointer;
}

/* Suchleiste bündig */
.map-searchbar .input {
  max-width: none;   /* volle Breite im Grid */
  height: 40px;
}

/* Fehlermeldungen konsistent */
.help.error, .alert.error {
  color: #8a1620;
  background: #fff1f0;
  border: 1px solid #ffd3cf;
  border-radius: 10px;
  padding: .5rem .7rem;
  margin-top: .4rem;
  max-width: 460px;
}

/* Buttons in Formularreihe ausrichten */
.form-actions { margin-top: .8rem; display:flex; gap:.5rem; align-items:center; }

/* Radio-/Toggle-Zeile (Logo-Option) */
.logo-option-tabs {
  display: inline-flex;
  gap: .6rem;
  padding: .2rem;
  background: #f6f9fd;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.logo-option-tabs label {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .25rem .6rem; border-radius: 999px; cursor: pointer; user-select: none;
}
.logo-option-tabs input { appearance: none; width: 0; height: 0; }
.logo-option-tabs input:checked + * /* kein Effekt */ {}
.logo-option-tabs input:checked ~ span {}
.logo-option-tabs input:checked ~ label {}
.logo-option-tabs input:checked + label,
.logo-option-tabs input:checked ~ label:has(input:checked) { /* Fallback für breite Unterstützung */
  background: #e8f2fd; color: var(--primary); font-weight:700;
}

/* Kleinere Helfer */
.small { font-size:.88rem; color: var(--text-dim); }
