/* ============================================
   VTU PLATFORM — COMPONENTS
   All reusable UI components
   ============================================ */


/* ─── BUTTONS ───────────────────────────────
   Variants: primary, secondary, ghost, danger
   Sizes: sm, md (default), lg
   ─────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-weight: var(--font-semi);
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    opacity var(--transition-fast),
    transform var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Primary — white on dark */
.btn--primary {
  background: var(--text-primary);
  color: var(--text-inverse);
  border-color: var(--text-primary);
}
.btn--primary:hover:not(:disabled) {
  background: #FFFFFF;
  border-color: #FFFFFF;
}

/* Secondary — outlined */
.btn--secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-soft);
}
.btn--secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-active);
}

/* Ghost — no border */
.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn--ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Danger */
.btn--danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn--danger:hover:not(:disabled) {
  background: #EF4444;
}

/* Success */
.btn--success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

/* Sizes */
.btn--sm {
  padding: 8px 14px;
  font-size: var(--text-sm);
  border-radius: var(--radius-xs);
}
.btn--lg {
  padding: 16px 28px;
  font-size: var(--text-md);
  border-radius: var(--radius-md);
}
.btn--full {
  width: 100%;
}

/* Loading state */
.btn--loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn--loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  color: var(--text-inverse);
}


/* ─── CARDS ─────────────────────────────────
   ─────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--card-padding);
}

.card--elevated {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
}

.card--clickable {
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}
.card--clickable:hover {
  background: var(--bg-hover);
  border-color: var(--border-active);
}
.card--clickable:active {
  transform: scale(0.99);
}

.card--selected {
  border-color: var(--border-active);
  background: var(--bg-hover);
}

/* Wallet card — the signature element */
.card--wallet {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 28px var(--card-padding);
  box-shadow: var(--wallet-glow);
  position: relative;
  overflow: hidden;
}

.card--wallet::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/assets/images/noise.png');
  background-repeat: repeat;
  opacity: 0.04;
  pointer-events: none;
}


/* ─── INPUTS ────────────────────────────────
   ─────────────────────────────────────────── */

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.input-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.input-field {
  padding: 13px var(--space-md);
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast);
}

.input-field:focus {
  border-color: var(--border-active);
}

.input-field--error {
  border-color: var(--danger);
}

.input-field--success {
  border-color: var(--success);
}

.input-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.input-error {
  font-size: var(--text-xs);
  color: var(--danger);
}

/* Input with icon */
.input-wrapper {
  position: relative;
}

.input-wrapper .input-field {
  padding-left: 44px;
}

.input-wrapper .input-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

/* Input with right action (e.g. show/hide password) */
.input-wrapper .input-action {
  position: absolute;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
}

.input-wrapper .input-field--with-action {
  padding-right: 44px;
}

/* Amount input — large, mono */
.input-amount {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: var(--font-semi);
  text-align: center;
  letter-spacing: -0.5px;
  padding: var(--space-md);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border-soft);
  border-radius: 0;
  color: var(--text-primary);
}
.input-amount:focus {
  border-bottom-color: var(--border-active);
}
.input-amount::placeholder {
  color: var(--text-muted);
  font-weight: var(--font-normal);
}


/* ─── BADGES ────────────────────────────────
   ─────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semi);
  letter-spacing: 0.3px;
  line-height: 1;
}

.badge--success {
  background: var(--success-soft);
  color: #4ADE80;
}
.badge--danger {
  background: var(--danger-soft);
  color: #FCA5A5;
}
.badge--pending {
  background: var(--pending-soft);
  color: #FCD34D;
}
.badge--info {
  background: var(--info-soft);
  color: #93C5FD;
}
.badge--neutral {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-soft);
}
.badge--premium {
  background: linear-gradient(135deg, #78350F, #D97706);
  color: #FEF3C7;
}


/* ─── TRANSACTION ITEM ──────────────────────
   ─────────────────────────────────────────── */

.tx-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.tx-item:last-child {
  border-bottom: none;
}
.tx-item:hover {
  background: var(--bg-hover);
  margin: 0 calc(-1 * var(--card-padding));
  padding: var(--space-md) var(--card-padding);
}

.tx-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.tx-details {
  flex: 1;
  min-width: 0;
}
.tx-title {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 2px;
}

.tx-amount {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: var(--font-semi);
  flex-shrink: 0;
}
.tx-amount--credit { color: var(--profit); }
.tx-amount--debit  { color: var(--text-primary); }


/* ─── QUICK ACTION BUTTONS ──────────────────
   ─────────────────────────────────────────── */

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-sm) var(--space-xs);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}
.quick-action:hover {
  background: var(--bg-hover);
  border-color: var(--border-active);
}
.quick-action:active {
  transform: scale(0.95);
}

.quick-action__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.quick-action__label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: var(--font-medium);
  text-align: center;
}


/* ─── PLAN SELECTOR ─────────────────────────
   ─────────────────────────────────────────── */

.plan-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.plan-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    background-color var(--transition-fast);
}
.plan-item:hover {
  border-color: var(--border-active);
  background: var(--bg-hover);
}
.plan-item--selected {
  border-color: var(--text-secondary);
  background: var(--bg-elevated);
}
.plan-item--popular {
  border-color: var(--border-active);
}

.plan-item__info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.plan-item__size {
  font-weight: var(--font-semi);
  color: var(--text-primary);
}
.plan-item__validity {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.plan-item__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.plan-item__price {
  font-family: var(--font-mono);
  font-weight: var(--font-semi);
  color: var(--text-primary);
}
.plan-item__save {
  font-size: var(--text-xs);
  color: var(--profit);
}


/* ─── DIVIDER ───────────────────────────────
   ─────────────────────────────────────────── */

.divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-lg) 0;
}

.divider--label {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin: var(--space-lg) 0;
}
.divider--label::before,
.divider--label::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border-subtle);
}


/* ─── SECTION HEADER ────────────────────────
   ─────────────────────────────────────────── */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}
.section-title {
  font-size: var(--text-base);
  font-weight: var(--font-semi);
  color: var(--text-primary);
}
.section-action {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
}
.section-action:hover {
  color: var(--text-primary);
}


/* ─── NETWORK CHIP ──────────────────────────
   ─────────────────────────────────────────── */

.network-chips {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.network-chips::-webkit-scrollbar { display: none; }

.network-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  white-space: nowrap;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  transition:
    border-color var(--transition-fast),
    color var(--transition-fast);
  flex-shrink: 0;
}
.network-chip--active {
  border-color: var(--border-active);
  color: var(--text-primary);
  background: var(--bg-elevated);
}


/* ─── AVATAR ────────────────────────────────
   ─────────────────────────────────────────── */

.avatar {
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-semi);
  color: var(--text-secondary);
  text-transform: uppercase;
}
.avatar--sm  { width: 32px;  height: 32px;  font-size: var(--text-sm); }
.avatar--md  { width: 44px;  height: 44px;  font-size: var(--text-md); }
.avatar--lg  { width: 64px;  height: 64px;  font-size: var(--text-xl); }
.avatar--xl  { width: 88px;  height: 88px;  font-size: var(--text-2xl); }
.avatar img  { width: 100%; height: 100%; object-fit: cover; }


/* ─── STAT CARD ─────────────────────────────
   ─────────────────────────────────────────── */

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}
.stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: 6px;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: var(--font-semi);
  color: var(--text-primary);
}
.stat-change {
  font-size: var(--text-xs);
  margin-top: 4px;
}
.stat-change--up   { color: var(--profit); }
.stat-change--down { color: var(--loss); }


/* ─── EMPTY STATE ───────────────────────────
   ─────────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  gap: var(--space-md);
}
.empty-state__icon {
  font-size: 48px;
  opacity: 0.4;
}
.empty-state__title {
  font-size: var(--text-md);
  font-weight: var(--font-semi);
  color: var(--text-primary);
}
.empty-state__text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 240px;
}
.empty-state--sm {
  padding: var(--space-md) var(--space-sm);
}


/* ─── ALERT / INFO BOX ──────────────────────
   ─────────────────────────────────────────── */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}
.alert--success {
  background: var(--success-soft);
  color: #4ADE80;
  border: 1px solid rgba(22, 163, 74, 0.3);
}
.alert--danger {
  background: var(--danger-soft);
  color: #FCA5A5;
  border: 1px solid rgba(220, 38, 38, 0.3);
}
.alert--pending {
  background: var(--pending-soft);
  color: #FCD34D;
  border: 1px solid rgba(217, 119, 6, 0.3);
}
.alert--info {
  background: var(--info-soft);
  color: #93C5FD;
  border: 1px solid rgba(37, 99, 235, 0.3);
}


/* ─── AI TIP CARD ───────────────────────────
   ─────────────────────────────────────────── */

.ai-tip {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.ai-tip:hover {
  border-color: var(--border-soft);
}
.ai-tip__icon {
  font-size: 18px;
  flex-shrink: 0;
}
.ai-tip__text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  flex: 1;
}
.ai-tip__action {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: var(--font-medium);
  white-space: nowrap;
}


/* ─── STEP INDICATOR ────────────────────────
   (onboarding, multi-step forms)
   ─────────────────────────────────────────── */

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}
.step-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--border-soft);
  transition: all var(--transition-normal);
}
.step-dot--active {
  width: 24px;
  background: var(--text-primary);
}
.step-dot--done {
  background: var(--success);
}


/* ─── TOGGLE / SWITCH ───────────────────────
   ─────────────────────────────────────────── */

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: var(--radius-full);
  transition: transform var(--transition-normal), background var(--transition-fast);
}
.toggle input:checked + .toggle-track {
  background: var(--success);
  border-color: var(--success);
}
.toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
  background: #fff;
}


/* ─── PROGRESS BAR ──────────────────────────
   ─────────────────────────────────────────── */

.progress-bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}
.progress-fill--success { background: var(--success); }
.progress-fill--pending { background: var(--pending); }


/* ─── BOTTOM SHEET ──────────────────────────
   (mobile drawers / confirmation sheets)
   ─────────────────────────────────────────── */

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}
.sheet-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: var(--max-content-width);
  margin: 0 auto;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-soft);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-md) var(--space-md) var(--space-xl);
  z-index: var(--z-modal);
  transform: translateY(100%);
  transition: transform var(--transition-spring);
}
.sheet.is-open {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border-soft);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-lg);
}

.sheet-title {
  font-size: var(--text-md);
  font-weight: var(--font-semi);
  text-align: center;
  margin-bottom: var(--space-lg);
}


/* ─── LIST ITEM ─────────────────────────────
   (settings, profile menu items)
   ─────────────────────────────────────────── */

.list-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover {
  background: var(--bg-hover);
  margin: 0 calc(-1 * var(--card-padding));
  padding: var(--space-md) var(--card-padding);
}
.list-item__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.list-item__content { flex: 1; }
.list-item__title {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}
.list-item__subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.list-item__right {
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

/* Card loading state */
.card--loading {
  opacity: 0.4;
  pointer-events: none;
}
