/* ============================================================
   route-builder-panda.css — Panda CSS design token integration
   
   Uses Spartan Forge design tokens via Panda-generated CSS vars.
   These vars are generated by `panda codegen` and available at
   runtime as --{category}-{token} custom properties.
   ============================================================ */

/* Import Panda's generated CSS vars */
@import url('../styled-system/tokens/tokens.css');

/* ============================================================
   COMPACT BAR — Collapsed state top-bar integration
   ============================================================ */

.rb-compact-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(15, 18, 28, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 210, 74, 0.25);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rb-compact-bar:hover {
  border-color: rgba(255, 210, 74, 0.5);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* Expand button */
.rb-expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: rgba(168, 153, 104, 0.12);
  border: 1px solid rgba(168, 153, 104, 0.3);
  border-radius: 4px;
  color: #f0c040;
  cursor: pointer;
  transition: all 0.12s ease;
  flex-shrink: 0;
}

.rb-expand-btn:hover {
  background: rgba(168, 153, 104, 0.22);
  border-color: rgba(168, 153, 104, 0.5);
}

/* Filter chips */
.rb-compact-filters {
  flex: 1;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: #c9b577;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.rb-chip {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(255, 210, 74, 0.1);
  border: 1px solid rgba(255, 210, 74, 0.2);
  border-radius: 3px;
  margin-right: 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Compact action buttons */
.rb-compact-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.rb-compact-action {
  padding: 4px 8px;
  background: rgba(255, 210, 74, 0.15);
  border: 1px solid rgba(255, 210, 74, 0.3);
  border-radius: 4px;
  color: #f0c040;
  font: 700 9px/1 'Barlow Condensed', sans-serif;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.12s ease;
}

.rb-compact-action:hover {
  background: rgba(255, 210, 74, 0.28);
  border-color: rgba(255, 210, 74, 0.5);
}

.rb-compact-action:active {
  transform: translateY(1px);
}

/* Collapse button */
.rb-collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: rgba(168, 153, 104, 0.08);
  border: 1px solid rgba(168, 153, 104, 0.2);
  border-radius: 4px;
  color: #f0c040;
  cursor: pointer;
  transition: all 0.12s ease;
}

.rb-collapse:hover {
  background: rgba(168, 153, 104, 0.18);
  border-color: rgba(168, 153, 104, 0.4);
}

/* ============================================================
   COLLAPSED STATE
   ============================================================ */

.route-builder-panel.collapsed {
  width: auto;
  max-width: 420px;
  min-width: 200px;
  max-height: none;
  overflow: visible;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 0;
  box-shadow: none;
  top: calc(52px + env(safe-area-inset-top, 0));
  right: calc(12px + env(safe-area-inset-right, 0));
}

.route-builder-panel.collapsed .rb-compact-bar {
  display: flex;
}

.route-builder-panel.collapsed .rb-header,
.route-builder-panel.collapsed .rb-body {
  display: none;
}

/* ============================================================
   PANDA TOKEN INTEGRATION — Runtime CSS custom properties
   ============================================================ */

/* Use Panda-generated tokens when available, fall back to hardcoded values */
@supports (--panda-vars: active) {
  .rb-compact-bar {
    background: var(--colors-bg-dropdown, rgba(15, 18, 28, 0.88));
    border-color: var(--colors-border-focus, rgba(255, 210, 74, 0.25));
  }

  .rb-compact-filters {
    color: var(--colors-accent-bright, #c9b577);
  }

  .rb-chip {
    background: var(--colors-accent, rgba(255, 210, 74, 0.1));
    border-color: var(--colors-accent-dim, rgba(255, 210, 74, 0.2));
  }

  .rb-primary {
    background: linear-gradient(180deg, var(--colors-gold-bright, #f0c040), #c9a84c);
    border-radius: var(--radii-md, 6px);
  }

  .rb-status {
    color: var(--colors-text-dim, #b8c0cc);
  }
}
