/* Atlas Page Styles */
@font-face {
  font-family: 'BeaufortBold';
  src: url('/BeaufortforLOL-Bold.otf') format('opentype');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'BeaufortHeavyItalic';
  src: url('/BeaufortforLOL-HeavyItalic.otf') format('opentype');
  font-weight: normal;
  font-style: italic;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'BeaufortHeavyItalic', Arial, sans-serif;
  background: #0E1C2F;
  color: #F2F2F2;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.atlas-header {
  background: #15263A;
  border-bottom: 1px solid #2a3f5a;
  padding: .75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -20px -20px 20px;
  padding: .75rem 20px;
}

.atlas-header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.atlas-header h1 {
  font-family: 'BeaufortBold', Arial, sans-serif;
  color: #E6A63C;
  margin: 0;
  font-size: 1.3rem;
}

.atlas-nav a {
  color: #93E1FF;
  text-decoration: none;
  font-size: .85rem;
  margin-right: 1rem;
}
.atlas-nav a:hover {
  color: #E6A63C;
}

/* Filter Panel */
.filter-panel {
  background: #15263A;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 15px;
}

.filter-row:last-child {
  margin-bottom: 0;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 200px;
}

.filter-group label {
  color: #E6A63C;
  font-weight: bold;
  font-size: 0.9rem;
}

.filter-group input,
.filter-group select {
  padding: 8px 12px;
  border: 1px solid #2A3F56;
  border-radius: 4px;
  background: #0E1C2F;
  color: #F2F2F2;
  font-size: 14px;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: #66CCFF;
  box-shadow: 0 0 5px rgba(102, 204, 255, 0.3);
}

/* Rune icon filter buttons */
.atlas-rune-filters {
  display: flex;
  align-items: center;
  gap: 6px;
}
.atlas-rune-btn {
  width: 32px; height: 32px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  background: none;
  padding: 0;
  opacity: 0.55;
  transition: border-color 0.2s, transform 0.2s, opacity 0.2s;
}
.atlas-rune-btn img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.atlas-rune-btn:hover { transform: scale(1.18); opacity: 1; }
.atlas-rune-btn.active { border-color: #E6A63C; transform: scale(1.18); opacity: 1; }

.range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-inputs select,
.range-inputs input {
  padding: 8px 12px;
  border: 1px solid #2A3F56;
  border-radius: 4px;
  background: #0E1C2F;
  color: #F2F2F2;
  font-size: 14px;
}

.range-inputs span {
  color: #93E1FF;
  font-size: 0.9rem;
}

.clear-btn {
  padding: 8px 16px;
  background: #E6A63C;
  color: #0E1C2F;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
  align-self: flex-end;
}

.clear-btn:hover {
  background: #F2B84F;
}

/* Results Info */
.results-info {
  margin-bottom: 20px;
  color: #93E1FF;
  font-size: 1.1rem;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.card-item {
  background: #15263A;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.card-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.card-image {
  width: 100%;
  height: 280px;
  object-fit: contain;
  display: block;
  background: #0E1C2F;
}

.card-info {
  padding: 15px;
}

.card-name {
  font-family: 'BeaufortBold', Arial, sans-serif;
  font-size: 1.2rem;
  font-weight: bold;
  color: #E6A63C;
  margin: 0 0 8px 0;
}

.card-type {
  font-size: 0.9rem;
  color: #93E1FF;
  margin-bottom: 8px;
}

.card-stats {
  display: flex;
  gap: 15px;
  font-size: 0.9rem;
}

.stat {
  color: #F2F2F2;
}

.stat-label {
  color: #93E1FF;
  font-weight: bold;
}

/* Color indicators */
.card-item[data-color="Fury"] {
  border-left: 4px solid #FF6B6B;
}

.card-item[data-color="Mind"] {
  border-left: 4px solid #4ECDC4;
}

.card-item[data-color="Calm"] {
  border-left: 4px solid #45B7D1;
}

.card-item[data-color="Body"] {
  border-left: 4px solid #FFA726;
}

.card-item[data-color="Chaos"] {
  border-left: 4px solid #AB47BC;
}

.card-item[data-color="Order"] {
  border-left: 4px solid #FFEE58;
}

/* Battlefield cards in grid view - landscape */
.card-item.battlefield-card {
  grid-column: span 2;
}
.card-item.battlefield-card .card-image {
  height: 200px;
  object-fit: contain;
}
/* Portrait battlefield images (OGN/SFD) need rotation */
.card-item.bf-portrait .card-image {
  transform: rotate(90deg);
  height: 240px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: #93E1FF;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: #15263A;
  margin: 2% auto;
  padding: 0;
  border-radius: 12px;
  width: 95%;
  max-width: 1200px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  background: #1E3A52;
  border-radius: 12px 12px 0 0;
}

.modal-header h2 {
  font-family: 'BeaufortBold', Arial, sans-serif;
  color: #E6A63C;
  margin: 0;
  font-size: 1.8rem;
}

.close-modal {
  color: #93E1FF;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal:hover {
  color: #66CCFF;
}

.modal-body {
  display: flex;
  gap: 30px;
  padding: 30px;
}

.modal-left {
  flex: 0 0 300px;
}

.modal-left img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Battlefield card in modal — landscape display */
.battlefield-modal-image {
  width: 100%;
  height: auto;
  max-width: 400px;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
/* Portrait battlefields (OGN/SFD) in modal need rotation */
.bf-portrait-modal {
  transform: rotate(90deg);
  max-width: 280px;
  margin: 60px auto;
}

/* Adjust modal left column for battlefield cards */
.battlefield-modal .modal-left {
  flex: 0 0 400px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.modal-right {
  flex: 1;
}

.card-stats {
  margin-bottom: 25px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #2A3F56;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  color: #93E1FF;
  font-weight: bold;
}

.stat-value {
  color: #F2F2F2;
  font-weight: bold;
}

.card-text {
  margin-bottom: 25px;
}

.card-text h3 {
  font-family: 'BeaufortBold', Arial, sans-serif;
  color: #E6A63C;
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.card-text p {
  line-height: 1.6;
  color: #F2F2F2;
}

.card-actions {
  margin-bottom: 25px;
}

.cardmarket-btn {
  display: inline-block;
  padding: 10px 20px;
  background: #66CCFF;
  color: #0E1C2F;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  transition: background-color 0.2s;
}

.cardmarket-btn:hover {
  background: #4FB8E8;
  text-decoration: none;
}

.price-chart-container {
  margin-top: 25px;
  height: 400px;
  position: relative;
  overflow: hidden;
}

.price-chart-container h3 {
  color: #E6A63C;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

#price-chart {
  height: 350px !important;
  width: 100% !important;
  background: #0E1C2F;
  border-radius: 8px;
  padding: 10px;
  overflow: hidden !important;
}

/* Taucharts custom styling */
#price-chart .tau-chart {
  background: transparent !important;
  overflow: hidden !important;
}

#price-chart .tau-chart__svg {
  background: transparent !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

/* Make scatterplot points more visible */
#price-chart .graphical-report circle {
  stroke-width: 2px !important;
  stroke: #0E1C2F !important;
  opacity: 0.9 !important;
}

/* Hover effects for better interaction */
#price-chart .graphical-report circle:hover {
  opacity: 1 !important;
  stroke-width: 3px !important;
  cursor: pointer !important;
  transform: scale(1.2) !important;
  transition: all 0.2s ease !important;
}

/* Add a subtle glow effect on hover */
#price-chart .graphical-report circle:hover {
  filter: drop-shadow(0 0 8px currentColor) !important;
}

/* Chart axis styling */
#price-chart .axis text {
  fill: #F2F2F2 !important;
  font-size: 12px !important;
}

#price-chart .axis path,
#price-chart .axis line {
  stroke: #93E1FF !important;
  stroke-width: 1px !important;
}

/* Tooltip styling */
#price-chart .graphical-report__tooltip {
  background: rgba(21, 38, 58, 0.95) !important;
  border: 1px solid #66CCFF !important;
  border-radius: 6px !important;
  color: #F2F2F2 !important;
  font-size: 12px !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4) !important;
  min-width: 150px !important;
  z-index: 1000 !important;
}

#price-chart .graphical-report__tooltip .tau-chart__tooltip__list__item {
  color: #F2F2F2 !important;
  padding: 2px 0 !important;
}

#price-chart .graphical-report__tooltip .tau-chart__tooltip__list__item__value {
  color: #E6A63C !important;
  font-weight: bold !important;
}

/* Legend styling */
#price-chart .tau-chart__legend {
  background: rgba(21, 38, 58, 0.95) !important;
  border: 2px solid #66CCFF !important;
  border-radius: 8px !important;
  padding: 12px !important;
  margin: 15px !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
}

#price-chart .tau-chart__legend__item {
  color: #F2F2F2 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  margin: 6px 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* Fix legend text visibility */
#price-chart .tau-chart__legend text {
  fill: #F2F2F2 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

/* Fix legend labels */
#price-chart .tau-chart__legend__item__label {
  color: #F2F2F2 !important;
  fill: #F2F2F2 !important;
}

/* Fix legend title */
#price-chart .tau-chart__legend__title {
  color: #E6A63C !important;
  fill: #E6A63C !important;
  font-weight: bold !important;
}

#price-chart .tau-chart__legend__guide--color {
  border: 2px solid #F2F2F2 !important;
  border-radius: 50% !important;
  width: 16px !important;
  height: 16px !important;
  opacity: 1 !important;
}

/* Specific color overrides for legend visibility */
#price-chart .tau-chart__legend__guide--color[style*="background-color: rgb(0, 191, 255)"] {
  background-color: #00BFFF !important;
}

#price-chart .tau-chart__legend__guide--color[style*="background-color: rgb(255, 215, 0)"] {
  background-color: #FFD700 !important;
}

#price-chart .tau-chart__legend__guide--color[style*="background-color: rgb(50, 205, 50)"] {
  background-color: #32CD32 !important;
}

/* Hide stray legend markers that appear outside the legend container */
#price-chart .tau-chart__svg > circle[r="6"] {
  display: none !important;
}

/* Hide any orphaned legend guides */
#price-chart .tau-chart__svg > .tau-chart__legend__guide {
  visibility: hidden !important;
}

/* Grid lines styling */
#price-chart .tau-chart__grid__lines {
  stroke: rgba(147, 225, 255, 0.1) !important;
  stroke-width: 1px !important;
}

.price-note {
  font-size: 0.9rem;
  color: #93E1FF;
  margin-top: 10px;
  text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  .atlas-header {
    padding: .5rem .75rem;
    margin: -15px -15px 15px;
  }
  .atlas-header-left { gap: .75rem; }
  .atlas-header h1 { font-size: 1rem; white-space: nowrap; }
  .atlas-nav { display: none; }
  
  .filter-row {
    flex-direction: column;
    gap: 15px;
  }
  
  .filter-group {
    min-width: auto;
  }
  
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
  }
  
  .modal-content {
    width: 95%;
    margin: 1% auto;
  }
  
  .modal-body {
    flex-direction: column;
    gap: 20px;
    padding: 20px;
  }
  
  .modal-left {
    flex: none;
    align-self: center;
  }
}

@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-header {
    padding: 15px 20px;
  }
  
  .modal-header h2 {
    font-size: 1.5rem;
  }
}