/* ============================================================
 * Strategy Wizard – StockVision TradingAI Personalisation
 * Spec: StockVision AI Strategy Personalization Spec v1.0
 * ============================================================ */

/* ============================================================
 * Call-to-Action banner (sits above the analysis input)
 * ============================================================ */
.sw-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  margin: 0 auto 24px;
  max-width: 960px;
  border-radius: 8px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.1) 0%,
    rgba(139, 92, 246, 0.14) 100%
  );
  color: #e6ecff;
  box-shadow: none;
}
.sw-cta-active {
  border-color: rgba(34, 197, 94, 0.45);
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.1) 0%,
    rgba(6, 182, 212, 0.08) 100%
  );
}
.sw-cta-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.sw-cta-active .sw-cta-icon {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.4);
}
.sw-cta-text {
  flex: 1;
  min-width: 0;
}
.sw-cta-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff;
}
.sw-cta-sub {
  font-size: 13px;
  color: #b6c0e0;
  line-height: 1.5;
}
.sw-cta-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sw-cta-actions .sw-btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    filter 0.15s,
    background 0.15s;
}
.sw-cta-actions .sw-btn-primary {
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  color: #fff;
}
.sw-cta-actions .sw-btn-primary:hover {
  filter: brightness(1.12);
}
.sw-cta-actions .sw-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e6ecff;
}
.sw-cta-actions .sw-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
}
.sw-cta-link {
  background: none;
  border: none;
  color: #8893b8;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
}
.sw-cta-link:hover {
  color: #cdd5ee;
}

@media (max-width: 720px) {
  .sw-cta {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .sw-cta-actions {
    justify-content: center;
  }
}

.sw-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.sw-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.sw-modal {
  width: min(680px, 100%);
  max-height: 92vh;
  background: linear-gradient(180deg, #0f1422 0%, #0a0f1c 100%);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 8px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  color: #e6ecff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.3s ease;
}
.sw-overlay.visible .sw-modal {
  transform: translateY(0) scale(1);
}

.sw-header {
  padding: 18px 24px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sw-title {
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #a78bfa;
  font-weight: 700;
}
.sw-close {
  background: transparent;
  border: none;
  color: #8893b8;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.sw-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.sw-progress {
  display: flex;
  gap: 6px;
  padding: 0 24px 16px;
}
.sw-progress span {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.sw-progress span.active::after,
.sw-progress span.done::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #06b6d4, #8b5cf6);
}
.sw-progress span.done {
  opacity: 0.6;
}

.sw-body {
  padding: 8px 24px 24px;
  overflow-y: auto;
  flex: 1;
}
.sw-step h2 {
  font-size: 22px;
  margin: 0 0 6px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sw-step .sw-sub {
  font-size: 14px;
  color: #98a3c4;
  margin: 0 0 18px;
}

/* Chips */
.sw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sw-chip {
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #d8def0;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
  -webkit-user-select: none;
  user-select: none;
}
.sw-chip:hover {
  border-color: rgba(139, 92, 246, 0.5);
  color: #fff;
}
.sw-chip.selected {
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.2),
    rgba(139, 92, 246, 0.25)
  );
  border-color: rgba(139, 92, 246, 0.7);
  color: #fff;
}

/* Cards (single-select) */
.sw-cards {
  display: grid;
  gap: 10px;
}
.sw-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.sw-card:hover {
  border-color: rgba(139, 92, 246, 0.4);
}
.sw-card.selected {
  border-color: rgba(139, 92, 246, 0.8);
  background: rgba(139, 92, 246, 0.08);
}
.sw-card .sw-card-icon {
  font-size: 22px;
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}
.sw-card-title {
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 2px;
  color: #fff;
}
.sw-card-desc {
  font-size: 13px;
  color: #98a3c4;
  margin: 0;
  line-height: 1.45;
}

/* Inputs */
.sw-input,
.sw-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e6ecff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.15s;
}
.sw-input:focus,
.sw-textarea:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.7);
}
.sw-textarea {
  min-height: 110px;
}
.sw-counter {
  text-align: right;
  font-size: 12px;
  color: #6b7390;
  margin-top: 4px;
}

/* Notes / errors */
.sw-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: #93e2f5;
  font-size: 12px;
  line-height: 1.5;
}
.sw-note-warn {
  background: rgba(234, 179, 8, 0.1);
  border-color: rgba(234, 179, 8, 0.45);
  color: #fde68a;
}
.sw-error {
  margin-top: 10px;
  font-size: 13px;
  color: #ff8a8a;
}

/* Step 5 – AI profile */
.sw-ai-card {
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: linear-gradient(
    180deg,
    rgba(139, 92, 246, 0.08),
    rgba(6, 182, 212, 0.05)
  );
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.55;
  color: #e6ecff;
  white-space: pre-wrap;
  max-height: 320px;
  overflow-y: auto;
}
.sw-ai-card h3,
.sw-ai-card h4 {
  margin: 14px 0 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a78bfa;
}
.sw-ai-card ul {
  padding-left: 20px;
  margin: 4px 0 8px;
}
.sw-ai-edit-wrap {
  margin-top: 12px;
}
.sw-toggle-edit {
  background: none;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: #cdd5ee;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}
.sw-toggle-edit:hover {
  border-color: rgba(139, 92, 246, 0.6);
  color: #fff;
}

/* Loading */
.sw-skeleton {
  height: 220px;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 400% 100%;
  animation: swShimmer 1.4s ease-in-out infinite;
}
.sw-skeleton-label {
  text-align: center;
  font-size: 13px;
  color: #98a3c4;
  margin-top: 14px;
}
@keyframes swShimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Footer */
.sw-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sw-skip {
  background: none;
  border: none;
  color: #8893b8;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}
.sw-skip:hover {
  color: #cdd5ee;
}
.sw-actions {
  display: flex;
  gap: 8px;
}
.sw-btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    transform 0.1s,
    opacity 0.15s;
}
.sw-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.sw-btn:not(:disabled):active {
  transform: none;
}
.sw-btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e6ecff;
}
.sw-btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
}
.sw-btn-primary {
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
}
.sw-btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
}

/* ============================================================
 * Strategy Badge (Analysis view)
 * ============================================================ */
.me-advisory {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  margin: 0 0 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #e6ecff;
  font-size: 13px;
  line-height: 1.55;
}
.me-advisory-icon {
  font-size: 18px;
  line-height: 1.2;
  flex-shrink: 0;
}
.me-advisory-text {
  flex: 1;
  min-width: 0;
}
.me-advisory-info {
  border-color: rgba(6, 182, 212, 0.4);
  background: rgba(6, 182, 212, 0.1);
}
.me-advisory-warn {
  border-color: rgba(234, 179, 8, 0.5);
  background: rgba(234, 179, 8, 0.1);
  color: #fde68a;
}
.me-advisory-error {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.sw-strategy-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.14),
    rgba(139, 92, 246, 0.18)
  );
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #e6ecff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
  text-decoration: none;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 12px;
  text-align: center;
}
.sw-strategy-badge:hover {
  filter: brightness(1.15);
}
.sw-strategy-badge .sw-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #06b6d4;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.7);
}

/* ============================================================
 * Strategy Match section (rendered inside AI analysis box)
 * ============================================================ */
.sw-match-card {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}
.sw-match-card.match-yes {
  border-color: rgba(34, 197, 94, 0.55);
  background: linear-gradient(
    180deg,
    rgba(34, 197, 94, 0.1),
    rgba(34, 197, 94, 0.02)
  );
}
.sw-match-card.match-no {
  border-color: rgba(239, 68, 68, 0.5);
  background: linear-gradient(
    180deg,
    rgba(239, 68, 68, 0.1),
    rgba(239, 68, 68, 0.02)
  );
}
.sw-match-card.match-partial {
  border-color: rgba(234, 179, 8, 0.55);
  background: linear-gradient(
    180deg,
    rgba(234, 179, 8, 0.1),
    rgba(234, 179, 8, 0.02)
  );
}
.sw-match-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.sw-match-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.match-yes .sw-match-badge {
  background: rgba(34, 197, 94, 0.25);
  color: #86efac;
}
.match-no .sw-match-badge {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}
.match-partial .sw-match-badge {
  background: rgba(234, 179, 8, 0.25);
  color: #fde68a;
}
.sw-match-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}
.sw-match-body {
  font-size: 14px;
  color: #d8def0;
  line-height: 1.55;
}
.sw-match-body ul {
  padding-left: 18px;
  margin: 6px 0;
}

/* Mobile */
@media (max-width: 540px) {
  .sw-modal {
    border-radius: 8px;
  }
  .sw-header,
  .sw-body,
  .sw-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .sw-step h2 {
    font-size: 19px;
  }
  .sw-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .sw-actions {
    justify-content: space-between;
  }
}
