/* Agent Marketplace - Styling */

:root {
  --bg-dark: #0a0a0f;
  --bg-card: #12121a;
  --bg-hover: #1a1a25;
  --accent: #00d4aa;
  --accent-glow: rgba(0, 212, 170, 0.3);
  --text-primary: #ffffff;
  --text-secondary: #8888aa;
  --border: #2a2a3a;
  --success: #00d4aa;
  --error: #ff4466;
  --warning: #ffaa00;
}

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

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

/* Background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(0, 212, 170, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(100, 100, 255, 0.05) 0%, transparent 50%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 50px,
      rgba(255, 255, 255, 0.01) 50px,
      rgba(255, 255, 255, 0.01) 51px
    );
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 3rem;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--accent), #66ffcc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* Stats Banner */
.stats-banner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Main Grid */
.main-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

/* Section styling */
.section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

.section h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.service-card {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.service-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-2px);
}

.service-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.service-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.service-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  min-height: 2.5em;
}

.service-price {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.price-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.price-currency {
  color: var(--text-secondary);
}

.price-label {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-left: 0.25rem;
}

.service-seller {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* Wallets */
.wallet-select {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.wallets-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wallet-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-dark);
  border-radius: 8px;
  border: 1px solid transparent;
}

.wallet-item.active {
  border-color: var(--accent);
  background: rgba(0, 212, 170, 0.1);
}

.wallet-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wallet-balance {
  text-align: right;
}

.balance-amount {
  font-weight: 600;
  color: var(--accent);
}

.balance-currency {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Transactions */
.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.transaction-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-dark);
  border-radius: 8px;
}

.tx-icon {
  font-size: 1.25rem;
}

.tx-details {
  flex: 1;
}

.tx-summary {
  font-size: 0.9rem;
}

.tx-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
}

/* Status Message */
.status-message {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: 500;
  display: none;
  z-index: 1000;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.status-success {
  background: rgba(0, 212, 170, 0.2);
  border: 1px solid var(--accent);
  color: var(--accent);
}

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

.status-loading {
  background: rgba(255, 170, 0, 0.2);
  border: 1px solid var(--warning);
  color: var(--warning);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
}

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

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

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

.modal h3 {
  margin-bottom: 1rem;
}

.modal-details {
  margin-bottom: 1.5rem;
}

.modal-detail {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.modal-detail:last-child {
  border-bottom: none;
}

.modal-actions {
  display: flex;
  gap: 1rem;
}

.btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-dark);
}

.btn-primary:hover {
  background: #00e6b8;
}

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

.btn-secondary:hover {
  border-color: var(--text-secondary);
}

.demo-btn {
  width: 100%;
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, var(--accent), #66ffcc);
  border: none;
  border-radius: 8px;
  color: var(--bg-dark);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

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

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }
  
  header h1 {
    font-size: 1.75rem;
  }
  
  .stats-banner {
    grid-template-columns: 1fr;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}
