/* ==========================================
   BOBO SHOPTET API — SPOLEČNÝ CSS
   Paleta vychází z multiadmin (orders server)
   ========================================== */

/* === PROMĚNNÉ === */
:root {
  --color-primary: #a855f7;
  --color-primary-dark: #7c3aed;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #ec4899;

  --bg-body: #f1f5f9;
  --bg-card: #ffffff;
  --bg-hover: #f8fafc;

  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  --border-color: #e2e8f0;
  --border-radius: 12px;
  --border-radius-sm: 8px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

  --gradient-header: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  /* Barvy eshopů */
  --shop-sp: #a855f7;
  --shop-te: #ec4899;
  --shop-do: #f59e0b;
}

/* === DARK MODE === */
[data-theme="dark"] {
  --bg-body: #1a1f2e;
  --bg-card: #232a3b;
  --bg-hover: #2a3349;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border-color: #334155;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);

  --gradient-header: linear-gradient(135deg, #4c5fd7 0%, #5e3a8a 100%);
}

/* === RESET & BASE === */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* === HEADER BANNER === */
.header-compact {
  background: var(--gradient-header);
  border-radius: var(--border-radius);
  margin: 16px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  position: sticky;
  top: 16px;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  flex-wrap: wrap;
}

.header-brand {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
}
.header-brand:hover { transform: scale(1.02); }

/* Globální logo obrázek */
.header-logo-img {
  height: 96%;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
  margin-top: -4px;
}

/* Gradientní pohyblivá linka pod logem — čočkový tvar 2px→5px→2px */
.header-brand::after {
  content: "";
  display: block;
  height: 5px;
  width: 100%;
  clip-path: polygon(
    0% 30%,  5% 18%,  15% 7%,  30% 1%,  50% 0%,
    70% 1%,  85% 7%,  95% 18%, 100% 30%,
    100% 70%, 95% 82%, 85% 93%, 70% 99%, 50% 100%,
    30% 99%, 15% 93%, 5% 82%,  0% 70%
  );
  background: linear-gradient(90deg, #f472b6, #22d3ee, #a78bfa, #f472b6);
  background-size: 200% 100%;
  animation: logoGradientLine 2.5s linear infinite;
  margin-top: 2px;
  flex-shrink: 0;
}

@keyframes logoGradientLine {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* Starý textový placeholder (zachován pro zpětnou kompatibilitu) */
.header-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 16px; color: #764ba2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-title h1 {
  font-size: 18px; font-weight: 700; color: white; line-height: 1.2;
}
.header-title .sub {
  font-size: 12px; color: rgba(255,255,255,0.75);
}

/* Digitální hodiny */
.header-clock {
  margin-left: auto;
  font-family: 'Courier New', monospace;
  font-size: 24px;
  font-weight: 700;
  color: #00ffd5;
  text-shadow: 0 0 10px rgba(0, 255, 213, 0.5);
  letter-spacing: 2px;
}

/* Status badges */
.header-badges {
  display: flex; gap: 8px; align-items: center;
}

.badge {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap;
}
.badge-ok { background: rgba(16, 185, 129, 0.2); color: #ecfdf5; border: 1px solid rgba(16,185,129,0.4); }
.badge-warn { background: rgba(245, 158, 11, 0.2); color: #fffbeb; border: 1px solid rgba(245,158,11,0.4); }
.badge-bad { background: rgba(239, 68, 68, 0.2); color: #fef2f2; border: 1px solid rgba(239,68,68,0.4); }

/* === OBSAHOVÝ WRAP === */
.content-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* === HUB KARTY (ROZCESTNÍK) === */
.hub-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.hub-card {
  display: block;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s, box-shadow 0.15s;
  border-left: 5px solid var(--color-primary);
  position: relative;
  overflow: hidden;
}
.hub-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.hub-card .icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.hub-card h3 {
  font-size: 18px; font-weight: 800; margin-bottom: 4px;
}
.hub-card p {
  font-size: 14px; color: var(--text-secondary); margin: 0;
}

/* Varianty barev karet */
.hub-card.card-sp { border-left-color: var(--shop-sp); }
.hub-card.card-te { border-left-color: var(--shop-te); }
.hub-card.card-do { border-left-color: var(--shop-do); }
.hub-card.card-webhook { border-left-color: var(--color-success); }
.hub-card.card-api { border-left-color: var(--color-info); }

/* === SECTION KARTY === */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.section-card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-card .card-title {
  font-size: 16px; font-weight: 700;
}

/* === SHOP PILLS (eshop identifikátor) === */
.shop-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: white;
}
.shop-pill.sp { background: var(--shop-sp); }
.shop-pill.te { background: var(--shop-te); }
.shop-pill.do { background: var(--shop-do); }

/* === TLAČÍTKA === */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  font-size: 13px; font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-header);
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

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

/* === TABULKY === */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }

/* === LOG / MONOSPACE === */
.log-box {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: var(--border-radius-sm);
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.8;
}

.log-line { padding: 2px 0; }
.log-line .time { color: #94a3b8; }
.log-line .ok { color: #34d399; }
.log-line .err { color: #f87171; }
.log-line .warn { color: #fbbf24; }

/* === INPUTS === */
.input {
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  background: white;
  transition: border-color 0.15s;
  outline: none;
}
.input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

/* === STATUS DOTS === */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.green { background: var(--color-success); }
.status-dot.red { background: var(--color-danger); }
.status-dot.orange { background: var(--color-warning); }

/* === UPTIME BAR === */
.uptime-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  margin-top: 16px;
  font-size: 13px; color: var(--text-secondary);
}

/* === DARK MODE OVERRIDES === */
[data-theme="dark"] .header-compact {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .header-logo {
  background: #2a3349;
  color: #a78bfa;
}

[data-theme="dark"] thead th {
  background: #1e2636;
}

[data-theme="dark"] .input {
  background: #2a3349;
  color: var(--text-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] .btn-ghost {
  color: var(--text-secondary);
  border-color: var(--border-color);
}

[data-theme="dark"] .btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

[data-theme="dark"] .uptime-bar {
  background: rgba(255,255,255,0.04);
}

/* === DARK MODE TOGGLE === */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all 0.2s;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

/* === RESPONSIVE === */
@media (max-width: 720px) {
  .header-inner { padding: 12px 16px; gap: 10px; }
  .header-clock { font-size: 18px; }
  .hub-cards { grid-template-columns: 1fr; }
  .content-wrap { padding: 0 10px 30px; }
}

@media (max-width: 480px) {
  .header-compact { margin: 8px; top: 8px; }
  .hub-card { padding: 16px; }
}

/* Logout button */
.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  font-size: 20px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.logout-btn:hover {
  background: rgba(220,50,50,0.35);
  color: #fff;
  transform: scale(1.1);
}

/* Gear + logout tlacitka v headeru */
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: 12px; }
.header-action-btn { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.15); background: transparent; font-size: 18px; text-decoration: none; cursor: pointer; transition: background .15s; }
.header-action-btn:hover { background: rgba(255,255,255,0.1); }
