/* =============================================================================
 * Self-hosted fonts (resilience: no external CDN dependency)
 * ============================================================================= */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../assets/fonts/roboto-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../assets/fonts/roboto-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/roboto-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/roboto-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* =============================================================================
 * GitPulse - Custom Documentation Styles
 * ============================================================================= */

/* -----------------------------------------------------------------------------
 * Root Variables
 * ----------------------------------------------------------------------------- */
:root {
  /* Primary colors */
  --md-primary-fg-color: #3f51b5;
  --md-primary-fg-color--light: #5c6bc0;
  --md-primary-fg-color--dark: #303f9f;
  
  /* Accent colors */
  --md-accent-fg-color: #7c4dff;
  --md-accent-fg-color--transparent: rgba(124, 77, 255, 0.1);
  
  /* Custom colors */
  --gp-success: #4caf50;
  --gp-warning: #ff9800;
  --gp-error: #f44336;
  --gp-info: #2196f3;
  
  /* Font customization */
  --md-text-font: "Roboto", system-ui, -apple-system, sans-serif;
  --md-code-font: "Roboto Mono", "JetBrains Mono", "Fira Code", monospace;
}

/* Dark mode overrides */
[data-md-color-scheme="slate"] {
  --md-default-bg-color: #1a1a2e;
  --md-default-fg-color--light: #b0b0b0;
}

/* -----------------------------------------------------------------------------
 * Typography
 * ----------------------------------------------------------------------------- */
.md-typeset h1 {
  font-weight: 700;
  margin-bottom: 1em;
  color: var(--md-primary-fg-color);
}

.md-typeset h2 {
  font-weight: 600;
  border-bottom: 2px solid var(--md-primary-fg-color--light);
  padding-bottom: 0.3em;
  margin-top: 2em;
}

.md-typeset h3 {
  font-weight: 500;
  color: var(--md-default-fg-color--light);
}

/* Code blocks */
.md-typeset code {
  font-size: 0.85em;
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

.md-typeset pre > code {
  font-size: 0.8em;
  line-height: 1.6;
}

/* -----------------------------------------------------------------------------
 * Navigation
 * ----------------------------------------------------------------------------- */
.md-nav__title {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
}

.md-nav__link {
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.md-nav__link:hover {
  color: var(--md-accent-fg-color);
  padding-left: 0.5rem;
}

.md-nav__link--active {
  font-weight: 600;
  border-left: 3px solid var(--md-accent-fg-color);
  padding-left: 0.5rem;
}

/* Tab navigation */
.md-tabs__link {
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0;
  padding: 0 0.8em;
}

/* -----------------------------------------------------------------------------
 * Admonitions (Callouts)
 * ----------------------------------------------------------------------------- */
.md-typeset .admonition {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.md-typeset .admonition-title {
  font-weight: 600;
}

/* Custom admonition: Best Practice */
.md-typeset .admonition.best-practice,
.md-typeset details.best-practice {
  border-color: var(--gp-success);
}

.md-typeset .best-practice > .admonition-title,
.md-typeset .best-practice > summary {
  background-color: rgba(76, 175, 80, 0.1);
}

.md-typeset .best-practice > .admonition-title::before,
.md-typeset .best-practice > summary::before {
  background-color: var(--gp-success);
  mask-image: var(--md-admonition-icon--tip);
}

/* Custom admonition: Prerequisites */
.md-typeset .admonition.prerequisites,
.md-typeset details.prerequisites {
  border-color: var(--gp-info);
}

.md-typeset .prerequisites > .admonition-title,
.md-typeset .prerequisites > summary {
  background-color: rgba(33, 150, 243, 0.1);
}

/* -----------------------------------------------------------------------------
 * Tables
 * ----------------------------------------------------------------------------- */
.md-typeset table:not([class]) {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.md-typeset table:not([class]) thead {
  background: linear-gradient(135deg, var(--md-primary-fg-color), var(--md-primary-fg-color--dark));
  color: white;
}

.md-typeset table:not([class]) th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.md-typeset table:not([class]) tbody tr:nth-child(even) {
  background-color: var(--md-default-bg-color--light);
}

.md-typeset table:not([class]) tbody tr:hover {
  background-color: var(--md-accent-fg-color--transparent);
}

/* -----------------------------------------------------------------------------
 * Mermaid Diagrams
 * ----------------------------------------------------------------------------- */
.mermaid {
  text-align: center;
  margin: 2em 0;
  padding: 1em;
  background-color: var(--md-code-bg-color);
  border-radius: 8px;
}

/* Sequence diagram customization */
.mermaid .messageText {
  font-size: 12px !important;
}

/* -----------------------------------------------------------------------------
 * Cards and Grids
 * ----------------------------------------------------------------------------- */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.grid-card {
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grid-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.grid-card h3 {
  margin-top: 0;
  color: var(--md-primary-fg-color);
}

.grid-card .icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* -----------------------------------------------------------------------------
 * Status Badges
 * ----------------------------------------------------------------------------- */
.status-badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge--new {
  background-color: var(--gp-success);
  color: white;
}

.status-badge--beta {
  background-color: var(--gp-warning);
  color: white;
}

.status-badge--deprecated {
  background-color: var(--gp-error);
  color: white;
}

/* -----------------------------------------------------------------------------
 * API Reference
 * ----------------------------------------------------------------------------- */
.api-method {
  display: inline-block;
  padding: 0.2em 0.5em;
  border-radius: 4px;
  font-family: var(--md-code-font);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.api-method--get {
  background-color: #61affe;
  color: white;
}

.api-method--post {
  background-color: #49cc90;
  color: white;
}

.api-method--put {
  background-color: #fca130;
  color: white;
}

.api-method--delete {
  background-color: #f93e3e;
  color: white;
}

/* -----------------------------------------------------------------------------
 * Footer
 * ----------------------------------------------------------------------------- */
/* Material theme footer: light in light mode (needs !important to beat theme) */
.md-footer {
  background-color: #f5f5f5 !important;
  color: #546e7a !important;
}
.md-footer-meta {
  background-color: transparent !important;
  color: #546e7a !important;
}
.md-footer-meta .md-copyright,
.md-footer-meta .md-copyright__highlight {
  color: #546e7a !important;
}
.md-footer-meta a,
.md-footer-meta .md-copyright a {
  color: #3f51b5 !important;
}
.md-footer-meta .md-social__link svg {
  fill: #546e7a;
}
.md-footer__link {
  color: #3f51b5 !important;
}
.md-footer__title {
  color: #37474f !important;
}
.md-footer__direction {
  color: #78909c !important;
}
[data-md-color-scheme="slate"] .md-footer {
  background-color: rgba(0, 0, 0, 0.87) !important;
  color: rgba(255, 255, 255, 0.7) !important;
}
[data-md-color-scheme="slate"] .md-footer-meta {
  background-color: rgba(0, 0, 0, 0.32) !important;
  color: rgba(255, 255, 255, 0.7) !important;
}
[data-md-color-scheme="slate"] .md-footer-meta .md-copyright,
[data-md-color-scheme="slate"] .md-footer-meta .md-copyright__highlight {
  color: rgba(255, 255, 255, 0.7) !important;
}
[data-md-color-scheme="slate"] .md-footer-meta a,
[data-md-color-scheme="slate"] .md-footer-meta .md-copyright a {
  color: rgba(255, 255, 255, 0.7) !important;
}
[data-md-color-scheme="slate"] .md-footer-meta .md-social__link svg {
  fill: currentColor;
}
[data-md-color-scheme="slate"] .md-footer__link {
  color: inherit !important;
}
[data-md-color-scheme="slate"] .md-footer__title {
  color: inherit !important;
}
[data-md-color-scheme="slate"] .md-footer__direction {
  color: inherit !important;
}

/* Custom footer line */
.md-footer-custom {
  padding: 1rem 0;
  text-align: center;
  background-color: #f5f5f5;
  border-top: 1px solid #e0e0e0;
}

.md-footer-custom p {
  margin: 0;
  font-size: 0.8rem;
  color: #546e7a;
}

.md-footer-custom a {
  color: #3f51b5;
}

[data-md-color-scheme="slate"] .md-footer-custom {
  background-color: #21222c;
  border-top-color: rgba(255, 255, 255, 0.07);
}

[data-md-color-scheme="slate"] .md-footer-custom p {
  color: rgba(255, 255, 255, 0.7);
}

[data-md-color-scheme="slate"] .md-footer-custom a {
  color: #7c4dff;
}

/* -----------------------------------------------------------------------------
 * Print Styles
 * ----------------------------------------------------------------------------- */
@media print {
  .md-header,
  .md-tabs,
  .md-sidebar,
  .md-footer {
    display: none !important;
  }
  
  .md-content {
    margin: 0 !important;
    max-width: 100% !important;
  }
  
  .md-typeset h1 {
    page-break-before: always;
  }
  
  .md-typeset pre {
    white-space: pre-wrap;
    word-break: break-all;
  }
}

/* -----------------------------------------------------------------------------
 * Mobile Responsive
 * ----------------------------------------------------------------------------- */
@media screen and (max-width: 76.1875em) {
  .md-nav__title {
    font-size: 0.9rem;
  }
  
  .grid-cards {
    grid-template-columns: 1fr;
  }
}

/* -----------------------------------------------------------------------------
 * Animations
 * ----------------------------------------------------------------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.md-content {
  animation: fadeIn 0.3s ease-out;
}

/* Code block copy button */
.md-clipboard {
  transition: color 0.2s ease;
}

.md-clipboard:hover {
  color: var(--md-accent-fg-color);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 2px;
}

/* =============================================================================
 * Mermaid Dark Mode Fixes
 * ============================================================================= */

/* Better visibility for Mermaid diagrams in dark mode */
[data-md-color-scheme="slate"] .mermaid {
  /* Light background for better contrast */
  background-color: #1e1e2e !important;
  border-radius: 8px;
  padding: 1.5rem;
}

/* Gantt chart specific fixes for dark mode */
[data-md-color-scheme="slate"] .mermaid .task {
  stroke: #fff !important;
  stroke-width: 1px;
}

[data-md-color-scheme="slate"] .mermaid .taskText {
  fill: #fff !important;
  font-weight: 500;
}

[data-md-color-scheme="slate"] .mermaid .taskTextOutsideRight,
[data-md-color-scheme="slate"] .mermaid .taskTextOutsideLeft {
  fill: #e0e0e0 !important;
}

/* GANTT TITLE - main fix for visibility */
[data-md-color-scheme="slate"] .mermaid text.titleText,
[data-md-color-scheme="slate"] .mermaid .titleText {
  fill: #ffffff !important;
  font-size: 18px !important;
  font-weight: 700 !important;
}

/* Also target SVG title text directly */
[data-md-color-scheme="slate"] .mermaid svg text[class*="title"],
[data-md-color-scheme="slate"] .mermaid svg > text:first-of-type {
  fill: #ffffff !important;
  font-weight: 700 !important;
}

[data-md-color-scheme="slate"] .mermaid .sectionTitle {
  fill: #a0a0ff !important;
  font-weight: 600 !important;
  font-size: 14px !important;
}

[data-md-color-scheme="slate"] .mermaid .grid .tick line {
  stroke: rgba(255, 255, 255, 0.15) !important;
}

[data-md-color-scheme="slate"] .mermaid .grid .tick text {
  fill: #c0c0c0 !important;
}

[data-md-color-scheme="slate"] .mermaid .todayMarker {
  stroke: #ff6b6b !important;
  stroke-width: 2px;
}

/* Section backgrounds in gantt */
[data-md-color-scheme="slate"] .mermaid .section0 {
  fill: rgba(100, 100, 180, 0.15) !important;
}

[data-md-color-scheme="slate"] .mermaid .section1 {
  fill: rgba(100, 180, 100, 0.15) !important;
}

[data-md-color-scheme="slate"] .mermaid .section2 {
  fill: rgba(180, 150, 100, 0.15) !important;
}

/* Axis styling */
[data-md-color-scheme="slate"] .mermaid .domain {
  stroke: rgba(255, 255, 255, 0.3) !important;
}

/* All text in mermaid should be visible in dark mode */
[data-md-color-scheme="slate"] .mermaid text {
  fill: #e0e0e0 !important;
}

/* Light mode mermaid improvements */
.mermaid {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem 0;
}

/* =============================================================================
 * Timeline Table Styling
 * ============================================================================= */
.timeline-table table {
  margin: 1.5rem 0;
}

.timeline-table .phase-prep {
  color: #7c4dff;
}

.timeline-table .phase-deploy {
  color: #00bcd4;
}

.timeline-table .phase-eval {
  color: #4caf50;
}

/* Mermaid Timeline diagram styling for dark mode */
[data-md-color-scheme="slate"] .mermaid .timeline-section {
  fill: rgba(255, 255, 255, 0.1) !important;
}

[data-md-color-scheme="slate"] .mermaid .timeline-label {
  fill: #ffffff !important;
  font-weight: 600 !important;
}
