/*
 * Campaign Wizard Stylesheet
 *
 * Single-column layout with top progress bar for the 4-step campaign wizard.
 */

/* ============================================
   Wizard Container
   ============================================ */

.wizard-container {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 8rem);
}

.wizard-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ============================================
   Progress Bar (horizontal top bar)
   ============================================ */

.wizard-progress-bar {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--color-gray-200);
}

.wizard-progress-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: max-content;
}

.wizard-progress-item {
  display: flex;
  align-items: center;
}

/* Connector line between steps — dashed */
.wizard-progress-connector {
  width: 6rem;
  height: 0;
  border-top: 2px dashed var(--color-gray-200);
  margin: 0 0.5rem;
}

/* Step link / static container */
.wizard-progress-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease;
}

.wizard-progress-step:hover {
  background-color: var(--color-gray-50);
}

.wizard-progress-step--static {
  cursor: default;
}

.wizard-progress-step--static:hover {
  background-color: transparent;
}

.wizard-progress-step--active:hover {
  background-color: transparent;
}

/* Step dot indicators */
.wizard-progress-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 1rem;
  font-weight: 600;
}

.wizard-progress-dot--active {
  background-color: var(--color-orange-1);
  color: white;
}

.wizard-progress-dot--completed {
  background-color: var(--color-orange-5);
  color: white;
}

.wizard-progress-dot--pending {
  background-color: var(--color-gray-200);
  color: var(--color-gray-900);
}

/* Step label */
.wizard-progress-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-gray-900);
  white-space: nowrap;
}

.wizard-progress-step--active .wizard-progress-label {
  color: var(--color-orange-1);
}

/* ============================================
   Step Content Area
   ============================================ */

.wizard-content {
  flex: 1;
  min-width: 0;
}

.wizard-step-content {
  padding: 1.5rem;
  max-width: 56rem;
  margin: 0 auto;
}

/* ============================================
   Footer Navigation
   ============================================ */

.wizard-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--color-gray-200);
}

.wizard-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 9999px;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
}

.wizard-btn--back {
  background: transparent;
  border: 1px solid var(--color-gray-900);
  color: var(--color-gray-800);
  text-decoration: none;
}

.wizard-btn--back:hover {
  background-color: var(--color-gray-50);
  border-color: var(--color-gray-950);
  color: var(--color-gray-950);
}

.wizard-btn--next {
  background-color: var(--color-gray-1000);
  color: white;
}

.wizard-btn--next:hover {
  background-color: var(--color-gray-950);
}

/* ============================================
   Step Transitions
   ============================================ */

turbo-frame#wizard_step {
  display: block;
  min-height: 300px;
}

/* ============================================
   Preset Cards
   ============================================ */

.preset-card {
  border: 1px solid var(--color-gray-200);
  border-radius: 0.5rem;
  padding: 1rem;
  transition: all 0.15s ease;
  background-color: var(--color-white);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.preset-card:hover {
  border-color: var(--color-gray-300);
  background-color: var(--color-gray-50);
}

.preset-card--selected {
  border-color: var(--color-gray-1000);
}

.preset-card--selected:hover {
  border-color: var(--color-gray-1000);
}

/* ============================================
   Template Cards (Step 1)
   ============================================ */

.template-card {
  border: 1px solid var(--color-gray-500);
  border-radius: 1.5rem;
  padding: 1.25rem;
  transition: all 0.15s ease;
  background-color: var(--color-white);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.template-card:hover {
  border-color: var(--color-gray-900);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.template-card--custom {
  border-style: dashed;
  border-color: var(--color-gray-700);
}

.template-card--custom:hover {
  border-color: var(--color-gray-900);
}

/* ============================================
   Section Headers (Step 2)
   ============================================ */

.wizard-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px dashed var(--color-gray-200);
}

.wizard-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-gray-1000);
}

/* ============================================
   Budget Type Cards (Step 2)
   ============================================ */

.budget-card {
  border: 1px solid var(--color-gray-200);
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.budget-card--selected {
  border-color: var(--color-gray-1000);
  border-width: 2px;
}

.budget-card-body {
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.budget-card-footer {
  padding: 1rem;
  border-top: 1px solid var(--color-gray-200);
  font-size: 0.75rem;
  color: var(--color-gray-800);
}

/* ============================================
   Multi-Knob Slider (Budget Distribution)
   ============================================ */

.multi-knob-track {
  position: relative;
  display: flex;
  height: 0.625rem;
  border-radius: 9999px;
  overflow: visible;
  background: var(--color-gray-300);
  cursor: pointer;
}

.multi-knob-segment {
  height: 100%;
  min-width: 0;
  transition: width 0.05s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.multi-knob-segment:first-child {
  border-radius: 9999px 0 0 9999px;
}

.multi-knob-segment:last-child {
  border-radius: 0 9999px 9999px 0;
}

.multi-knob-segment:only-child {
  border-radius: 9999px;
}

.multi-knob-segment-label {
  display: none;
}

.multi-knob-handle {
  position: absolute;
  top: 50%;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--color-orange-1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, -50%);
  cursor: grab;
  z-index: 10;
  touch-action: none;
}

.multi-knob-handle:active {
  cursor: grabbing;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.multi-knob-handle:focus-visible {
  outline: 2px solid var(--color-orange-1);
  outline-offset: 2px;
}

/* ============================================
   Stacked Bar Chart
   ============================================ */

.stacked-bar {
  display: flex;
  border-radius: 0.5rem;
  overflow: hidden;
  width: 100%;
}

.stacked-bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  min-width: 0;
  transition: width 0.3s ease;
}

.stacked-bar-legend {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.stacked-bar-legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.625rem;
  color: var(--color-gray-1000);
}

.stacked-bar-legend-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 0.125rem;
  flex-shrink: 0;
}

.legend-money {
  color: var(--color-ink-lighter, #72777a);
  font-weight: 500;
}

/* ============================================
   Budget Breakdown Bar (Step 4 - Premiacao)
   ============================================ */

.budget-bar {
  display: flex;
  height: 1.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  background-color: var(--color-gray-100);
}

.budget-bar-segment {
  height: 100%;
  min-width: 0;
  transition: width 0.3s ease;
}

.budget-bar-seller {
  background-color: var(--color-orange-1);
}

.budget-bar-manager {
  background-color: var(--color-orange-5);
}

.budget-bar-supervisor {
  background-color: var(--color-orange-3);
}

.budget-detail-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border: 1px solid var(--color-gray-200);
  border-radius: 0.5rem;
  background-color: var(--color-white);
}

.budget-dot-seller {
  background-color: var(--color-orange-1);
}

.budget-dot-manager {
  background-color: var(--color-orange-5);
}

.budget-dot-supervisor {
  background-color: var(--color-orange-3);
}

.budget-total-amount {
  color: var(--color-gray-1000);
}

/* Pillar icon containers */
.budget-icon-seller {
  background-color: color-mix(in srgb, var(--color-orange-1) 10%, transparent);
}

.budget-icon-manager {
  background-color: color-mix(in srgb, var(--color-orange-5) 10%, transparent);
}

.budget-icon-supervisor {
  background-color: color-mix(in srgb, var(--color-orange-3) 10%, transparent);
}

/* Simulation scenario cards */
.scenario-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  flex: 1;
}

.scenario-card--pessimistic {
  background-color: color-mix(in srgb, var(--color-orange-6) 10%, transparent);
  border-color: color-mix(in srgb, var(--color-orange-6) 10%, transparent);
  color: var(--color-orange-6);
}

.scenario-card--expected {
  background-color: var(--color-gray-50);
  border-color: var(--color-gray-500);
  color: var(--color-gray-950);
}

.scenario-card--optimistic {
  background-color: color-mix(in srgb, var(--color-orange-5) 10%, transparent);
  border-color: color-mix(in srgb, var(--color-orange-5) 10%, transparent);
  color: var(--color-orange-5);
}

.scenario-card-title {
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.scenario-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scenario-card-row-label {
  font-size: 0.75rem;
  line-height: 1rem;
}

.scenario-card-row-value {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
}

.scenario-card-divider--pessimistic {
  border-top: 1px solid var(--color-orange-6);
  opacity: 0.2;
}

.scenario-card-divider--expected {
  border-top: 1px solid var(--color-gray-950);
  opacity: 0.2;
}

.scenario-card-divider--optimistic {
  border-top: 1px solid var(--color-orange-5);
  opacity: 0.2;
}

.scenario-card-summary {
  padding: 1rem;
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.scenario-card-summary--pessimistic {
  border: 1px solid color-mix(in srgb, var(--color-orange-6) 20%, transparent);
}

.scenario-card-summary--expected {
  border: 1px solid var(--color-gray-500);
}

.scenario-card-summary--optimistic {
  border: 1px solid color-mix(in srgb, var(--color-orange-5) 20%, transparent);
}

/* ============================================
   Wizard Modal (HTML <dialog>)
   ============================================ */

dialog.wizard-modal {
  max-width: 56rem;
  width: 95vw;
  max-height: 85vh;
  margin: auto;
  border: none;
  border-radius: 0.75rem;
  padding: 0;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

dialog.wizard-modal::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

dialog.wizard-modal[open] {
  display: flex;
  flex-direction: column;
}

.wizard-modal-panels {
  display: grid;
  grid-template-columns: 3fr 2fr;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.wizard-modal-panels > div {
  overflow-y: auto;
}

.wizard-modal-left {
  border-right: 1px solid var(--color-gray-200);
}

/* ============================================
   Goal Card
   ============================================ */

.goal-card {
  border: 1px solid var(--color-gray-200);
  border-radius: 0.5rem;
  background-color: var(--color-white);
  transition: box-shadow 0.15s ease;
}

.goal-card:hover {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.goal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.goal-card-badges {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.goal-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
}

.goal-card-badge--type {
  background: color-mix(in srgb, var(--color-orange-1) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-orange-1) 10%, transparent);
  color: var(--color-orange-1);
}

.goal-card-badge--weight {
  background: color-mix(in srgb, var(--color-orange-2) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-orange-2) 10%, transparent);
  color: var(--color-orange-2);
}

.goal-card-badge--stores {
  background: color-mix(in srgb, var(--color-orange-5) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-orange-5) 10%, transparent);
  color: var(--color-orange-5);
}

.goal-card-badge--products {
  background: color-mix(in srgb, var(--color-orange-3) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-orange-3) 10%, transparent);
  color: var(--color-orange-3);
}

.goal-card-position {
  display: inline-flex;
  align-items: center;
  background: var(--color-gray-50);
  border: 1px solid var(--color-gray-400);
  color: var(--color-gray-900);
  border-radius: 9999px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ============================================
   Goal Type Icons
   ============================================ */

.goal-type-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.goal-type-icon--all-or-nothing {
  background: color-mix(in srgb, var(--color-orange-6) 10%, transparent);
  color: var(--color-orange-6);
}

.goal-type-icon--proportional-capped {
  background: color-mix(in srgb, var(--color-orange-2) 10%, transparent);
  color: var(--color-orange-2);
}

.goal-type-icon--proportional-uncapped {
  background: color-mix(in srgb, var(--color-orange-4) 10%, transparent);
  color: var(--color-orange-4);
}

/* ============================================
   Tag Pills
   ============================================ */

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.15s ease;
  user-select: none;
}

.tag-pill--inactive {
  background-color: var(--color-gray-100);
  color: var(--color-ink-dark);
  border: 1px solid var(--color-gray-200);
}

.tag-pill--inactive:hover {
  background-color: var(--color-gray-200);
}

.tag-pill--active {
  background-color: var(--color-primary);
  color: white;
  border: 1px solid var(--color-primary);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .wizard-progress-bar {
    padding: 1rem;
    overflow-x: auto;
  }

  .wizard-progress-list {
    gap: 0;
    min-width: max-content;
  }

  .wizard-progress-connector {
    width: 2rem;
  }

  .wizard-progress-label {
    font-size: 0.75rem;
  }

  .wizard-step-content {
    padding: 1rem;
  }

  .wizard-footer {
    padding: 1rem;
  }

  dialog.wizard-modal {
    max-width: 100vw;
    width: 100vw;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }

  .wizard-modal-panels {
    grid-template-columns: 1fr;
  }

  .wizard-modal-left {
    border-right: none;
    border-bottom: 1px solid var(--color-gray-200);
  }
}
