/* ============================================================
   AH-tým — Brand stylesheet
   ============================================================
   Ford Trucks barvy + system font stack (offline-safe).
   Žádné Google Fonts — poučení z Garance PWA.
   ============================================================ */

:root {
  /* Ford Trucks brand */
  --navy:    #0A1628;
  --navy2:   #0F2040;
  --navy3:   #162B52;
  --navy4:   #1E3666;
  --orange:  #E8461E;
  --orange2: #FF5A30;
  --gold:    #F5A623;

  /* Status colors */
  --green:   #2ECC71;
  --yellow:  #F39C12;
  --red:     #E74C3C;
  --blue:    #4A90D9;
  --purple:  #9B59B6;

  /* Text */
  --text:      #E8EDF5;
  --text-dim:  #8A9BB5;
  --text-faint:#5A6B82;

  /* Glow */
  --orange-glow: rgba(232, 70, 30, 0.15);
  --gold-glow:   rgba(245, 166, 35, 0.15);
  --green-glow:  rgba(46, 204, 113, 0.15);
  --red-glow:    rgba(231, 76, 60, 0.15);
  --blue-glow:   rgba(74, 144, 217, 0.15);

  /* Borders */
  --border:        rgba(255, 255, 255, 0.08);
  --border-active: rgba(232, 70, 30, 0.4);

  /* System font stack — žádné Google Fonts (offline safety) */
  --font-stack:
    -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;

  --font-condensed:
    "Arial Narrow", "Helvetica Neue Condensed", "Roboto Condensed",
    "Open Sans Condensed", Impact, sans-serif;

  --font-mono:
    ui-monospace, SFMono-Regular, "SF Mono", Consolas,
    "Liberation Mono", Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--navy);
  color: var(--text);
  font-family: var(--font-stack);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Grid pattern overlay (jako u Garance) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(232, 70, 30, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 70, 30, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* ---------------- HEADER ---------------- */
.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--navy2) 0%, var(--navy3) 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--orange);
  border-radius: 4px;
  margin-bottom: 28px;
}

.app-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange2) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 6px 20px rgba(232, 70, 30, 0.3);
  flex-shrink: 0;
}

.app-title h1 {
  font-family: var(--font-condensed);
  font-weight: 900;
  font-size: 32px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 4px;
}
.app-title h1 .accent { color: var(--orange); }

.app-title .sub {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ---------------- CARDS ---------------- */
.card {
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px 22px;
  margin-bottom: 16px;
}

.card.accent { border-left: 3px solid var(--orange); }
.card.gold   { border-left: 3px solid var(--gold); }
.card.green  { border-left: 3px solid var(--green); }
.card.red    { border-left: 3px solid var(--red); }
.card.blue   { border-left: 3px solid var(--blue); }

.card-title {
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 8px;
}

/* ---------------- BUTTONS ---------------- */
.btn {
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: 4px;
  border: 1px solid var(--orange);
  background: var(--orange);
  color: white;
  cursor: pointer;
  transition: all 0.15s;
}

.btn:hover { background: var(--orange2); border-color: var(--orange2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.ghost {
  background: transparent;
  color: var(--orange);
}
.btn.ghost:hover { background: var(--orange-glow); }

.btn.danger {
  border-color: var(--red);
  background: var(--red);
  color: white;
}

/* ---------------- LOG / OUTPUT ---------------- */
.log-output {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 16px;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  max-height: 320px;
  overflow-y: auto;
}

.log-output .ok   { color: var(--green); }
.log-output .err  { color: var(--red); }
.log-output .info { color: var(--blue); }
.log-output .warn { color: var(--gold); }

/* ---------------- BADGES ---------------- */
.badge {
  display: inline-block;
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 2px;
  border: 1px solid;
}

.badge.green  { color: var(--green); border-color: var(--green); background: var(--green-glow); }
.badge.orange { color: var(--orange); border-color: var(--orange); background: var(--orange-glow); }
.badge.red    { color: var(--red); border-color: var(--red); background: var(--red-glow); }
.badge.gold   { color: var(--gold); border-color: var(--gold); background: var(--gold-glow); }
.badge.blue   { color: var(--blue); border-color: var(--blue); background: var(--blue-glow); }
.badge.dim    { color: var(--text-dim); border-color: var(--text-faint); background: transparent; }

/* ---------------- FOOTER ---------------- */
.app-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-faint);
}

.app-footer .accent { color: var(--orange); }
.app-footer .gold   { color: var(--gold); }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 480px) {
  .page { padding: 16px 12px 60px; }
  .app-title h1 { font-size: 26px; }
  .app-header { padding: 16px 18px; }
}


/* ============================================================
   PWA — standalone mode (iPhone notch, safe area, viewport fit)
   ============================================================ */
@media (display-mode: standalone), (display-mode: fullscreen) {
  html, body {
    /* iPhone notch / Dynamic Island */
    padding-top:    env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left:   env(safe-area-inset-left);
    padding-right:  env(safe-area-inset-right);
  }
  /* Vypnout text-selection na ne-form prvcích — vypadá víc nativně */
  body * {
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }
  input, textarea, select, [contenteditable] {
    -webkit-user-select: text;
  }
}
