/* Custom Modern Styling for PS Vita Porting Wiki */

:root {
  --wiki-accent-gradient: linear-gradient(135deg, #0070d1 0%, #00b4d8 100%);
  --wiki-card-border: rgba(0, 112, 209, 0.2);
  --wiki-card-hover: rgba(0, 180, 216, 0.15);
  --wiki-hero-border: rgba(0, 112, 209, 0.15);
}

/* Dark Slate Theme - Custom #1F2129 Background & #121418 Header/Footer */
[data-md-color-scheme="slate"] {
  --md-default-bg-color: #1F2129;
  --md-default-bg-color--light: #252832;
  --md-default-bg-color--lighter: #2d313d;
  --md-default-bg-color--lightest: #383c4a;
  
  --md-primary-fg-color: #121418;
  --md-primary-bg-color: #ffffff;
  --md-primary-bg-color--light: rgba(255, 255, 255, 0.75);
  
  --md-footer-bg-color: #121418;
  --md-footer-bg-color--dark: #0c0e10;

  --wiki-card-bg: rgba(28, 30, 38, 0.95);
  --wiki-card-border: rgba(56, 139, 253, 0.22);
  --wiki-card-hover: rgba(56, 139, 253, 0.12);
  --wiki-hero-border: rgba(255, 255, 255, 0.08);
  --wiki-meta-bg: rgba(20, 22, 28, 0.85);
  --wiki-example-bg: rgba(18, 20, 24, 0.95);
}

[data-md-color-scheme="default"] {
  --wiki-card-bg: rgba(255, 255, 255, 0.95);
  --wiki-card-border: rgba(0, 112, 209, 0.15);
  --wiki-card-hover: rgba(0, 112, 209, 0.08);
  --wiki-hero-border: rgba(0, 0, 0, 0.06);
  --wiki-meta-bg: rgba(241, 245, 249, 0.9);
  --wiki-example-bg: rgba(248, 250, 252, 0.95);
}

/* Header Styling: Match footer #121418 with Crisp White Text & Icons */
.md-header {
  background-color: #121418 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.md-header__title,
.md-header__topic,
.md-header__button,
.md-header .md-icon,
.md-header a,
.md-header .md-header__option {
  color: #ffffff !important;
  fill: #ffffff !important;
}

.md-header__button:hover {
  opacity: 0.85;
}

/* Search bar inside header */
.md-search__inner {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

.md-search__input {
  color: #ffffff !important;
  background-color: transparent !important;
}

.md-search__input::placeholder {
  color: rgba(255, 255, 255, 0.7) !important;
  opacity: 1 !important;
}

.md-search__icon {
  color: #ffffff !important;
  fill: #ffffff !important;
}

/* Language selector dropdown */
.md-header .md-select__inner {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 6px !important;
}

/* Eradicate any auto-generated heading before hero or #overview */
.md-typeset > h1:first-child:has(+ .hero-container),
.md-typeset > h1:first-child:has(+ * > .hero-container),
.md-typeset > h1#overview {
  display: none !important;
}

/* Hero Container */
.hero-container {
  text-align: center;
  padding: 2.5rem 1.5rem 2rem 1.5rem;
  margin-bottom: 2rem;
  border-radius: 16px;
  background: radial-gradient(circle at top, rgba(0, 112, 209, 0.14) 0%, rgba(18, 20, 24, 0.6) 70%);
  border: 1px solid var(--wiki-hero-border);
  backdrop-filter: blur(8px);
}

.hero-title,
h1.hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.8rem 0;
  padding: 0;
  background: linear-gradient(135deg, #0070d1 10%, #00b4d8 60%, #90e0ef 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  max-width: 780px;
  margin: 0 auto 1.5rem auto;
  line-height: 1.6;
  opacity: 0.9;
}

/* Feature Badges */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin: 1.2rem 0;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 9999px;
  background: rgba(0, 112, 209, 0.12);
  border: 1px solid var(--wiki-card-border);
  color: inherit;
  transition: all 0.2s ease;
}

.feature-pill:hover {
  transform: translateY(-2px);
  background: rgba(0, 180, 216, 0.22);
}

/* Modern Roadmap Selection Grid */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.lang-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.8rem;
  border-radius: 14px;
  background: var(--wiki-card-bg);
  border: 1px solid var(--wiki-card-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.lang-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--wiki-accent-gradient);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lang-card:hover {
  transform: translateY(-4px);
  border-color: #00b4d8;
  box-shadow: 0 12px 30px rgba(0, 112, 209, 0.18);
}

.lang-card:hover::before {
  opacity: 1;
}

.lang-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.lang-flag {
  font-size: 2rem;
  line-height: 1;
}

.lang-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
}

.lang-desc {
  font-size: 0.92rem;
  line-height: 1.55;
  opacity: 0.85;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  background: var(--wiki-accent-gradient);
  color: #ffffff !important;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(0, 112, 209, 0.3);
  transition: all 0.2s ease;
}

.lang-btn:hover {
  box-shadow: 0 6px 20px rgba(0, 180, 216, 0.5);
  transform: translateY(-1px);
}

/* Statistics banner */
.stats-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
  text-align: center;
}

.stat-box {
  padding: 1.2rem 1rem;
  border-radius: 12px;
  background: var(--wiki-card-bg);
  border: 1px solid var(--wiki-card-border);
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: #00b4d8;
  margin-bottom: 0.2rem;
}

.stat-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.75;
}

/* ========================================================
   MODERN INTERNAL PAGE STYLING (Chapters 00 - 15)
   ======================================================== */

/* Chapter Top Hero Banner */
.chapter-hero {
  padding: 1.8rem 1.6rem;
  margin-bottom: 2rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 112, 209, 0.1) 0%, rgba(0, 180, 216, 0.05) 100%);
  border-left: 4px solid #00b4d8;
  border-top: 1px solid var(--wiki-card-border);
  border-right: 1px solid var(--wiki-card-border);
  border-bottom: 1px solid var(--wiki-card-border);
  backdrop-filter: blur(6px);
}

.chapter-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 6px;
  background: var(--wiki-accent-gradient);
  color: #ffffff;
  margin-bottom: 0.6rem;
}

.chapter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.chapter-meta-pill {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: var(--wiki-meta-bg);
  border: 1px solid var(--wiki-card-border);
  opacity: 0.9;
}

/* Practical Example Callout Box */
.practical-card {
  margin: 1.8rem 0;
  padding: 1.4rem;
  border-radius: 12px;
  background: var(--wiki-example-bg);
  border: 1px solid var(--wiki-card-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.practical-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #00b4d8;
  margin-bottom: 0.8rem;
}

/* Polished Admonition Overrides */
.md-typeset .admonition,
.md-typeset details {
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* Table Polish */
.md-typeset table:not([class]) {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.md-typeset table:not([class]) th {
  background: rgba(0, 112, 209, 0.08);
}
