/**
 * Professional Trading Exchange Headers
 * Modern styling for Market Insights and Top Performers sections
 */

/* Main Trading Section Headers */
.trading-section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(15, 23, 35, 0.95) 0%, rgba(25, 35, 50, 0.9) 100%);
  border: 1px solid rgba(0, 255, 163, 0.15);
  border-radius: 12px 12px 0 0;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  width: 100%;
  box-sizing: border-box;
}

.trading-section-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(0, 255, 163, 0.5) 25%, 
    rgba(0, 229, 255, 0.5) 75%, 
    transparent 100%
  );
}

.trading-section-header::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(0, 255, 163, 0.03) 50%, 
    transparent 100%
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

/* Header Icon Container */
.header-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(0, 255, 163, 0.1) 0%, rgba(0, 229, 255, 0.1) 100%);
  border: 1px solid rgba(0, 255, 163, 0.2);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.header-icon-container i {
  font-size: 20px;
  color: #00ffa3;
  text-shadow: 0 0 10px rgba(0, 255, 163, 0.3);
  z-index: 2;
  position: relative;
}

.header-icon-container::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(0, 255, 163, 0.05) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

/* Header Content */
.header-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-align: center;
}

.section-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.section-subtitle {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Header Status */
.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(0, 255, 163, 0.2);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4444;
  position: relative;
}

.status-indicator.active {
  background: #00ff44;
  box-shadow: 0 0 8px rgba(0, 255, 68, 0.4);
}

.status-indicator.active::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  background: rgba(0, 255, 68, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: ripple 2s infinite;
}

@keyframes ripple {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

.status-text {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 10px;
  font-weight: 600;
  color: #00ff44;
  letter-spacing: 1px;
  text-shadow: 0 0 4px rgba(0, 255, 68, 0.3);
}

/* Enhanced Performers Headers */
.performers-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(20, 25, 35, 0.8) 0%, rgba(30, 35, 45, 0.6) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(5px);
}

.header-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  position: relative;
}

.gainers-icon {
  background: linear-gradient(135deg, rgba(0, 200, 83, 0.15) 0%, rgba(0, 255, 163, 0.1) 100%);
  border: 1px solid rgba(0, 200, 83, 0.3);
}

.gainers-icon i {
  color: #00c853;
  font-size: 14px;
  text-shadow: 0 0 8px rgba(0, 200, 83, 0.4);
}

.losers-icon {
  background: linear-gradient(135deg, rgba(255, 53, 71, 0.15) 0%, rgba(255, 82, 82, 0.1) 100%);
  border: 1px solid rgba(255, 53, 71, 0.3);
}

.losers-icon i {
  color: #ff3547;
  font-size: 14px;
  text-shadow: 0 0 8px rgba(255, 53, 71, 0.4);
}

.header-text {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.header-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: 0.3px;
}

.header-badge {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 1px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Responsive Design */
/* Medium screens (1200px - 700px) - Reduce header heights */
@media (max-width: 1200px) and (min-width: 701px) {
  .trading-section-header {
    padding: 8px 16px; /* Reduced from 16px 20px to ~26px total height */
  }
  
  .section-title {
    font-size: 16px;
  }
  
  .section-subtitle {
    font-size: 11px;
  }
  
  .performers-header {
    padding: 6px 12px; /* Reduced from 12px 16px */
    margin-bottom: 8px; /* Reduced margin */
  }
  
  .header-icon-wrapper {
    width: 28px;
    height: 28px;
  }
  
  .header-title {
    font-size: 13px;
  }
  
  .header-badge {
    font-size: 9px;
  }
}

@media (max-width: 768px) {
  .trading-section-header {
    padding: 12px 16px;
  }
  
  .header-icon-container {
    width: 40px;
    height: 40px;
  }
  
  .header-icon-container i {
    font-size: 16px;
  }
  
  .section-title {
    font-size: 16px;
  }
  
  .section-subtitle {
    font-size: 11px;
  }
  
  .performers-header {
    padding: 10px 12px;
  }
  
  .header-icon-wrapper {
    width: 28px;
    height: 28px;
  }
  
  .header-title {
    font-size: 13px;
  }
}

/* Enhanced Performer Items */
.performer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin-bottom: 1px;
  background: linear-gradient(135deg, rgba(20, 25, 35, 0.6) 0%, rgba(25, 30, 40, 0.4) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(3px);
}

.performer-item:hover {
  background: linear-gradient(135deg, rgba(25, 30, 40, 0.8) 0%, rgba(30, 35, 45, 0.6) 100%);
  border-color: rgba(0, 255, 163, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  /* Removed transform to prevent movement */
}

.performer-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: transparent;
  transition: background 0.2s ease;
}

.gainers .performer-item::before {
  background: transparent;
}

.losers .performer-item::before {
  background: transparent;
}

.performer-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.icon-container {
  position: relative;
  width: 24px;
  height: 24px;
}

.performer-icon,
.letter-fallback-icon {
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.letter-fallback-icon {
  font-size: 10px !important;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.performer-name {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.performer-change {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  min-width: 60px;
  text-align: right;
  letter-spacing: 0.5px;
}

.performer-change.positive {
  color: #00c853;
  background: rgba(0, 200, 83, 0.1);
  border: 1px solid rgba(0, 200, 83, 0.2);
}

.performer-change.negative {
  color: #ff3547;
  background: rgba(255, 53, 71, 0.1);
  border: 1px solid rgba(255, 53, 71, 0.2);
}

/* Professional Indicators Layout */
.professional-indicators {
  background: rgba(15, 20, 30, 0.2);
  border-radius: 0 0 12px 12px;
  padding: 20px;
  width: 100%;
  box-sizing: border-box;
}

.indicators-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.indicator-card {
  background: linear-gradient(135deg, rgba(20, 25, 35, 0.6) 0%, rgba(25, 30, 40, 0.4) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  backdrop-filter: blur(5px);
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.indicator-card:hover {
  background: linear-gradient(135deg, rgba(25, 30, 40, 0.8) 0%, rgba(30, 35, 45, 0.6) 100%);
  border-color: rgba(0, 255, 163, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  /* Removed transform to prevent movement */
}

.indicator-header-professional {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(15, 23, 35, 0.8) 0%, rgba(25, 35, 50, 0.6) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.indicator-header-professional::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(0, 255, 163, 0.3) 50%, 
    transparent 100%
  );
}

.indicator-header-professional .header-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.indicator-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0.3px;
}

.indicator-subtitle {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.indicator-content-wrapper {
  padding: 16px;
}

/* Enhanced container styling */
.performers-container {
  padding: 16px;
  background: rgba(15, 20, 30, 0.3);
  border-radius: 0 0 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top: none;
  position: relative;
}

/* Responsive design for all sections */
/* Large screens - 3x2 grid */
@media (min-width: 1200px) {
  .indicators-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    grid-template-rows: repeat(2, 1fr) !important;
  }
  
  /* Ensure proper grid for market insights */
  .professional-indicators .indicators-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    grid-template-rows: repeat(2, 1fr) !important;
  }
}

@media (max-width: 1199px) {
  .market-stats-container {
    flex-direction: column;
    gap: 12px;
  }
  
  .stat-card {
    width: 100%;
    min-height: auto;
  }
  
  .indicators-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .market-stats-container {
    padding: 8px;
    gap: 8px;
  }
  
  .stat-card {
    margin: 0;
    width: 100%;
  }
  
  .trading-section-header {
    padding: 12px 16px;
  }
  
  .section-title {
    font-size: 16px;
  }
  
  .section-subtitle {
    font-size: 11px;
  }
  
  .indicators-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .professional-indicators {
    padding: 12px;
  }
  
  .indicator-header-professional {
    padding: 8px 12px;
  }
  
  .indicator-title {
    font-size: 13px;
  }
  
  .indicator-subtitle {
    font-size: 9px;
  }
  
  .indicator-content-wrapper {
    padding: 12px;
  }
  
  .performers-container {
    padding: 12px;
  }
  
  .performers-header {
    padding: 8px 12px;
  }
  
  .header-title {
    font-size: 13px;
  }
  
  .performer-item {
    padding: 8px 10px;
  }
  
  .performer-name {
    font-size: 12px;
  }
  
  .performer-change {
    font-size: 11px;
    padding: 3px 6px;
    min-width: 50px;
  }
}

/* Mobile layout fixes - ensure all 7 performers are visible */
@media (max-width: 700px) {
  .performers-container {
    padding: 8px;
    /* Ensure container can accommodate all performers */
    min-height: auto;
    max-height: none;
  }
  
  .performers-section {
    margin-bottom: 8px; /* Compact spacing between gainers and losers */
  }
  
  .performers-header {
    padding: 6px 10px;
    margin-bottom: 6px; /* Reduced margin for mobile */
  }
  
  .performers-list {
    /* Remove height restrictions to show all 7 performers */
    max-height: none !important;
    min-height: auto;
    overflow-y: visible !important;
    gap: 1px !important; /* Minimal gap between items */
  }
  
  .performer-item {
    padding: 5px 8px; /* Compact padding for mobile */
    margin-bottom: 1px;
    min-height: 28px; /* Ensure minimum touch target */
  }
  
  .performer-name {
    font-size: 11px;
  }
  
  .performer-change {
    font-size: 10px;
    padding: 2px 5px;
    min-width: 45px;
  }
  
  .performer-icon,
  .letter-fallback-icon {
    width: 18px !important;
    height: 18px !important;
  }
  
  .header-title {
    font-size: 12px;
  }
  
  .header-badge {
    font-size: 8px;
  }
}

@media (max-width: 480px) {
  .trading-section-header {
    padding: 10px 12px;
  }
  
  .section-title {
    font-size: 14px;
  }
  
  .section-subtitle {
    font-size: 10px;
  }
  
  .professional-indicators {
    padding: 8px;
  }
  
  .indicators-grid {
    gap: 8px;
  }
  
  .indicator-header-professional {
    padding: 6px 10px;
  }
  
  .indicator-title {
    font-size: 12px;
  }
  
  .indicator-subtitle {
    font-size: 8px;
  }
  
  .indicator-content-wrapper {
    padding: 10px;
  }
  
  .performers-container {
    padding: 6px; /* Even more compact for very small screens */
  }
  
  .performers-header {
    padding: 5px 8px;
  }
  
  .header-title {
    font-size: 11px;
  }
  
  .performer-item {
    padding: 4px 6px; /* More compact for very small screens */
    min-height: 26px;
  }
  
  .performer-name {
    font-size: 10px;
  }
  
  .performer-change {
    font-size: 9px;
    padding: 2px 4px;
    min-width: 40px;
  }
  
  .performer-icon,
  .letter-fallback-icon {
    width: 16px !important;
    height: 16px !important;
  }
}

.performers-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(0, 255, 163, 0.3) 25%, 
    rgba(0, 229, 255, 0.3) 75%, 
    transparent 100%
  );
}

/* Market data cards integration */
.market-stats-container {
  gap: 16px;
}

/* stat-card styling removed as requested */
.stat-card {
  border-radius: 0;
  border: none;
  background: transparent;
  backdrop-filter: none;
  overflow: visible;
}

.combined-indicators-container {
  background: rgba(15, 20, 30, 0.2);
  border-radius: 0 0 12px 12px;
}

.performers-section {
  margin-bottom: 0; /* Removed margin to eliminate phantom gap */
}

.performers-section:last-child {
  margin-bottom: 0;
}

.performers-list {
  /* Removed max-height to prevent space allocation issues */
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 255, 163, 0.3) transparent;
}

.performers-list::-webkit-scrollbar {
  width: 4px;
}

.performers-list::-webkit-scrollbar-track {
  background: transparent;
}

.performers-list::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 163, 0.3);
  border-radius: 2px;
}

.performers-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 163, 0.5);
}

/* Dark theme adjustments */
@media (prefers-color-scheme: dark) {
  .trading-section-header {
    background: linear-gradient(135deg, rgba(10, 15, 25, 0.95) 0%, rgba(20, 25, 35, 0.9) 100%);
  }
  
  .performers-header {
    background: linear-gradient(135deg, rgba(15, 20, 30, 0.8) 0%, rgba(25, 30, 40, 0.6) 100%);
  }
  
  .performer-item {
    background: linear-gradient(135deg, rgba(15, 20, 30, 0.6) 0%, rgba(20, 25, 35, 0.4) 100%);
  }
  
  .performers-container {
    background: rgba(10, 15, 25, 0.3);
  }
}