/* ============================================
   GMGN Shot - Modern UI Design System
   Version: 2.0
   Features: Glassmorphism, Better UX, Smooth Animations
   ============================================ */

/* CSS Variables */
:root {
  /* Primary Colors */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-color: #667eea;
  --primary-light: #8b5cf6;
  --secondary-color: #764ba2;

  /* Status Colors */
  --success: #10b981;
  --success-light: #34d399;
  --warning: #f59e0b;
  --warning-light: #fbbf24;
  --error: #ef4444;
  --error-light: #f87171;
  --info: #3b82f6;
  --info-light: #60a5fa;

  /* Background Colors */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-card: rgba(17, 24, 39, 0.8);
  --bg-glass: rgba(17, 24, 39, 0.6);

  /* Text Colors */
  --text-primary: #f9fafb;
  --text-secondary: #e5e7eb;
  --text-muted: #9ca3af;
  --text-subtle: #6b7280;

  /* Border Colors */
  --border-primary: rgba(75, 85, 99, 0.4);
  --border-focus: #667eea;
  --border-glow: rgba(102, 126, 234, 0.3);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --shadow-glow: none;
  --shadow-success: none;
  --shadow-error: none;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Z-index */
  --z-sidebar: 100;
  --z-header: 200;
  --z-modal: 1000;
  --z-toast: 1100;

  /* Layout sizes */
  --header-height: 70px;
}

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   Performance Mode / Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 手动性能模式：关闭高开销 blur / 动画 / 发光阴影 */
html[data-perf-mode="1"] * {
  animation: none !important;
  transition: none !important;
}

html[data-perf-mode="1"] .app-background,
html[data-perf-mode="1"] .footer-bar,
html[data-perf-mode="1"] .header,
html[data-perf-mode="1"] .sidebar,
html[data-perf-mode="1"] .card,
html[data-perf-mode="1"] .modal-overlay,
html[data-perf-mode="1"] .modal-container {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
}

html[data-perf-mode="1"] .card,
html[data-perf-mode="1"] .btn,
html[data-perf-mode="1"] .nav-btn,
html[data-perf-mode="1"] .form-input,
html[data-perf-mode="1"] .form-select {
  box-shadow: none !important;
}

html[data-perf-mode="1"] .status-dot {
  box-shadow: none !important;
}

/* ============================================
   Footer Bar (Global Queue + Logs)
   ============================================ */

:root {
  --footer-bar-height: 220px;
}

.footer-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footer-bar-height);
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: 1px solid var(--border-primary);
  z-index: 150;
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
}

.footer-divider {
  width: 1px;
  background: var(--border-primary);
}

.footer-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* 允许子元素在 flex 容器内正确滚动 */
  min-height: 0;
}

.footer-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-primary);
}

.footer-pane-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.footer-pane-actions {
  display: flex;
  gap: 8px;
}

.footer-pane-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px;
  /* flex 子元素默认 min-height:auto 会导致滚动失效 */
  min-height: 0;
  overscroll-behavior: contain;
}

/* Footer scrollbar */
.footer-pane-body::-webkit-scrollbar {
  width: 10px;
}
.footer-pane-body::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.35);
  border-radius: 999px;
}
.footer-pane-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.0);
  background-clip: padding-box;
}
.footer-pane-body::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.55);
  background-clip: padding-box;
}

.footer-log {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.footer-log-item {
  padding: 4px 0;
  border-bottom: 1px dashed rgba(75, 85, 99, 0.35);
  white-space: pre-wrap;
  word-break: break-word;
}

.footer-log-item.info { color: #93c5fd; }
.footer-log-item.success { color: #34d399; }
.footer-log-item.error { color: #fca5a5; }
.footer-log-item.warning { color: #fbbf24; }

/* 让主内容区不被底栏遮挡 */
.main-content {
  /* 页面整体高度：header 到 footer-bar 之间；滚动仅在内容区内 */
  height: calc(100vh - var(--header-height) - var(--footer-bar-height));
  overflow-y: auto;
  padding-bottom: var(--space-xl);
}

@media (max-width: 768px) {
  :root { --footer-bar-height: 240px; }
  .footer-bar {
    grid-template-columns: 1fr;
    height: var(--footer-bar-height);
  }
  .footer-divider { display: none; }
}

/* Animated Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(118, 75, 162, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(102, 126, 234, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
  animation: none;
}

@keyframes backgroundPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ============================================
   Layout Structure
   ============================================ */

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  background: var(--bg-glass);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--border-primary);
  padding: var(--space-md) var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-height);
  box-sizing: border-box;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: none;
}

.logo h1 {
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

/* Status Indicator */
.status-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-primary);
  font-size: 0.85rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: none;
  animation: none;
}

.status-dot.disconnected {
  background: var(--error);
  box-shadow: none;
  animation: none;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

/* Quick Actions */
.quick-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.quick-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  border: 1px solid var(--border-primary);
}

.quick-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

/* ============================================
   Main Container
   ============================================ */

.container {
  display: flex;
  flex: 1;
  /* 页面整体高度：header 到 footer-bar 之间 */
  height: calc(100vh - var(--header-height) - var(--footer-bar-height));
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--bg-glass);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  padding: var(--space-lg) 0;
  /* 固定菜单：页面滚动仅发生在 main-content */
  position: fixed;
  top: var(--header-height);
  left: 0;
  height: calc(100vh - var(--header-height) - var(--footer-bar-height));
  overflow: hidden;
  z-index: var(--z-sidebar);
}

.sidebar-section {
  padding: 0 var(--space-md);
  margin-bottom: var(--space-md);
}

.sidebar-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-subtle);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-xs);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: 0 var(--space-md);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.nav-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.nav-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-btn.active {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-glow);
}

.nav-btn.active::before {
  opacity: 1;
}

/* 首屏路由高亮：在 JS 切换前就根据 hash 高亮左侧菜单 */
html[data-active-tab="wallets"] .nav-btn[data-tab="wallets"],
html[data-active-tab="distribute"] .nav-btn[data-tab="distribute"],
html[data-active-tab="trade"] .nav-btn[data-tab="trade"],
html[data-active-tab="launch"] .nav-btn[data-tab="launch"],
html[data-active-tab="collect"] .nav-btn[data-tab="collect"],
html[data-active-tab="tasks"] .nav-btn[data-tab="tasks"],
html[data-active-tab="groups"] .nav-btn[data-tab="groups"],
html[data-active-tab="account"] .nav-btn[data-tab="account"],
html[data-active-tab="settings"] .nav-btn[data-tab="settings"] {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-glow);
}

html[data-active-tab="wallets"] .nav-btn[data-tab="wallets"]::before,
html[data-active-tab="distribute"] .nav-btn[data-tab="distribute"]::before,
html[data-active-tab="trade"] .nav-btn[data-tab="trade"]::before,
html[data-active-tab="launch"] .nav-btn[data-tab="launch"]::before,
html[data-active-tab="collect"] .nav-btn[data-tab="collect"]::before,
html[data-active-tab="tasks"] .nav-btn[data-tab="tasks"]::before,
html[data-active-tab="groups"] .nav-btn[data-tab="groups"]::before,
html[data-active-tab="account"] .nav-btn[data-tab="account"]::before,
html[data-active-tab="settings"] .nav-btn[data-tab="settings"]::before {
  opacity: 1;
}

.nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.nav-badge {
  margin-left: auto;
  padding: 2px 8px;
  background: var(--error);
  color: white;
  font-size: 0.7rem;
  border-radius: 10px;
  font-weight: 600;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: var(--space-xl);
  position: relative;
}

/* 当 sidebar 固定时，为内容区预留宽度 */
.container .main-content {
  margin-left: 240px;
}

/* Page Header */
.page-header {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-primary);
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ============================================
   Tab Content
   ============================================ */

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Card Component
   ============================================ */

.card {
  background: var(--bg-card);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-primary);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Card Variants */
.card-compact {
  padding: var(--space-lg);
}

.card-highlight {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-glow);
}

.card-success {
  border-color: var(--success);
  box-shadow: var(--shadow-success);
}

.card-error {
  border-color: var(--error);
  box-shadow: var(--shadow-error);
}

/* ============================================
   Form Components
   ============================================ */

.form-section {
  margin-bottom: var(--space-xl);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.form-label-required::after {
  content: '*';
  color: var(--error);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--text-subtle);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--border-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-subtle);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-select[multiple] {
  background-image: none;
  min-height: 120px;
  padding-right: var(--space-md);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin-top: var(--space-xs);
}

.form-error {
  font-size: 0.8rem;
  color: var(--error);
  margin-top: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Input Groups */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-input {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  border-right: none;
}

.input-group .input-addon {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}

/* ============================================
   Button Components
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn:active {
  transform: translateY(1px);
}

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

/* Button Variants */
.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-glass);
  border-color: var(--text-subtle);
  color: var(--text-primary);
}

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: var(--shadow-success);
}

.btn-success:hover:not(:disabled) {
  background: var(--success-light);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--error);
  color: white;
  box-shadow: var(--shadow-error);
}

.btn-danger:hover:not(:disabled) {
  background: var(--error-light);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.8rem;
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* ============================================
   Badge & Tag Components
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-xl);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-default {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.badge-primary {
  background: var(--primary-color);
  color: white;
}

.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  border: 1px solid var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.badge-error {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
  border: 1px solid var(--error);
}

/* ============================================
   Alert Component
   ============================================ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  border-left: 3px solid;
}

.alert-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.alert-description {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.alert-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border-left-color: var(--info);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-left-color: var(--success);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-left-color: var(--warning);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-left-color: var(--error);
}

/* ============================================
   Stats & Info Grid
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  transition: all var(--transition-fast);
}

.stat-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* ============================================
   Tab Navigation (Internal)
   ============================================ */

.tab-nav {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  padding: var(--space-xs);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.tab-nav-btn {
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex: 1;
  text-align: center;
}

.tab-nav-btn:hover {
  color: var(--text-primary);
}

.tab-nav-btn.active {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-md);
}

/* ============================================
   Info Panel
   ============================================ */

.info-panel {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.info-panel-title {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-weight: 600;
  color: var(--info);
  margin-bottom: var(--space-xs);
}

/* ============================================
   Address Display
   ============================================ */

.address-display {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.address-text {
  flex: 1;
}

.address-copy {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.address-copy:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

/* ============================================
   Step List (Internal Transfer)
   ============================================ */

.step-list {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  max-height: 300px;
  overflow-y: auto;
}

.step-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-primary);
  transition: background var(--transition-fast);
}

.step-item:last-child {
  border-bottom: none;
}

.step-item:hover {
  background: var(--bg-glass);
}

.step-number {
  width: 28px;
  height: 28px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

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

.step-from,
.step-to {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.step-arrow {
  color: var(--text-subtle);
  padding: 0 var(--space-sm);
}

.step-amount {
  font-weight: 600;
  color: var(--success);
}

.step-remove {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.step-remove:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  text-align: center;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.empty-description {
  font-size: 0.9rem;
  max-width: 300px;
}

/* ============================================
   Log Box
   ============================================ */

.log-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  max-height: 400px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
}

.log-item {
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.log-item:last-child {
  border-bottom: none;
}

.log-time {
  color: var(--text-subtle);
  flex-shrink: 0;
  font-size: 0.75rem;
}

.log-level {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.log-level.success { background: var(--success); box-shadow: 0 0 6px var(--success); }
.log-level.error { background: var(--error); box-shadow: 0 0 6px var(--error); }
.log-level.warning { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.log-level.info { background: var(--info); box-shadow: 0 0 6px var(--info); }

.log-message {
  flex: 1;
  word-break: break-word;
}

/* ============================================
   Progress Modal
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-normal);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-container {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-xl);
  overflow-y: auto;
}

/* Progress Components */
.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.progress-title {
  font-weight: 600;
}

.progress-percentage {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.progress-bar-container {
  background: var(--bg-tertiary);
  border-radius: var(--radius-xl);
  height: 8px;
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.progress-bar {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-xl);
  transition: width 0.5s ease;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: none;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-stats {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.progress-stat {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.progress-stat-value {
  font-weight: 600;
  color: var(--text-secondary);
}

.progress-log {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  max-height: 250px;
  overflow-y: auto;
  font-size: 0.8rem;
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
  position: fixed;
  top: 80px;
  right: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-width: 300px;
  max-width: 400px;
  pointer-events: auto;
  transform: translateX(100%);
  opacity: 0;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-lg);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-icon {
  font-size: 1.2rem;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 1rem;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.toast-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--error); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--info); }

/* ============================================
   Wallet List
   ============================================ */

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
}

.wallet-item {
  background: var(--bg-glass);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: all var(--transition-fast);
}

.wallet-item:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.wallet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.wallet-index {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-color);
  background: rgba(102, 126, 234, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-xl);
}

.wallet-group {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.wallet-address {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.wallet-stats {
  display: flex;
  gap: var(--space-md);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.wallet-stat {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

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

@media (max-width: 1024px) {
  .sidebar {
    width: 60px;
    padding: var(--space-md) 0;
  }

  .sidebar-section,
  .sidebar-title {
    display: none;
  }

  .nav-btn {
    justify-content: center;
    padding: var(--space-sm);
  }

  .nav-btn span:not(.nav-icon) {
    display: none;
  }

  .nav-icon {
    margin: 0;
  }

  .container .main-content {
    margin-left: 60px;
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    height: auto;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    padding: var(--space-sm);
    border-right: none;
    border-bottom: 1px solid var(--border-primary);
    position: sticky;
    top: var(--header-height);
    left: auto;
    height: auto;
    overflow: auto;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0;
    justify-content: center;
  }

  .nav-btn {
    flex: 1;
    min-width: 80px;
    justify-content: center;
  }

  .main-content {
    padding: var(--space-md);
  }

  .container .main-content {
    margin-left: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .wallet-grid {
    grid-template-columns: 1fr;
  }

  .toast-container {
    left: var(--space-md);
    right: var(--space-md);
  }

  .toast {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .header {
    padding: var(--space-sm);
  }

  .logo h1 {
    font-size: 1.1rem;
  }

  .card {
    padding: var(--space-md);
  }

  .btn {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
  }
}

/* ============================================
   Utilities
   ============================================ */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-muted { color: var(--text-muted); }

.bg-success { background: rgba(16, 185, 129, 0.1); }
.bg-error { background: rgba(239, 68, 68, 0.1); }
.bg-warning { background: rgba(245, 158, 11, 0.1); }
.bg-info { background: rgba(59, 130, 246, 0.1); }

.hidden { display: none !important; }
.invisible { visibility: hidden; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* ============================================
   Animations
   ============================================ */

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s ease;
}

.animate-slide-in-right {
  animation: slideInRight 0.3s ease;
}
