/* Sniffer AI - Telegram Mini App Styles */

:root {
  --tg-theme-bg-color: #000000;
  --tg-theme-text-color: #ffffff;
  --tg-theme-hint-color: #8b8b9e;
  --tg-theme-secondary-bg-color: #1c1c1e;

  --accent: #D7F026;
  /* Neon Lime from screenshot */
  --accent-text: #000;
  --success: #00d9a5;
  --danger: #ff4757;
  --card-bg: #111111;
  --border-color: #333;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--tg-theme-bg-color);
  color: var(--tg-theme-text-color);
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.app {
  padding-bottom: 20px;
}

/* Header */
.header {
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.8);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeframe-select {
  background: rgba(215, 240, 38, 0.05);
  color: var(--accent);
  border: 1px solid rgba(215, 240, 38, 0.5);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.search-icon {
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

/* Search Section */
.search-section {
  padding: 0 16px 16px 16px;
}

.search-box {
  display: flex;
  gap: 10px;
  background: var(--tg-theme-secondary-bg-color);
  border-radius: 12px;
  padding: 8px;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  padding: 8px;
  outline: none;
}

/* Token List */
.token-list {
  padding: 0 16px;
}

.list-item {
  display: flex;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}

.list-item:active {
  opacity: 0.7;
}

.token-thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 12px;
  background: #222;
  /* 稍微亮一点的背景 */
  object-fit: cover;
  border: 1px solid #333;
}

.item-info {
  flex: 1;
}

.item-symbol {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tag-new {
  font-size: 10px;
  background: #333;
  padding: 2px 4px;
  border-radius: 4px;
  color: #aaa;
}

.item-row-metadata {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.item-metadata-liq {
  font-size: 11px;
  color: var(--tg-theme-hint-color);
  font-weight: 500;
}

.tag-platform {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.platform-pump {
  background: rgba(0, 255, 163, 0.15);
  color: #00ffa3;
  border: 1px solid rgba(0, 255, 163, 0.3);
}

.platform-dex {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.tag-boost {
  font-size: 12px;
  margin-left: 4px;
  filter: drop-shadow(0 0 5px currentColor);
}

.top-boost {
  color: #FFD700;
  /* Gold */
}

.latest-boost {
  color: #C0C0C0;
  /* Silver */
}

.item-price-block {
  text-align: right;
}

.list-price {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  transition: background 0.5s;
}

.list-change {
  font-size: 13px;
  margin-top: 2px;
}

/* 实时 K 线图容器 */
.chart-container {
  width: 100%;
  height: 600px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}

#tradingCell {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.hidden {
  display: none !important;
}

/* Detail View */
.detail-view {
  padding: 16px;
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(20px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.btn-back {
  background: none;
  border: none;
  color: var(--tg-theme-hint-color);
  font-size: 14px;
  padding: 0 0 16px 0;
  cursor: pointer;
}

.token-header-compact {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.token-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 12px;
}

.header-text {
  flex: 1;
}

.header-text h2 {
  font-size: 20px;
  margin: 0;
}

.main-price {
  font-size: 20px;
  font-weight: 700;
  text-align: right;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.metric-item {
  background: var(--tg-theme-secondary-bg-color);
  padding: 12px;
  border-radius: 8px;
}

.metric-label {
  font-size: 12px;
  color: var(--tg-theme-hint-color);
  display: block;
  margin-bottom: 4px;
}

.metric-value {
  font-size: 15px;
  font-weight: 600;
}

/* Actions */
.actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 20px;
}

.main-actions {
  flex-direction: column;
}

.highlight-btn {
  background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
  box-shadow: 0 4px 15px rgba(0, 243, 255, 0.4);
  animation: glow 2s infinite alternate;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes glow {
  from {
    box-shadow: 0 4px 15px rgba(0, 243, 255, 0.3);
  }

  to {
    box-shadow: 0 4px 25px rgba(168, 85, 247, 0.5);
  }
}

.btn-buy {
  background: #22c55e;
  color: #fff;
  text-align: center;
  padding: 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
  transition: transform 0.1s;
}

.btn-buy:active {
  transform: scale(0.98);
}

.secondary-actions {
  margin-top: -10px;
}

.btn-primary {
  flex: 1;
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  border: none;
}

.btn-secondary {
  flex: 1;
  background: #333;
  color: #fff;
  text-align: center;
  padding: 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

/* Colors */
.positive {
  color: var(--success);
}

.negative {
  color: var(--danger);
}

/* Error */
.error-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

.audit-result {
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeIn 0.3s ease;
}

.audit-result h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 16px;
}

.audit-text {
  font-size: 14px;
  line-height: 1.6;
  color: #fff;
}

.audit-text b,
.audit-text strong {
  color: var(--accent);
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.risk-tag {
  background: #333;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-right: 6px;
  margin-bottom: 6px;
  display: inline-block;
}

/* Live Flash Animations */
@keyframes flashUp {
  0% {
    background: rgba(34, 197, 94, 0.4);
  }

  100% {
    background: transparent;
  }
}

@keyframes flashDown {
  0% {
    background: rgba(239, 68, 68, 0.4);
  }

  100% {
    background: transparent;
  }
}

.flash-up {
  animation: flashUp 1.5s ease-out;
  border-radius: 4px;
}

.flash-down {
  animation: flashDown 1.5s ease-out;
  border-radius: 4px;
}