/* Advanced Markets Page with darker theme, video background, and side-by-side tables */

/* Video Background */
.video-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.video-background video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(10, 10, 12, 0.95) 0%,
    rgba(15, 15, 18, 0.92) 50%,
    rgba(20, 20, 24, 0.95) 100%
  );
}

/* Markets Hero */
.markets-hero {
  padding: 180px 0 100px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 4rem;
  font-weight: 900;
  background: linear-gradient(135deg, #d4af37 0%, #ffd700 50%, #c9a961 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  animation: fadeInUp 0.8s ease-out;
  text-shadow: 0 0 40px rgba(212, 175, 55, 0.3);
  letter-spacing: -1px;
}

.hero-subtitle {
  font-size: 1.3rem;
  color: #a0a0a5;
  animation: fadeInUp 0.8s ease-out 0.2s both;
  font-weight: 300;
  letter-spacing: 0.5px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-top: 50px;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #d4af37;
  margin-bottom: 8px;
  font-family: "Courier New", monospace;
}

.stat-label {
  font-size: 0.85rem;
  color: #6b6b70;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* Market Section */
.market-section {
  padding: 80px 0 120px;
  position: relative;
  z-index: 1;
}

.container-wide {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 40px;
}

/* Side-by-side tables layout */
.tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.table-container {
  background: rgba(15, 15, 18, 0.65);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: all 0.4s ease;
}

.table-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 80px rgba(212, 175, 55, 0.2);
  border-color: rgba(212, 175, 55, 0.3);
}

/* Enhanced table header with gradient and icons */
.table-header {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(201, 169, 97, 0.15) 100%);
  padding: 25px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(212, 175, 55, 0.3);
  position: relative;
  overflow: hidden;
}

.table-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.header-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-icon {
  width: 28px;
  height: 28px;
  color: #d4af37;
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.5));
}

.table-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #d4af37;
  margin: 0;
  letter-spacing: -0.5px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #34c759;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #34c759;
  border-radius: 50%;
  animation: pulse 2s infinite;
  box-shadow: 0 0 10px #34c759;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

/* Redesigned table with smaller fonts and better spacing */
.market-table-wrapper {
  overflow-x: auto;
  padding: 20px;
}

.market-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.market-table thead th {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(139, 115, 85, 0.1) 100%);
  color: #d4af37;
  padding: 14px 16px;
  text-align: right;
  font-weight: 700;
  font-size: 0.75rem;
  border: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  backdrop-filter: blur(10px);
}

.market-table thead th:first-child {
  border-radius: 0 12px 12px 0;
}

.market-table thead th:last-child {
  border-radius: 12px 0 0 12px;
}

.market-table tbody tr {
  background: linear-gradient(135deg, rgba(25, 25, 30, 0.5) 0%, rgba(20, 20, 25, 0.5) 100%);
  transition: all 0.3s ease;
  animation: fadeInRow 0.5s ease-out forwards;
  opacity: 0;
  backdrop-filter: blur(10px);
}

.market-table tbody tr:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(139, 115, 85, 0.08) 100%);
  transform: translateX(-3px);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.15);
}

.market-table tbody td {
  padding: 16px;
  color: #e5e5e7;
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
}

.market-table tbody tr td:first-child {
  border-radius: 0 12px 12px 0;
}

.market-table tbody tr td:last-child {
  border-radius: 12px 0 0 12px;
}

/* Rank styling */
.rank-cell {
  color: #6b6b70;
  font-weight: 700;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
}

/* Symbol cell */
.symbol-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.symbol-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d4af37 0%, #c9a961 100%);
  font-weight: 800;
  color: #0a0a0c;
  font-size: 0.7rem;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
  transition: all 0.3s ease;
}

.symbol-logo:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

.symbol-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.symbol-name {
  font-weight: 700;
  color: #e5e5e7;
  font-size: 0.9rem;
}

.symbol-code {
  font-size: 0.7rem;
  color: #6b6b70;
  font-weight: 600;
}

/* Price styling with monospace font */
.price-cell {
  font-family: "Courier New", monospace;
  font-weight: 700;
  font-size: 0.9rem;
}

.price-positive {
  color: #34c759;
}

.price-negative {
  color: #ff3b30;
}

/* Change badges */
.change-positive {
  background: rgba(52, 199, 89, 0.15);
  color: #34c759;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  border: 1px solid rgba(52, 199, 89, 0.3);
  font-family: "Courier New", monospace;
}

.change-negative {
  background: rgba(255, 59, 48, 0.15);
  color: #ff3b30;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 59, 48, 0.3);
  font-family: "Courier New", monospace;
}

/* Buy button */
.buy-btn {
  background: linear-gradient(135deg, #d4af37 0%, #c9a961 100%);
  color: #0a0a0c;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.buy-btn:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5);
  background: linear-gradient(135deg, #ffd700 0%, #d4af37 100%);
}

.buy-btn:active {
  transform: scale(0.98);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRow {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Stagger animation delays */
.market-table tbody tr:nth-child(1) {
  animation-delay: 0.05s;
}
.market-table tbody tr:nth-child(2) {
  animation-delay: 0.1s;
}
.market-table tbody tr:nth-child(3) {
  animation-delay: 0.15s;
}
.market-table tbody tr:nth-child(4) {
  animation-delay: 0.2s;
}
.market-table tbody tr:nth-child(5) {
  animation-delay: 0.25s;
}
.market-table tbody tr:nth-child(6) {
  animation-delay: 0.3s;
}
.market-table tbody tr:nth-child(7) {
  animation-delay: 0.35s;
}
.market-table tbody tr:nth-child(8) {
  animation-delay: 0.4s;
}
.market-table tbody tr:nth-child(9) {
  animation-delay: 0.45s;
}
.market-table tbody tr:nth-child(10) {
  animation-delay: 0.5s;
}
.market-table tbody tr:nth-child(11) {
  animation-delay: 0.55s;
}
.market-table tbody tr:nth-child(12) {
  animation-delay: 0.6s;
}
.market-table tbody tr:nth-child(13) {
  animation-delay: 0.65s;
}
.market-table tbody tr:nth-child(14) {
  animation-delay: 0.7s;
}
.market-table tbody tr:nth-child(15) {
  animation-delay: 0.75s;
}

/* Responsive */
@media (max-width: 1400px) {
  .container-wide {
    padding: 0 30px;
  }

  .tables-grid {
    gap: 30px;
  }
}

@media (max-width: 1024px) {
  .tables-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-title {
    font-size: 3rem;
  }

  .hero-stats {
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: 25px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .container-wide {
    padding: 0 20px;
  }

  .market-table {
    font-size: 0.75rem;
  }

  .market-table thead th,
  .market-table tbody td {
    padding: 10px 8px;
  }

  .symbol-logo {
    width: 30px;
    height: 30px;
    font-size: 0.6rem;
  }

  .buy-btn {
    padding: 8px 14px;
    font-size: 0.7rem;
  }
}
