.markets-section {
  padding: 8rem 4rem;
  position: relative;
  background: linear-gradient(180deg, rgba(57, 255, 20, 0.02) 0%, rgba(10, 15, 10, 0.02) 100%);
}

.markets-container {
  max-width: 1400px;
  margin: 0 auto;
}

.markets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  padding: 1rem;
  grid-auto-flow: row;
  grid-auto-rows: 1fr;
  grid-auto-columns: 1fr;
}

.market-card {
  background: var(--market-card-background);
  border: 1px solid var(--analyze-hover);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.market-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-green), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.market-card:hover {
  transform: translateY(-5px);
  border-color: var(--neon-green);
  box-shadow: 0 8px 32px var(--market-shadow);
}

.market-card:hover::before {
  opacity: 1;
}

.market-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--market-shadow);
  gap: 1rem;
}

.market-title {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.market-title h3 {
  color: var(--neon-green);
  font-size: 1.6rem;
  font-family: 'Source Code Pro', monospace;
  letter-spacing: 0.5px;
  margin: 0;
  line-height: 1;
  font-weight: 600;
}

.market-name {
  color: var(--terminal-green);
  font-size: 0.85rem;
  opacity: 0.8;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.market-price {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-end;
}

.current-price {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 600;
  font-family: 'Source Code Pro', monospace;
  letter-spacing: -0.5px;
  line-height: 1;
}

.price-change {
  font-size: 0.9rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-family: 'Source Code Pro', monospace;
  font-weight: 500;
  min-width: 80px;
  text-align: center;
}

.price-change.positive {
  background: rgba(0, 255, 0, 0.1);
  color: #00ff00;
  border: 1px solid rgba(0, 255, 0, 0.2);
}

.price-change.negative {
  background: rgba(255, 0, 0, 0.1);
  color: #ff0000;
  border: 1px solid rgba(255, 0, 0, 0.2);
}

.market-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.8rem;
  background: var(--markets-stat-background);
  border-radius: 8px;
  transition: background 0.3s ease, border-color 0.3s ease;
  border: 1px solid var(--hover-bg);
}

.stat:hover {
  background: var(--hover-bg);
  border-color: var(--market-shadow);
}

.stat-label {
  color: var(--terminal-green);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
}

.stat-value {
  color: #fff;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.loading {
  text-align: center;
  padding: 4rem;
  color: var(--terminal-green);
  font-family: 'Source Code Pro', monospace;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--neon-green);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.error {
  text-align: center;
  padding: 4rem;
  color: #ff0000;
  font-family: 'Source Code Pro', monospace;
  font-size: 1.2rem;
}

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

/* Responsive Design */

@media (max-width: 1200px) {
  .markets-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .markets-section {
    padding: 4rem 2rem;
  }
  .markets-grid {
    grid-template-columns: 1fr;
  }
  .market-stats {
    grid-template-columns: 1fr;
  }
  .market-title h3 {
    font-size: 1.5rem;
  }
  .current-price {
    font-size: 1.2rem;
  }
  .market-card {
    padding: 1rem;
  }
  .stat {
    padding: 0.6rem;
  }
  .stat-value {
    font-size: 0.85rem;
  }
}

.view-all-container {
  text-align: center;
  margin-top: 2rem;
}

.view-all-button {
  background: transparent;
  border: 1px solid var(--neon-green);
  color: var(--neon-green);
  padding: 0.8rem 2rem;
  font-family: 'Source Code Pro', monospace;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
  overflow: hidden;
}

.view-all-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--analyze-hover), transparent);
  transition: left 0.5s;
}

.view-all-button:hover {
  background: var(--market-shadow);
  box-shadow: 0 0 20px var(--analyze-hover);
  transform: translateY(-2px);
}

.view-all-button:hover::before {
  left: 100%;
}

/* Additional Styles for Market Links */

.market-links {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--market-shadow);
}

.dex-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--terminal-green);
  text-decoration: none;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.9rem;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
  opacity: 0.8;
}

.dex-link:hover {
  background: var(--hover-bg);
  color: var(--neon-green);
  opacity: 1;
  transform: translateX(5px);
}

.dex-icon {
  transition: transform 0.3s ease;
}

.dex-link:hover .dex-icon {
  transform: rotate(15deg);
}

/* Section Header Styles */

.market-tracking-section .section-header {
  text-align: center;
  margin-bottom: 4rem;
  position: relative;
}

.market-tracking-section .section-header h2 {
  font-size: 3.5rem;
  color: var(--neon-green);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 1rem;
  font-family: 'Source Code Pro', monospace;
  position: relative;
  display: inline-block;
  text-shadow: 0 0 10px #ff6bda80, 0 0 20px #fb96ff4d, 0 0 30px var(--analyze-hover);
}

.market-tracking-section .section-header h2::before {
  content: '<';
  position: absolute;
  left: -2rem;
  opacity: 0.5;
}

.market-tracking-section .section-header h2::after {
  content: '/>';
  position: absolute;
  right: -2.5rem;
  opacity: 0.5;
}

.market-tracking-section .section-header p {
  font-size: 1.2rem;
  color: var(--terminal-green);
  font-family: 'Source Code Pro', monospace;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  padding: 1rem;
  background: var(--markets-stat-background);
  border-radius: 8px;
  border: 1px solid var(--market-shadow);
  backdrop-filter: blur(5px);
}
