/*
 * Page: Elemental Win Rates
 * Template: templates/pages/elements.html
 * Description: Styles for element statistics, win rates, presence charts, and deck composition
 */

/* === Chart Sections === */
.elements-chart-section {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.elements-chart-container {
  background: var(--color-surface, #1a1a2e);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 2rem;
}

.chart-title {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-text, #fff);
}

.chart-subtitle {
  text-align: center;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.6);
}

.loading-text {
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.6);
}

/* === Element Bars (Chart 1 & 3) === */
.element-bars {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.element-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.element-label {
  width: 80px;
  font-weight: bold;
  font-size: 1.1rem;
  text-shadow: 0 0 10px currentColor;
}

.element-bar-container {
  flex: 1;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.element-bar {
  height: 100%;
  border-radius: 8px;
  transition: width 0.8s ease-out;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  min-width: 60px;
}

.element-bar-text {
  font-weight: bold;
  font-size: 1rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.element-stats {
  width: 160px;
  text-align: right;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Element-specific colors */
.element-fire .element-label {
  color: #e74c3c;
}
.element-fire .element-bar {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.element-water .element-label {
  color: #3498db;
}
.element-water .element-bar {
  background: linear-gradient(90deg, #3498db, #2980b9);
}

.element-earth .element-label {
  color: #8b4513;
}
.element-earth .element-bar {
  background: linear-gradient(90deg, #8b4513, #654321);
}

.element-air .element-label {
  color: #87ceeb;
}
.element-air .element-bar {
  background: linear-gradient(90deg, #87ceeb, #5dade2);
}

/* === Presence Bars (Chart 2) === */
.presence-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.presence-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.presence-label {
  width: 80px;
  font-weight: bold;
  font-size: 1rem;
  text-shadow: 0 0 10px currentColor;
}

.presence-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.presence-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.presence-bar-label {
  width: 50px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.presence-bar-container {
  flex: 1;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.presence-bar {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  min-width: 40px;
  transition: width 0.8s ease-out;
}

.presence-bar.wins {
  background: linear-gradient(90deg, #2ecc71, #27ae60);
}

.presence-bar.losses {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.presence-bar-text {
  font-size: 0.75rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.presence-stats {
  width: 80px;
  text-align: right;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

/* === Chart Legend === */
.chart-legend {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

.legend-color.wins {
  background: #2ecc71;
}

.legend-color.losses {
  background: #e74c3c;
}

/* === Composition Bars (Charts 4, 5, 6) === */
.composition-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.composition-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.composition-label {
  min-width: 200px;
  font-weight: 600;
  font-size: 0.95rem;
}

.composition-bar-container {
  flex: 1;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  position: relative;
  display: flex;
  align-items: center;
}

.composition-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.8s ease-out;
}

.composition-bar-text {
  position: absolute;
  right: 10px;
  font-weight: bold;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
}

.composition-stats {
  min-width: 120px;
  text-align: right;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Composition bar colors by element */
.element-fire .composition-bar {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.element-water .composition-bar {
  background: linear-gradient(90deg, #3498db, #2980b9);
}

.element-earth .composition-bar {
  background: linear-gradient(90deg, #8b4513, #654321);
}

.element-air .composition-bar {
  background: linear-gradient(90deg, #87ceeb, #5dade2);
}

.element-multi .composition-bar {
  background: linear-gradient(90deg, #9b59b6, #8e44ad);
}

.element-multi {
  color: #9b59b6;
}
