/* ==========================================================================
   TradingPro - Network Status & Bot Health Monitoring System
   Visual Identity: Flat Solid Minimalist Dark Theme (#82C400 & #141414)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* Official Flat TradingPro Dark Palette */
  --bg-dark: #141414;
  --bg-surface: #1a1a1a;
  --bg-card: #202020;
  --bg-card-hover: #262626;
  --bg-card-subtle: #181818;
  
  --border-color: #2d2d2d;
  --border-light: #383838;
  --border-active: #444444;

  /* Official Flat TradingPro Green (#82C400) */
  --brand-green: #82C400;
  --brand-green-hover: #92d800;
  --brand-green-dark: #6CA500;

  /* Status Colors */
  --status-online: #82C400;
  --status-degraded: #f59e0b;
  --status-down: #ef4444;

  /* Typography Colors */
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #6e6e6e;

  /* Fonts */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Flat UI - Zero Shadows */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --shadow-card: none;
  --shadow-glow: none;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  width: 100vw;
  overflow-x: hidden;
  background-image: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  height: 6px;
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-green);
}

/* App Container (Full Width Responsive) */
.app-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

@media (max-width: 768px) {
  .app-container {
    padding: 0 1.25rem 3rem;
  }
}

@media (max-width: 480px) {
  .app-container {
    padding: 0 0.85rem 2.5rem;
  }
}

/* ==========================================================================
   Header Navbar (Flat Minimalist)
   ========================================================================== */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  cursor: pointer;
}

.logo-icon-box {
  width: 42px;
  height: 42px;
  background: var(--brand-green);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-icon-box svg {
  width: 26px;
  height: 26px;
  fill: #141414;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.logo-text span {
  color: var(--brand-green);
}

.header-right-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.55rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--brand-green);
  flex-shrink: 0;
}

/* Flat Platform Button */
.btn-platform-action {
  background: var(--brand-green);
  color: #141414;
  padding: 0.6rem 1.35rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-platform-action:hover {
  background: var(--brand-green-hover);
}

@media (max-width: 640px) {
  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
  }
  .header-right-actions {
    width: 100%;
    justify-content: space-between;
  }
  .btn-platform-action {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .header-right-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .header-status-pill {
    justify-content: center;
  }
}

/* ==========================================================================
   Hero Status Banner (Flat Solid Card, No Gradients)
   ========================================================================== */
.hero-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2.25rem 2.5rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  display: none;
}

.beta-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #282828;
  color: var(--brand-green);
  border: 1px solid #333333;
  padding: 0.35rem 0.95rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.hero-content-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}

.hero-left-col {
  max-width: 750px;
  flex: 1;
}

.hero-headline {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1.18;
  margin-bottom: 0.85rem;
  letter-spacing: -0.8px;
}

.hero-headline span {
  color: var(--brand-green);
}

.hero-description {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.hero-cta-buttons {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-hero-primary {
  background: var(--brand-green);
  color: #141414;
  padding: 0.85rem 2.2rem;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition-fast);
}

.btn-hero-primary:hover {
  background: var(--brand-green-hover);
}

.btn-hero-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  padding: 0.85rem 1.8rem;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition-fast);
}

.btn-hero-secondary:hover {
  border-color: var(--brand-green);
  color: var(--brand-green);
  background: #242424;
}

.btn-hero-secondary:hover {
  border-color: var(--brand-green);
  color: var(--brand-green);
  background: var(--brand-green-subtle);
}

.hero-right-col {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 1rem 1.4rem;
  border-radius: 12px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand-green);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

@media (max-width: 900px) {
  .hero-banner {
    padding: 1.75rem 1.5rem;
  }
  .hero-headline {
    font-size: 1.95rem;
  }
  .hero-description {
    font-size: 0.98rem;
  }
  .hero-right-col {
    width: 100%;
    justify-content: flex-start;
  }
  .stat-box {
    align-items: flex-start;
  }
}

@media (max-width: 550px) {
  .hero-headline {
    font-size: 1.6rem;
  }
  .hero-cta-buttons {
    width: 100%;
    flex-direction: column;
  }
  .btn-hero-primary, .btn-hero-secondary {
    width: 100%;
    justify-content: center;
  }
}

/* 90-Day Uptime Visual Bar */
.uptime-bar-section {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.uptime-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  font-weight: 500;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.uptime-bar-ticks {
  display: flex;
  gap: 3px;
  height: 32px;
  width: 100%;
  overflow: hidden;
}

.uptime-tick {
  flex: 1;
  background-color: var(--brand-green);
  border-radius: 3px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
  cursor: pointer;
  min-width: 2px;
}

.uptime-tick:hover {
  transform: scaleY(1.2);
  opacity: 0.85;
}

/* ==========================================================================
   Metrics Overview Grid (4 Cards Responsive)
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 1100px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 550px) {
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-card);
}

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

.metric-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.metric-label {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.metric-icon {
  color: var(--brand-green);
  font-size: 1.25rem;
}

.metric-main-val {
  font-size: 1.85rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  line-height: 1.2;
}

.metric-unit {
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-green);
}

.metric-footer {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Latency Live Card */
.latency-card {
  border-color: var(--border-color);
  background: var(--bg-card);
}

.latency-sparkline {
  width: 100%;
  height: 26px;
  margin-top: 0.4rem;
}

/* ==========================================================================
   Filter, Search & Controls Section (Responsive Touch Scroll)
   ========================================================================== */
.controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.category-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
  flex-shrink: 0;
  box-shadow: none;
}

.tab-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.tab-btn.active {
  background: var(--brand-green);
  color: #141414;
  border-color: var(--brand-green);
  font-weight: 700;
  box-shadow: none;
}

.tab-count {
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.15);
  font-family: var(--font-mono);
}

.tab-btn.active .tab-count {
  background: #141414;
  color: #ffffff;
}

.search-box-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: auto;
}

@media (max-width: 768px) {
  .search-box-group {
    width: 100%;
  }
}

.search-input-wrapper {
  position: relative;
  width: 300px;
}

@media (max-width: 768px) {
  .search-input-wrapper {
    width: 100%;
  }
}

.search-input-wrapper i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1rem 0.6rem 2.6rem;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-fast);
}

.search-input:focus {
  border-color: var(--brand-green);
  box-shadow: none;
}

.btn-toggle-all {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .btn-toggle-all {
    width: 100%;
    justify-content: center;
  }
}

.btn-toggle-all:hover {
  border-color: var(--brand-green);
  color: var(--brand-green);
  background: var(--bg-card-hover);
}

/* ==========================================================================
   Markets & Bots List / Grid (Grouped Cards)
   ========================================================================== */
.market-group {
  margin-bottom: 2.5rem;
}

.group-title-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.group-title-bar h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.group-icon {
  color: var(--brand-green);
}

.group-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 500;
}

/* Cards Grid */
.assets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 1100px) {
  .assets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 650px) {
  .assets-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.asset-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  transition: background var(--transition-fast);
  box-shadow: none;
}

.asset-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.asset-card-header {
  padding: 1.2rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  background: transparent;
}

.asset-card-header:hover {
  background: var(--bg-card-hover);
}

.asset-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.asset-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--brand-green);
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.asset-names {
  display: flex;
  flex-direction: column;
}

.asset-symbol {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.asset-category-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.asset-status-side {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.status-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #282828;
  color: var(--brand-green);
  border: 1px solid #333333;
  white-space: nowrap;
}

.ping-tag {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.chevron-icon {
  color: var(--text-muted);
  transition: transform var(--transition-normal);
  font-size: 0.9rem;
}

.asset-card.expanded .chevron-icon {
  transform: rotate(180deg);
  color: var(--brand-green);
}

/* Sub-bots Accordion Drawer */
.subbots-drawer {
  display: none;
  background: var(--bg-card-subtle);
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.4rem;
}

.asset-card.expanded .subbots-drawer {
  display: block;
}

.subbots-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.subbots-header-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.btn-card-platform {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-green);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #282828;
  border: 1px solid #333333;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.btn-card-platform:hover {
  background: var(--brand-green);
  color: #141414;
  border-color: var(--brand-green);
}

.subbots-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.subbot-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.subbot-name {
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.subbot-name i {
  color: var(--brand-green);
  font-size: 0.8rem;
}

.subbot-metrics {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.subbot-ping {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.subbot-status {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-green);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.subbot-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-green);
}

/* ==========================================================================
   Status Updates / Announcements Section
   ========================================================================== */
.updates-section {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.updates-header {
  margin-bottom: 1.5rem;
}

.updates-header h3 {
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.updates-header h3 i {
  color: var(--brand-green);
}

.updates-header p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.updates-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.update-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  transition: var(--transition-fast);
  box-shadow: none;
}

@media (max-width: 640px) {
  .update-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

.update-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.update-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.update-content {
  flex: 1;
}

.update-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.update-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  text-transform: uppercase;
  background: #282828;
  color: var(--brand-green);
  border: 1px solid #333333;
}

.update-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   Footer (Responsive)
   ========================================================================== */
.footer-bar {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy strong {
  color: var(--brand-green);
  font-weight: 700;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-fast);
}

.footer-link:hover {
  color: var(--brand-green);
}

/* No Results Empty State */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  color: var(--text-muted);
}
.no-results i {
  font-size: 2.5rem;
  color: var(--brand-green);
  margin-bottom: 1rem;
}
.no-results h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
