/* ============================================
   HOW-IT-WORKS.CSS
   How It Works page: Trading & Staking sections,
   tabs, collapsible steps, animations, responsive.
   ============================================ */

.howit-main .page-main {
  max-width: 800px;
}

.howit-content {
  padding: 2rem 1.5rem;
}

.howit-subtitle {
  margin-bottom: 1.5rem;
}

/* ----- Tabs ----- */
.howit-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
}

.howit-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius);
  transition: color 0.25s, background 0.25s, box-shadow 0.25s;
}

.howit-tab:hover {
  color: var(--accent-pink);
  background: rgba(220, 20, 60, 0.1);
}

.howit-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-crimson), var(--accent-pink));
  box-shadow: 0 4px 16px rgba(220, 20, 60, 0.3);
}

.howit-tab-icon {
  display: inline-flex;
  opacity: 0.9;
}

.howit-tab.active .howit-tab-icon {
  filter: brightness(1.2);
}

/* ----- Panels ----- */
.howit-panel {
  display: none;
  animation: howit-panel-in 0.35s ease-out;
}

.howit-panel.active {
  display: block;
}

@keyframes howit-panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.howit-panel-header {
  margin-bottom: 1.75rem;
}

.howit-panel-title {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--text-primary), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.howit-panel-intro {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

/* ----- Collapsible steps ----- */
.howit-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.howit-step {
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.25s ease;
}

.howit-step:hover {
  box-shadow: 0 8px 28px rgba(220, 20, 60, 0.15);
}

.howit-step-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.25rem;
  border: none;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.25s;
  font-family: inherit;
}

.howit-step-head:hover {
  background: rgba(220, 20, 60, 0.08);
}

.howit-step-head[aria-expanded="true"] {
  background: rgba(220, 20, 60, 0.12);
  border-bottom: 1px solid var(--glass-border);
}

.howit-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-crimson), var(--accent-pink));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(220, 20, 60, 0.4);
}

.howit-step-title {
  flex: 1;
  line-height: 1.4;
}

.howit-step-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.25s ease, border-color 0.25s;
  margin-left: auto;
}

.howit-step-head[aria-expanded="true"] .howit-step-chevron {
  transform: rotate(-135deg);
  border-color: var(--accent-pink);
}

.howit-step-body {
  padding: 1rem 1.25rem 1rem 3.5rem;
  background: rgba(0, 0, 0, 0.15);
}

.howit-step-body p {
  margin: 0 0 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}

.howit-step-body p:last-child {
  margin-bottom: 0;
}

/* ----- Trading: exchanges visual ----- */
.howit-visual {
  margin-top: 1rem;
}

.howit-exchanges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  position: relative;
}

.howit-exchange-dot {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(220, 20, 60, 0.15);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  animation: howit-float 3s ease-in-out infinite;
}

.howit-exchange-dot:nth-child(2) { animation-delay: 0.3s; }
.howit-exchange-dot:nth-child(3) { animation-delay: 0.6s; }

.howit-bot-center {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-pink);
  background: rgba(220, 20, 60, 0.2);
  border: 1px solid var(--accent-crimson);
  border-radius: var(--radius);
  box-shadow: 0 0 20px rgba(220, 20, 60, 0.2);
}

@keyframes howit-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ----- Trading: metrics ----- */
.howit-metrics {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.howit-metric {
  padding: 0.6rem 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-pink);
  background: rgba(220, 20, 60, 0.15);
  border-radius: var(--radius);
  border: 1px solid rgba(233, 30, 99, 0.3);
}

.howit-metric small {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

/* ----- Staking: contract plans ----- */
.howit-contract-plans {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.howit-plan {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  transition: border-color 0.25s, color 0.25s;
}

.howit-plan:hover {
  border-color: var(--accent-crimson);
  color: var(--accent-pink);
}

/* ----- Staking: progress bar demo ----- */
.howit-progress-demo {
  margin-top: 0.75rem;
}

.howit-progress-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.howit-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-crimson), var(--accent-pink));
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.howit-progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ----- Glow on expand (optional) ----- */
.howit-step[data-step].howit-step-expanded .howit-step-head {
  box-shadow: 0 0 20px rgba(220, 20, 60, 0.1);
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
  .howit-tabs {
    flex-direction: column;
  }

  .howit-tab {
    justify-content: center;
  }

  .howit-step-body {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .howit-step-title {
    font-size: 0.9rem;
  }

  .howit-contract-plans {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .howit-content {
    padding: 1.25rem 1rem;
  }

  .howit-step-head {
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }

  .howit-metrics {
    flex-direction: column;
  }
}
