/* BasicSwap Orderbook Landing Page Styles */
:root {
  --bg-primary: #111827;
  --bg-secondary: #1f2937;
  --bg-tertiary: #374151;
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-green: #10b981;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;
  --border-color: #374151;
  --border-light: #4b5563;
}

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

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

/* Header */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-blue);
}

.logo-badge {
  font-size: 12px;
  padding: 4px 8px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border-radius: 4px;
}

.nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

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

/* Buttons */
.btn-primary {
  display: inline-block;
  padding: 10px 20px;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
}

.btn-secondary {
  display: inline-block;
  padding: 10px 20px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

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

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* Freshness Bar */
.freshness-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 16px;
}

.freshness-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.freshness-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: pulse 2s infinite;
}

.freshness-dot.fresh { background: var(--accent-green); }
.freshness-dot.recent { background: var(--accent-yellow); }
.freshness-dot.stale { background: var(--accent-red); }
.freshness-dot.unavailable { background: var(--text-dim); animation: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.freshness-text {
  font-size: 14px;
  color: var(--text-muted);
}

.freshness-stats {
  font-size: 14px;
  color: var(--text-muted);
}

.separator {
  margin: 0 8px;
  color: var(--border-color);
}

.btn-refresh {
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

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

/* Filters */
.filters-bar {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.filter-group select {
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 14px;
  min-width: 150px;
  cursor: pointer;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.btn-clear {
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

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

/* Table */
.table-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.offers-table {
  width: 100%;
  border-collapse: collapse;
}

.offers-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.offers-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.offers-table th.sortable:hover {
  color: var(--text-primary);
}

.sort-icon {
  margin-left: 4px;
  opacity: 0.5;
}

.offers-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.offers-table tr:last-child td {
  border-bottom: none;
}

.offers-table tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

.pair-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.coin-from {
  font-weight: 600;
  color: var(--accent-blue);
}

.coin-arrow {
  color: var(--text-dim);
}

.coin-to {
  font-weight: 600;
  color: var(--accent-green);
}

.loading-row td {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 12px;
}

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

.loading-text {
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
}

.empty-row td {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.btn-page {
  padding: 10px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

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

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

.page-info {
  font-size: 14px;
  color: var(--text-muted);
}

/* Stats Section */
.stats-section {
  margin-top: 32px;
}

.stats-section h2 {
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.pairs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.pair-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
}

.pair-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.pair-name {
  font-weight: 600;
  color: var(--text-primary);
}

.offer-count {
  font-size: 12px;
  padding: 4px 8px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border-radius: 4px;
}

.pair-stats {
  font-size: 13px;
  color: var(--text-muted);
}

.pair-stats div {
  margin-bottom: 4px;
}

/* API CTA */
.api-cta {
  margin-top: 40px;
  padding: 32px;
  background: linear-gradient(135deg, var(--bg-secondary), rgba(59, 130, 246, 0.1));
  border: 1px solid var(--border-color);
  border-radius: 12px;
  text-align: center;
}

.api-cta h2 {
  font-size: 24px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.api-cta p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Footer */
.footer {
  margin-top: 60px;
  padding: 24px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
}

.footer p {
  font-size: 14px;
  color: var(--text-dim);
}

.footer a {
  color: var(--accent-blue);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer-links {
  margin-top: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 12px;
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group select {
    width: 100%;
  }

  .freshness-bar {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .offers-table th:nth-child(4),
  .offers-table td:nth-child(4) {
    display: none;
  }

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