/**
 * OpenKitx403 Trading Bot Dashboard
 * Matching NFT Gallery UI/UX theme
 */

/* ====== Design Tokens ====== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0A0A0A;
  --bg-secondary: #141414;
  --bg-tertiary: #1A1A1A;
  --accent-primary: #9945FF;
  --accent-secondary: #14F195;
  --text-primary: #FFFFFF;
  --text-secondary: #A3A3A3;
  --text-muted: #737373;
  --border: #262626;
  --success: #14F195;
  --error: #EF4444;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Consolas', monospace;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
}

/* ====== App Layout ====== */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.demo-badge {
  background: var(--accent-primary);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all var(--transition);
}

.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* ====== Main Content ====== */
.main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 80px 24px;
}

/* ====== Hero Section ====== */
.hero {
  text-align: center;
  margin-bottom: 64px;
}

.hero-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.hero-description {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px;
  max-width: 600px;
  margin: 0 auto;
}

.quick-stat {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: all var(--transition);
}

.quick-stat:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quick-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-secondary);
  font-family: var(--font-mono);
  margin-bottom: 8px;
}

.quick-stat-label {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* ====== Content Grid ====== */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

/* ====== Card ====== */
.card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.card--setup {
  grid-column: 1 / -1;
}

.card-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  color: var(--text-primary);
}

/* ====== Price List ====== */
.price-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.price-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.price-item:hover {
  border-color: var(--accent-secondary);
  background: rgba(20, 241, 149, 0.05);
}

.price-asset {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-primary);
}

.price-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-secondary);
  font-family: var(--font-mono);
}

/* ====== Activity Feed ====== */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.activity-feed::-webkit-scrollbar {
  width: 6px;
}

.activity-feed::-webkit-scrollbar-track {
  background: transparent;
}

.activity-feed::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.activity-feed::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.empty-state {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 16px;
  margin-bottom: 8px;
}

.empty-state-sub {
  font-size: 14px;
  color: var(--text-muted);
}

.activity-row {
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.activity-row:hover {
  border-color: var(--accent-primary);
  background: rgba(153, 69, 255, 0.05);
}

.activity-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.activity-badge {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  border: 1px solid;
}

.activity-badge--buy {
  background: rgba(20, 241, 149, 0.15);
  color: var(--success);
  border-color: rgba(20, 241, 149, 0.3);
}

.activity-badge--sell {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.3);
}

.activity-bot {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.activity-detail {
  font-size: 14px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

.activity-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-primary);
  font-family: var(--font-mono);
  margin-top: 8px;
}

/* ====== Setup Steps ====== */
.setup-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.setup-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-number {
  width: 40px;
  height: 40px;
  background: var(--accent-primary);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.step-info {
  flex: 1;
}

.step-info h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.step-code {
  display: block;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-secondary);
  overflow-x: auto;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  line-height: 1.5;
}

.step-code:hover {
  border-color: var(--accent-secondary);
  background: rgba(20, 241, 149, 0.05);
}

.step-code:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ====== Features ====== */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  padding: 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 40px 0;
}

.feature {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feature-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  font-weight: bold;
  flex-shrink: 0;
}

.feature-text {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ====== Footer ====== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  margin-top: auto;
}

.footer-text {
  color: var(--text-muted);
  font-size: 14px;
  font-family: var(--font-mono);
}

.footer-text a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition);
}

.footer-text a:hover {
  color: var(--accent-secondary);
}

/* ====== Scrollbar ====== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ====== Responsive ====== */
@media (max-width: 768px) {
  .main {
    padding: 48px 16px;
  }

  .hero {
    margin-bottom: 48px;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-description {
    font-size: 14px;
  }

  .quick-stats {
    grid-template-columns: 1fr;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .setup-steps {
    grid-template-columns: 1fr;
  }

  .features {
    grid-template-columns: 1fr;
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 0 16px;
  }

  .header-content {
    flex-direction: column;
    height: auto;
    padding: 16px 0;
    gap: 12px;
    align-items: flex-start;
  }

  .logo-text {
    font-size: 18px;
  }

  .hero-title {
    font-size: 28px;
  }

  .quick-stat-value {
    font-size: 24px;
  }

  .activity-feed {
    max-height: 300px;
  }

  .card-title {
    font-size: 20px;
  }
}

