/* =========================================================================
   MachiYou wireframes — HUB DESIGN (index.html + sub-pages paczka-N.html)

   Cards Dashboard concept: 4 paczki jako karty na home, sub-pages per paczka
   z screens grupowanymi i flows visual. Globalny search.
   ========================================================================= */

/* === RESET / BASE === */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: #fafafa;
  color: #1a1a1a;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* === GLOBAL NAV === */

.hub-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid #e5e5e5;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.hub-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}

.hub-nav-brand-logo {
  width: 28px;
  height: 28px;
  background: #1a1a1a;
  color: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}

.hub-nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

.hub-nav-link {
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: #555;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s;
}

.hub-nav-link:hover { background: #f0f0f0; color: #1a1a1a; }
.hub-nav-link.is-active { background: #1a1a1a; color: #fff; }

/* === SEARCH BOX === */

.hub-search {
  position: relative;
  flex: 1;
  max-width: 360px;
  min-width: 200px;
}

.hub-search input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid #d4d4d4;
  border-radius: 8px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.hub-search input:focus {
  border-color: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

.hub-search::before {
  content: "🔍";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  font-size: 14px;
  pointer-events: none;
}

.hub-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: #fff;
  border: 1px solid #d4d4d4;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 60vh;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.hub-search-results.is-open { display: block; }

.hub-search-empty {
  padding: 20px;
  text-align: center;
  color: #999;
  font-size: 13px;
}

.hub-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.1s;
}

.hub-search-result:last-child { border-bottom: none; }
.hub-search-result:hover, .hub-search-result.is-active { background: #f5f5f5; }

.hub-search-result-id {
  background: #1a1a1a;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  min-width: 36px;
  text-align: center;
}

.hub-search-result-title {
  flex: 1;
  min-width: 0;
}

.hub-search-result-name {
  font-weight: 600;
  font-size: 13px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-search-result-meta {
  font-size: 11px;
  color: #888;
  display: block;
}

.hub-search-result-pkg {
  font-size: 18px;
  flex-shrink: 0;
}

/* === MAIN CONTAINER === */

.hub-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* === HERO (homepage only) === */

.hub-hero {
  margin-bottom: 36px;
}

.hub-hero h1 {
  font-size: 36px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}

.hub-hero-subtitle {
  font-size: 16px;
  color: #666;
  margin: 0;
}

.hub-hero-stats {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #555;
}

.hub-hero-stats strong { color: #1a1a1a; }

/* === CARDS GRID (homepage) === */

.hub-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.hub-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s, box-shadow 0.18s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hub-card:hover {
  transform: translateY(-2px);
  border-color: #1a1a1a;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.hub-card-emoji {
  font-size: 36px;
  line-height: 1;
}

.hub-card-id {
  font-size: 11px;
  color: #888;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hub-card-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.hub-card-subtitle {
  font-size: 13px;
  color: #666;
  margin: 0;
}

.hub-card-stats {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: #555;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.hub-card-stats strong { color: #1a1a1a; font-weight: 700; }

.hub-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  margin-top: 6px;
}

/* === SECTION HEADERS === */

.hub-section {
  margin-bottom: 40px;
}

.hub-section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
}

.hub-section-subtitle {
  font-size: 13px;
  color: #666;
  margin: 0 0 16px;
}

/* === FLOWS PREVIEW (homepage) === */

.hub-flows-quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.hub-flow-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hub-flow-card:hover {
  border-color: #1a1a1a;
  transform: translateY(-1px);
}

.hub-flow-card-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hub-flow-card-pkg { font-size: 14px; }

.hub-flow-card-title {
  font-weight: 600;
  font-size: 14px;
  margin: 0;
}

.hub-flow-card-steps {
  font-size: 11px;
  color: #888;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

/* === BREADCRUMB (sub-pages) === */

.hub-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #777;
  margin-bottom: 20px;
}

.hub-breadcrumb a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.hub-breadcrumb a:hover { color: #1a1a1a; }

.hub-breadcrumb-sep { opacity: 0.4; }

/* === SUB-PAGE HEADER === */

.hub-page-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e5e5;
}

.hub-page-emoji {
  font-size: 48px;
  line-height: 1;
}

.hub-page-title-block { flex: 1; }

.hub-page-title {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: -0.3px;
}

.hub-page-subtitle {
  font-size: 14px;
  color: #666;
  margin: 0;
}

.hub-page-description {
  font-size: 14px;
  color: #444;
  line-height: 1.65;
  margin: 12px 0 0;
  max-width: 760px;
}

.hub-page-stats-bar {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #555;
  margin-top: 14px;
}

.hub-page-stats-bar strong { color: #1a1a1a; font-weight: 700; font-size: 18px; display: block; }

/* === GROUP SECTION (sub-page) === */

.hub-group {
  margin-bottom: 28px;
}

.hub-group-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.hub-group-id {
  background: #1a1a1a;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}

.hub-group-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}

.hub-group-count {
  font-size: 13px;
  color: #888;
  font-weight: 500;
}

/* === SCREEN CARD (thumbnail + caption, sub-page grid) === */

.hub-screens {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.hub-screen {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}

.hub-screen:hover {
  border-color: #1a1a1a;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.hub-screen-thumb {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: top;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
}

.hub-screen-caption {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hub-screen-caption-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hub-screen-id {
  background: #f0f0f0;
  color: #1a1a1a;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}

.hub-screen-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.hub-screen-meta {
  font-size: 11px;
  color: #888;
}

/* === FLOW DETAIL (sub-page) === */

.hub-flow {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 12px;
}

.hub-flow-title {
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hub-flow-number {
  background: #1a1a1a;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.hub-flow-journey {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.hub-flow-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: #f5f5f5;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: #1a1a1a;
  white-space: nowrap;
  transition: background 0.12s;
}

.hub-flow-step:hover { background: #1a1a1a; color: #fff; }

.hub-flow-arrow {
  color: #999;
  font-size: 12px;
  user-select: none;
}

/* === FOOTER === */

.hub-footer {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid #e5e5e5;
  font-size: 12px;
  color: #888;
  text-align: center;
}

.hub-footer a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.hub-footer a:hover { color: #1a1a1a; }

/* === RESPONSIVE === */

@media (max-width: 720px) {
  .hub-nav { flex-wrap: wrap; padding: 10px 16px; }
  .hub-nav-links { width: 100%; order: 2; }
  .hub-search { max-width: none; }
  .hub-container { padding: 24px 16px; }
  .hub-hero h1 { font-size: 28px; }
  .hub-cards { grid-template-columns: 1fr; }
  .hub-page-emoji { font-size: 36px; }
  .hub-page-title { font-size: 22px; }
}
