/* ========================================
   FASTR MkDocs Theme
   ========================================
   Official FASTR brand colors and styling
   Based on FASTR brand guidelines
*/

:root {
  /* ========================================
     FASTR PRIMARY COLORS
     ======================================== */
  --fastr-deep-green: #09544F;
  --fastr-dark-green: #0C716B;
  --fastr-green: #1F9A9C;
  --fastr-lime: #D0CB17;
  --fastr-navy: #21568C;
  --fastr-blue: #1A90C0;
  --fastr-light-blue: #CAE6E9;

  /* ========================================
     FASTR SECONDARY COLORS
     ======================================== */
  --fastr-gold: #D8A822;
  --fastr-purple: #7A1F6E;
  --fastr-orchid: #BD5091;
  --fastr-coral: #FF6462;

  /* ========================================
     MKDOCS MATERIAL OVERRIDES (Light Mode)
     ======================================== */
  --md-primary-fg-color: var(--fastr-dark-green);
  --md-primary-fg-color--light: var(--fastr-green);
  --md-primary-fg-color--dark: var(--fastr-deep-green);
  --md-accent-fg-color: var(--fastr-blue);
  --md-accent-fg-color--transparent: rgba(26, 144, 192, 0.1);
}

/* Dark Mode Overrides */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: var(--fastr-green);
  --md-primary-fg-color--light: var(--fastr-light-blue);
  --md-primary-fg-color--dark: var(--fastr-dark-green);
  --md-accent-fg-color: var(--fastr-blue);
}

/* ========================================
   HEADERS
   ======================================== */
h1 {
  color: var(--fastr-deep-green) !important;
  border-bottom: 3px solid var(--fastr-lime);
  padding-bottom: 0.3em;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
}

h2 {
  color: var(--fastr-navy) !important;
  border-bottom: 2px solid var(--fastr-blue);
  padding-bottom: 0.2em;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
}

h3 {
  color: var(--fastr-purple) !important;
  border-left: 4px solid var(--fastr-orchid);
  padding-left: 0.5em;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
}

h4, h5, h6 {
  margin-top: 1em;
  margin-bottom: 0.5em;
}

/* Dark mode header adjustments */
[data-md-color-scheme="slate"] h1 {
  color: var(--fastr-light-blue) !important;
}

[data-md-color-scheme="slate"] h2 {
  color: var(--fastr-blue) !important;
}

[data-md-color-scheme="slate"] h3 {
  color: var(--fastr-orchid) !important;
}

/* ========================================
   LINKS
   ======================================== */
a {
  color: var(--fastr-blue);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: border-bottom-color 0.2s;
}

a:hover {
  color: var(--fastr-navy);
  border-bottom-color: var(--fastr-blue);
}

/* ========================================
   TABLES
   ======================================== */
table {
  border-radius: 0.4rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

table th {
  font-weight: 600;
  background-color: var(--fastr-light-blue) !important;
  color: var(--fastr-navy) !important;
  border-bottom: 2px solid var(--fastr-blue);
}

table tr:hover {
  background-color: rgba(202, 230, 233, 0.3);
}

[data-md-color-scheme="slate"] table th {
  background-color: var(--fastr-deep-green) !important;
  color: var(--fastr-light-blue) !important;
}

[data-md-color-scheme="slate"] table tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* ========================================
   CODE BLOCKS
   ======================================== */
.highlight pre {
  border-radius: 0.4rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-left: 4px solid var(--fastr-navy);
}

code {
  background: rgba(202, 230, 233, 0.3);
  color: var(--fastr-navy);
  border-radius: 4px;
}

[data-md-color-scheme="slate"] code {
  background: rgba(9, 84, 79, 0.3);
}

/* ========================================
   BLOCKQUOTES
   ======================================== */
blockquote {
  border-left: 4px solid var(--fastr-gold) !important;
  padding: 0.5em 1em;
  margin-left: 0;
  font-style: italic;
  background-color: rgba(216, 168, 34, 0.1);
  border-radius: 0 0.4rem 0.4rem 0;
}

/* ========================================
   ADMONITIONS (Custom Colors)
   ======================================== */
.admonition {
  border-radius: 0.4rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Note - FASTR Blue */
.admonition.note {
  border-color: var(--fastr-blue);
}
.admonition.note > .admonition-title {
  background-color: rgba(26, 144, 192, 0.1);
}
.admonition.note > .admonition-title::before {
  background-color: var(--fastr-blue);
}

/* Tip - FASTR Lime */
.admonition.tip {
  border-color: var(--fastr-lime);
}
.admonition.tip > .admonition-title {
  background-color: rgba(208, 203, 23, 0.1);
}
.admonition.tip > .admonition-title::before {
  background-color: var(--fastr-lime);
}

/* Warning - FASTR Gold */
.admonition.warning {
  border-color: var(--fastr-gold);
}
.admonition.warning > .admonition-title {
  background-color: rgba(216, 168, 34, 0.1);
}
.admonition.warning > .admonition-title::before {
  background-color: var(--fastr-gold);
}

/* Info - FASTR Green */
.admonition.info {
  border-color: var(--fastr-green);
}
.admonition.info > .admonition-title {
  background-color: rgba(31, 154, 156, 0.1);
}
.admonition.info > .admonition-title::before {
  background-color: var(--fastr-green);
}

/* Example - FASTR Purple */
.admonition.example {
  border-color: var(--fastr-purple);
}
.admonition.example > .admonition-title {
  background-color: rgba(122, 31, 110, 0.1);
}
.admonition.example > .admonition-title::before {
  background-color: var(--fastr-purple);
}

/* Danger/Error - FASTR Coral */
.admonition.danger, .admonition.error {
  border-color: var(--fastr-coral);
}
.admonition.danger > .admonition-title,
.admonition.error > .admonition-title {
  background-color: rgba(255, 100, 98, 0.1);
}
.admonition.danger > .admonition-title::before,
.admonition.error > .admonition-title::before {
  background-color: var(--fastr-coral);
}

/* ========================================
   IMAGES
   ======================================== */
img {
  border-radius: 0.4rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-width: 100%;
  height: auto;
}

[data-md-color-scheme="slate"] img {
  opacity: 0.95;
}

/* ========================================
   NAVIGATION & SIDEBAR
   ======================================== */
.md-nav__link--active {
  color: var(--fastr-green) !important;
  font-weight: 600;
}

.md-tabs {
  background-color: var(--fastr-deep-green);
}

.md-tabs__link,
.md-tabs a {
  color: rgba(255, 255, 255, 0.9) !important;
  border-bottom: none;
}

.md-tabs__link:hover,
.md-tabs__link--active,
.md-tabs a:hover {
  color: #ffffff !important;
}

/* Header styling */
.md-header {
  background-color: var(--fastr-deep-green);
}

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

.md-header a {
  color: #ffffff !important;
  border-bottom: none;
}

.md-header a:hover {
  color: rgba(255, 255, 255, 0.8) !important;
}

.md-header__button {
  color: rgba(255, 255, 255, 0.9) !important;
}

.md-header__button:hover {
  color: #ffffff !important;
}

/* Search input */
.md-search__input {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

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

/* Sidebar navigation */
.md-nav__link {
  color: var(--fastr-navy) !important;
}

.md-nav__link:hover {
  color: var(--fastr-deep-green) !important;
}

[data-md-color-scheme="slate"] .md-nav__link {
  color: rgba(255, 255, 255, 0.8) !important;
}

[data-md-color-scheme="slate"] .md-nav__link:hover,
[data-md-color-scheme="slate"] .md-nav__link--active {
  color: var(--fastr-light-blue) !important;
}

/* ========================================
   FOOTER
   ======================================== */
.md-footer {
  background-color: var(--fastr-deep-green);
}

.md-footer__inner {
  color: rgba(255, 255, 255, 0.9);
}

.md-footer__link {
  color: rgba(255, 255, 255, 0.9) !important;
}

.md-footer__link:hover {
  color: #ffffff !important;
}

.md-copyright {
  color: rgba(255, 255, 255, 0.7);
}

.md-copyright a {
  color: var(--fastr-light-blue) !important;
}

.md-copyright a:hover {
  color: #ffffff !important;
}

/* ========================================
   LANGUAGE SELECTOR
   ======================================== */
/* Language selector dropdown container */
.md-header .md-select__inner,
.md-select__inner {
  background-color: #ffffff !important;
  border: 1px solid var(--fastr-light-blue) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

/* Language selector items - force dark text on white background */
.md-header .md-select__link,
.md-select__link,
.md-select__inner a,
.md-header .md-select__inner a {
  color: var(--fastr-navy) !important;
  background-color: #ffffff !important;
}

/* Hover state */
.md-header .md-select__link:hover,
.md-header .md-select__link:focus,
.md-select__link:hover,
.md-select__link:focus,
.md-select__inner a:hover,
.md-header .md-select__inner a:hover {
  color: #ffffff !important;
  background-color: var(--fastr-deep-green) !important;
}

/* Dark mode language selector */
[data-md-color-scheme="slate"] .md-header .md-select__inner,
[data-md-color-scheme="slate"] .md-select__inner {
  background-color: #2e303e !important;
  border: 1px solid var(--fastr-dark-green) !important;
}

[data-md-color-scheme="slate"] .md-header .md-select__link,
[data-md-color-scheme="slate"] .md-select__link,
[data-md-color-scheme="slate"] .md-select__inner a,
[data-md-color-scheme="slate"] .md-header .md-select__inner a {
  color: #ffffff !important;
  background-color: #2e303e !important;
}

[data-md-color-scheme="slate"] .md-header .md-select__link:hover,
[data-md-color-scheme="slate"] .md-select__link:hover,
[data-md-color-scheme="slate"] .md-select__inner a:hover {
  color: #ffffff !important;
  background-color: var(--fastr-deep-green) !important;
}

/* ========================================
   SEARCH
   ======================================== */
mark {
  background-color: var(--fastr-lime);
  color: var(--fastr-deep-green);
  padding: 0.1em 0.2em;
  border-radius: 0.2rem;
}

/* ========================================
   DEFINITION LISTS
   ======================================== */
dt {
  font-weight: 600;
  color: var(--fastr-navy);
  margin-top: 1em;
}

dd {
  margin-left: 1.5em;
  margin-bottom: 1em;
}

/* ========================================
   HORIZONTAL RULES
   ======================================== */
hr {
  border: none;
  border-top: 2px solid var(--fastr-light-blue);
  margin: 2em 0;
}

/* ========================================
   CONTENT SPACING
   ======================================== */
.md-content__inner {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media screen and (max-width: 76.1875em) {
  .md-content__inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ========================================
   PRINT / SAVE AS PDF
   ======================================== */

/* PDF Download button */
a.pdf-download-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  margin: 0.5rem 0 1.5rem 0;
  padding: 0.5rem 1rem;
  color: var(--fastr-deep-green);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  border: 1.5px solid var(--fastr-deep-green) !important;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  letter-spacing: 0.02em;
}
a.pdf-download-btn:hover {
  background: var(--fastr-deep-green);
  color: #fff;
  border-color: var(--fastr-deep-green) !important;
}
a.pdf-download-btn svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: currentColor;
  flex-shrink: 0;
}
[data-md-color-scheme="slate"] a.pdf-download-btn {
  color: var(--fastr-light-blue);
  border-color: var(--fastr-light-blue) !important;
}
[data-md-color-scheme="slate"] a.pdf-download-btn:hover {
  background: var(--fastr-light-blue);
  color: var(--fastr-deep-green);
}

/* Full guide download button */
a.pdf-download-full-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1.5rem 0.5rem;
  padding: 0.5rem 1rem;
  color: #fff;
  background: var(--fastr-deep-green);
  cursor: pointer;
  transition: background 0.2s;
  border: 1.5px solid var(--fastr-deep-green) !important;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  letter-spacing: 0.02em;
}
a.pdf-download-full-btn:hover {
  background: var(--fastr-dark-green);
  color: #fff;
  border-color: var(--fastr-dark-green) !important;
}
a.pdf-download-full-btn svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: currentColor;
  flex-shrink: 0;
}
[data-md-color-scheme="slate"] a.pdf-download-full-btn {
  background: var(--fastr-green);
  border-color: var(--fastr-green) !important;
  color: #fff;
}
[data-md-color-scheme="slate"] a.pdf-download-full-btn:hover {
  background: var(--fastr-light-blue);
  color: var(--fastr-deep-green);
}

/* Date element: hidden on screen, shown in print */
#pdf-download-date {
  display: none;
}

@media print {
  /* Page setup */
  @page {
    size: A4;
    margin: 20mm 15mm 25mm 15mm;
  }

  /* Hide all UI chrome */
  .md-header, .md-tabs, .md-footer, .md-sidebar,
  .md-top, .md-source, .md-search, .md-dialog,
  .md-banner, .md-consent,
  .headerlink, .pdf-download-btn, .pdf-download-full-btn,
  [data-md-component="header"],
  [data-md-component="tabs"],
  [data-md-component="footer"],
  [data-md-component="sidebar"],
  .md-content__button:not(.pdf-download-btn) {
    display: none !important;
  }

  /* Full-width content */
  .md-content {
    margin: 0 !important;
    max-width: 100% !important;
  }
  .md-main__inner {
    margin: 0 !important;
  }
  .md-content__inner {
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Show download date */
  #pdf-download-date {
    display: block !important;
    font-size: 9pt;
    color: #666;
    margin-bottom: 1.5em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid #ddd;
    font-family: Roboto, sans-serif;
  }

  /* Typography */
  body {
    font-size: 11pt;
    color: #000 !important;
  }
  h1 {
    color: #09544F !important;
    border-bottom: 2px solid #09544F;
  }
  h2 {
    color: #21568C !important;
    border-bottom: 1px solid #21568C;
  }
  h3 {
    color: #7A1F6E !important;
  }

  /* Page breaks */
  h1, h2, h3, h4 {
    break-after: avoid;
  }
  figure, .admonition {
    break-inside: avoid;
  }
  table {
    break-inside: auto;
  }
  table tr {
    break-inside: avoid;
  }

  /* Images */
  img {
    box-shadow: none !important;
    max-width: 100% !important;
  }

  /* Links: show URL after external links */
  a[href^="http"]:not([href*="fastr"])::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
    word-break: break-all;
  }

  /* Tables */
  table {
    box-shadow: none !important;
    border: 1px solid #ccc;
  }
  table th {
    background-color: #f0f0f0 !important;
    color: #000 !important;
  }

  /* Admonitions */
  .admonition {
    box-shadow: none !important;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  /* Code */
  .highlight pre {
    box-shadow: none !important;
    border: 1px solid #ddd;
  }
}
