/* WC3 Knowledge Base - Custom Styles */

:root {
  /* WC3-inspired dark theme colors */
  --md-primary-fg-color: #4a148c;
  --md-accent-fg-color: #ffc107;
}

[data-md-color-scheme="slate"] {
  --md-default-bg-color: #1a1a2e;
  --md-default-fg-color--light: #c0c0d0;
  --md-typeset-a-color: #bb86fc;
  --md-primary-fg-color: #2d1b69;
  --md-primary-bg-color: #e0d0ff;
}

/* Hero and race page headers */
.md-typeset h1 {
  color: #ffc107;
  border-bottom: 2px solid #4a148c;
  padding-bottom: 0.3em;
}

.md-typeset h2 {
  color: #bb86fc;
  border-bottom: 1px solid #333;
  padding-bottom: 0.2em;
}

.md-typeset h3 {
  color: #ce93d8;
}

/* Important facts (bold items) */
.md-typeset li strong {
  color: #ffc107;
}

/* Source links (video references) */
.md-typeset li em {
  font-size: 0.85em;
  opacity: 0.7;
}

.md-typeset li em a {
  color: #9e9e9e !important;
}

/* Tables */
.md-typeset table:not([class]) {
  border: 1px solid #4a148c;
}

.md-typeset table:not([class]) th {
  background-color: #2d1b69;
  color: #ffc107;
}

.md-typeset table:not([class]) td a {
  font-weight: 500;
}

/* Hero images */
.hero-portrait {
  float: right;
  width: 200px;
  margin: 0 0 1em 1em;
  border: 2px solid #4a148c;
  border-radius: 8px;
}

/* Race banner */
.race-banner {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1em;
  border: 2px solid #4a148c;
}

/* Navigation tabs colors */
.md-tabs {
  background-color: #1a0a3e;
}

/* Footer */
.md-footer {
  background-color: #0d0d1a;
}

/* Admonitions - WC3 themed */
.md-typeset .admonition.tip,
.md-typeset details.tip {
  border-color: #ffc107;
}

.md-typeset .tip > .admonition-title,
.md-typeset .tip > summary {
  background-color: rgba(255, 193, 7, 0.1);
}

.md-typeset .admonition.info,
.md-typeset details.info {
  border-color: #bb86fc;
}

.md-typeset .info > .admonition-title,
.md-typeset .info > summary {
  background-color: rgba(187, 134, 252, 0.1);
}

/* Stats counter on index page */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-card {
  background: linear-gradient(135deg, #2d1b69 0%, #1a1a2e 100%);
  border: 1px solid #4a148c;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.stat-card .stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: #ffc107;
  display: block;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: #c0c0d0;
  margin-top: 0.3rem;
}

/* Matchup page styling */
.matchup-vs {
  text-align: center;
  font-size: 1.5rem;
  color: #ffc107;
  margin: 1rem 0;
  font-weight: bold;
}

/* Fact importance indicator */
.fact-important {
  border-left: 3px solid #ffc107;
  padding-left: 0.5rem;
}

/* Article content styling */
.md-typeset h4 {
  color: #e1bee7;
  margin-top: 1.2em;
}

/* Collapsible note sections (raw facts) */
.md-typeset details.note {
  border-color: #4a148c;
}

.md-typeset .note > summary {
  background-color: rgba(74, 20, 140, 0.15);
  color: #ce93d8;
}

/* Guide page links in tables */
.md-typeset table td a {
  color: #bb86fc !important;
}

/* Better list spacing in articles */
.md-typeset article li {
  margin-bottom: 0.3em;
}

/* Race page hero links */
.md-typeset h3 a {
  color: #ce93d8 !important;
  text-decoration: none;
}

.md-typeset h3 a:hover {
  color: #ffc107 !important;
  text-decoration: underline;
}

/* Light theme overrides */
[data-md-color-scheme="default"] .stat-card {
  background: linear-gradient(135deg, #ede7f6 0%, #f3e5f5 100%);
  border-color: #ce93d8;
}

[data-md-color-scheme="default"] .stat-card .stat-number {
  color: #4a148c;
}

[data-md-color-scheme="default"] .stat-card .stat-label {
  color: #616161;
}

/* Horizontal rule styling */
.md-typeset hr {
  border-color: #4a148c;
  opacity: 0.3;
}

/* Scrollbar styling for dark theme */
[data-md-color-scheme="slate"] ::-webkit-scrollbar {
  width: 8px;
}

[data-md-color-scheme="slate"] ::-webkit-scrollbar-track {
  background: #1a1a2e;
}

[data-md-color-scheme="slate"] ::-webkit-scrollbar-thumb {
  background: #4a148c;
  border-radius: 4px;
}

[data-md-color-scheme="slate"] ::-webkit-scrollbar-thumb:hover {
  background: #6a1b9a;
}

/* ========================================
   Unit & Building Page Styles
   ======================================== */

/* --- Unit Stat Box --- */
.unit-stats {
  background: linear-gradient(135deg, #2d1b69 0%, #1a1a2e 100%);
  border: 1px solid #4a148c;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin: 1rem 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.8rem 1.2rem;
}

.unit-stats dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ce93d8;
  margin: 0;
}

.unit-stats dd {
  font-size: 1.15rem;
  font-weight: bold;
  color: #ffc107;
  margin: 0.1rem 0 0.6rem;
}

@media (max-width: 600px) {
  .unit-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Tier Badges --- */
.tier-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15em 0.55em;
  border-radius: 10px;
  vertical-align: middle;
  line-height: 1.4;
}

.tier-badge.tier-t1,
.tier-badge--t1 {
  background-color: rgba(76, 175, 80, 0.2);
  color: #81c784;
  border: 1px solid #4caf50;
}

.tier-badge.tier-t2,
.tier-badge--t2 {
  background-color: rgba(66, 165, 245, 0.2);
  color: #90caf9;
  border: 1px solid #42a5f5;
}

.tier-badge.tier-t3,
.tier-badge--t3 {
  background-color: rgba(255, 193, 7, 0.15);
  color: #ffd54f;
  border: 1px solid #ffc107;
}

/* --- Category Badge --- */
.category-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15em 0.55em;
  border-radius: 10px;
  vertical-align: middle;
  line-height: 1.4;
  background-color: rgba(74, 20, 140, 0.3);
  color: #ce93d8;
  border: 1px solid #4a148c;
}

/* --- Strength / Weakness Header Colors --- */
.strong-vs-header {
  color: #81c784 !important;
}

.weak-vs-header {
  color: #ef9a9a !important;
}

[data-md-color-scheme="default"] .strong-vs-header {
  color: #2e7d32 !important;
}

[data-md-color-scheme="default"] .weak-vs-header {
  color: #c62828 !important;
}

/* --- Strength / Weakness Indicators --- */
.strong-vs,
.weak-vs {
  list-style: none;
  padding: 0.6rem 1rem;
  margin: 0.5rem 0;
  border-radius: 6px;
}

.strong-vs {
  background-color: rgba(76, 175, 80, 0.08);
  border-left: 3px solid #4caf50;
}

.strong-vs li::before {
  content: "\2714\0020";
  color: #81c784;
  font-weight: bold;
}

.weak-vs {
  background-color: rgba(244, 67, 54, 0.08);
  border-left: 3px solid #f44336;
}

.weak-vs li::before {
  content: "\2718\0020";
  color: #ef9a9a;
  font-weight: bold;
}

/* --- Unit Portrait --- */
.unit-portrait {
  float: right;
  width: 120px;
  margin: 0 0 1em 1em;
  border: 2px solid #4a148c;
  border-radius: 8px;
  overflow: hidden;
}

.unit-portrait img {
  width: 100%;
  height: auto;
  display: block;
}

/* --- Building Card --- */
.building-card {
  background: linear-gradient(135deg, #2d1b69 0%, #1a1a2e 100%);
  border: 1px solid #4a148c;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin: 0.8rem 0;
}

.building-card h4,
.building-card .building-card__title {
  color: #ffc107;
  margin: 0 0 0.4rem;
}

.building-card p,
.building-card .building-card__desc {
  color: #c0c0d0;
  font-size: 0.9rem;
  margin: 0;
}

/* --- Unit Grid (category overview) --- */
.unit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (max-width: 900px) {
  .unit-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .unit-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Unit Card (inside unit-grid) --- */
.unit-card {
  background: linear-gradient(135deg, #2d1b69 0%, #1a1a2e 100%);
  border: 1px solid #4a148c;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.unit-card:hover {
  border-color: #ffc107;
  box-shadow: 0 0 8px rgba(255, 193, 7, 0.25);
}

.unit-card__name {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #bb86fc;
  margin-bottom: 0.35rem;
}

.unit-card__name a {
  color: inherit;
  text-decoration: none;
}

.unit-card__name a:hover {
  color: #ffc107;
}

.unit-card__meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ========================================
   Light Theme Overrides — Units & Buildings
   ======================================== */

[data-md-color-scheme="default"] .unit-stats {
  background: linear-gradient(135deg, #ede7f6 0%, #f3e5f5 100%);
  border-color: #ce93d8;
}

[data-md-color-scheme="default"] .unit-stats dt {
  color: #6a1b9a;
}

[data-md-color-scheme="default"] .unit-stats dd {
  color: #4a148c;
}

[data-md-color-scheme="default"] .tier-badge.tier-t1,
.tier-badge--t1 {
  background-color: rgba(76, 175, 80, 0.12);
  color: #2e7d32;
  border-color: #81c784;
}

[data-md-color-scheme="default"] .tier-badge.tier-t2,
.tier-badge--t2 {
  background-color: rgba(33, 150, 243, 0.12);
  color: #1565c0;
  border-color: #90caf9;
}

[data-md-color-scheme="default"] .tier-badge.tier-t3,
.tier-badge--t3 {
  background-color: rgba(255, 193, 7, 0.15);
  color: #f57f17;
  border-color: #ffd54f;
}

[data-md-color-scheme="default"] .category-badge {
  background-color: rgba(74, 20, 140, 0.1);
  color: #6a1b9a;
  border-color: #ce93d8;
}

[data-md-color-scheme="default"] .strong-vs {
  background-color: rgba(76, 175, 80, 0.06);
}

[data-md-color-scheme="default"] .strong-vs li::before {
  color: #2e7d32;
}

[data-md-color-scheme="default"] .weak-vs {
  background-color: rgba(244, 67, 54, 0.06);
}

[data-md-color-scheme="default"] .weak-vs li::before {
  color: #c62828;
}

[data-md-color-scheme="default"] .unit-portrait {
  border-color: #ce93d8;
}

[data-md-color-scheme="default"] .building-card {
  background: linear-gradient(135deg, #ede7f6 0%, #f3e5f5 100%);
  border-color: #ce93d8;
}

[data-md-color-scheme="default"] .building-card h4,
[data-md-color-scheme="default"] .building-card .building-card__title {
  color: #4a148c;
}

[data-md-color-scheme="default"] .building-card p,
[data-md-color-scheme="default"] .building-card .building-card__desc {
  color: #616161;
}

[data-md-color-scheme="default"] .unit-card {
  background: linear-gradient(135deg, #ede7f6 0%, #f3e5f5 100%);
  border-color: #ce93d8;
}

[data-md-color-scheme="default"] .unit-card:hover {
  border-color: #4a148c;
  box-shadow: 0 0 8px rgba(74, 20, 140, 0.2);
}

[data-md-color-scheme="default"] .unit-card__name {
  color: #4a148c;
}

[data-md-color-scheme="default"] .unit-card__name a:hover {
  color: #6a1b9a;
}
