/* FoundationDB Docs - Minimal Custom Theme
 * Let Material for MkDocs shine through with minimal overrides
 */

/* ==========================================================================
   Custom Color Scheme - Darker Indigo
   ========================================================================== */

:root {
  --md-primary-fg-color: #2c3e7f;
  --md-primary-fg-color--light: #3d5a9e;
  --md-primary-fg-color--dark: #1a237e;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #2c3e7f;
  --md-primary-fg-color--light: #3d5a9e;
  --md-primary-fg-color--dark: #1a237e;
}

/* ==========================================================================
   Version Warning Banner
   ========================================================================== */

.md-banner--warning {
  background-color: #ff9800;
  color: #000;
}

.md-banner--warning a {
  color: #000;
  text-decoration: underline;
}

.md-banner--warning a:hover {
  color: #1a237e;
}

[data-md-color-scheme="slate"] .md-banner--warning {
  background-color: #ff9800;
  color: #000;
}

[data-md-color-scheme="slate"] .md-banner--warning a {
  color: #000;
}

/* Hide version warning and selector on landing page (version-agnostic homepage) */
body:has(.hero-parallax) .md-banner--warning {
  display: none !important;
}

/* Hide version selector on landing page - use multiple selectors for robustness */
body:has(.hero-parallax) .md-version,
body:has(.hero-parallax) .md-header .md-version,
body:has(.hero-parallax) .md-header__topic .md-version {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ==========================================================================
   Logo Sizing
   ========================================================================== */

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 1.2rem;
  width: auto;
}

/* ==========================================================================
   Accessibility - Focus States
   ========================================================================== */

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

/* ==========================================================================
   Accessibility - Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Minor Spacing Tweaks
   ========================================================================== */

/* Slightly larger touch targets for mobile */
@media screen and (max-width: 599px) {
  .md-nav__link,
  .md-tabs__link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* ==========================================================================
   Code Block Improvements
   ========================================================================== */

.md-typeset pre {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Table Responsiveness
   ========================================================================== */

.md-typeset table:not([class]) {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Image Responsiveness
   ========================================================================== */

.md-typeset img,
.md-typeset svg {
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */

@media (prefers-contrast: high) {
  .md-typeset a:not(.md-button) {
    text-decoration: underline;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  .md-button {
    border: 1px solid currentColor !important;
  }
}

/* ==========================================================================
   Hero Section with Graphic
   ========================================================================== */

.hero-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.hero-content {
  flex: 1 1 350px;
  min-width: 280px;
}

.hero-graphic {
  flex: 1 1 300px;
  max-width: 400px;
  min-width: 200px;
}

.hero-graphic svg {
  width: 100%;
  height: auto;
}

/* SVG Animation - respect reduced motion */
.hero-graphic .connection-line {
  stroke-dasharray: 4 2;
  animation: dash 20s linear infinite;
}

.hero-graphic .node {
  animation: pulse 4s ease-in-out infinite;
}

.hero-graphic .node-central {
  animation: pulse 3s ease-in-out infinite;
}

@keyframes dash {
  to {
    stroke-dashoffset: -60;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.85;
  }
}

/* Dark mode adjustments for SVG */
[data-md-color-scheme="slate"] .hero-graphic .labels text {
  fill: #aaa;
}

/* ==========================================================================
   Video Section
   ========================================================================== */

.video-section {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  margin-bottom: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ==========================================================================
   Company Logos Section
   ========================================================================== */

.company-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3rem;
  padding: 2rem 0;
}

.company-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.company-logo img {
  height: 40px;
  width: auto;
  filter: grayscale(100%);
  opacity: 0.7;
  transition: all 0.3s ease;
}

.company-logo img:hover {
  filter: grayscale(0%);
  opacity: 1;
}

/* Dark mode adjustments - invert logos to white */
[data-md-color-scheme="slate"] .company-logo img {
  filter: grayscale(100%) invert(1);
  opacity: 0.7;
}

[data-md-color-scheme="slate"] .company-logo img:hover {
  filter: invert(1);
  opacity: 1;
}

/* VMware logo is taller, shrink it */
.company-logo img[alt="VMware"] {
  height: 30px;
}

/* Adobe logo includes text, adjust height */
.company-logo img[alt="Adobe"] {
  height: 35px;
}



/* ==========================================================================
   Hero Parallax Section (MkDocs Material style)
   ========================================================================== */

/* Animated gradient keyframes */
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-parallax {
  position: relative;
  min-height: 85vh;
  /* Break out of parent container - use viewport width */
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-top: -1.2rem;
  overflow: hidden;
}

/* Make header use primary indigo on landing page */
body:has(.hero-parallax) .md-header {
  position: fixed;
  width: 100%;
  background: var(--md-primary-fg-color) !important;
  box-shadow: none !important;
  z-index: 100;
}

/* Ensure header text/icons are white on landing page */
body:has(.hero-parallax) .md-header .md-header__button,
body:has(.hero-parallax) .md-header .md-search__icon,
body:has(.hero-parallax) .md-header .md-header__title,
body:has(.hero-parallax) .md-header .md-icon {
  color: white !important;
}

/* Ensure site name text is visible (white) on landing page */
body:has(.hero-parallax) .md-header__title .md-header__topic .md-ellipsis,
body:has(.hero-parallax) .md-header__title .md-header__ellipsis,
body:has(.hero-parallax) .md-header__title .md-header__topic {
  color: white !important;
}

/* Add shadow to header when scrolled on landing page */
body:has(.hero-parallax) .md-header--shadow {
  background: var(--md-primary-fg-color) !important;
  box-shadow: 0 0 0.2rem rgba(0, 0, 0, 0.1), 0 0.2rem 0.4rem rgba(0, 0, 0, 0.2) !important;
}

/* Ensure content starts below the fixed header on landing page */
body:has(.hero-parallax) .md-main {
  margin-top: 0;
}

/* Background layer */
.hero-parallax__bg-layer {
  position: absolute;
  inset: 0;
  top: -80px; /* Extend up behind the header */
  background: linear-gradient(
    135deg,
    var(--md-primary-fg-color) 0%,
    #5c6bc0 25%,
    #6a5acd 50%,
    #6a5acd 75%,
    var(--md-accent-fg-color) 100%
  );
  background-size: 400% 400%;
  animation: gradient-shift 15s ease infinite;
  z-index: 1;
}

/* Mid layer - decorative pattern */
.hero-parallax__mid-layer {
  position: absolute;
  inset: 0;
  top: -80px;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(255,255,255,0.12) 2px, transparent 2px),
    radial-gradient(circle at 75% 75%, rgba(255,255,255,0.08) 1.5px, transparent 1.5px),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 80px 80px, 60px 60px, 40px 40px;
  z-index: 2;
}

/* Foreground layer - floating nodes decoration */
.hero-parallax__fg-layer {
  position: absolute;
  inset: 0;
  top: -80px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Ccircle cx='20' cy='30' r='4' fill='rgba(255,255,255,0.15)'/%3E%3Ccircle cx='180' cy='40' r='3' fill='rgba(255,255,255,0.1)'/%3E%3Ccircle cx='60' cy='160' r='3.5' fill='rgba(255,255,255,0.12)'/%3E%3Ccircle cx='140' cy='120' r='2.5' fill='rgba(255,255,255,0.08)'/%3E%3Ccircle cx='100' cy='80' r='2' fill='rgba(255,255,255,0.1)'/%3E%3Cline x1='20' y1='30' x2='60' y2='160' stroke='rgba(255,255,255,0.05)' stroke-width='0.5'/%3E%3Cline x1='180' y1='40' x2='140' y2='120' stroke='rgba(255,255,255,0.05)' stroke-width='0.5'/%3E%3Cline x1='100' y1='80' x2='140' y2='120' stroke='rgba(255,255,255,0.04)' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 300px 300px;
  opacity: 0.7;
  z-index: 3;
}

/* Content layer */
.hero-parallax__content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  padding: 6rem 2rem 8rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Hero text styling */
.hero-text {
  flex: 1 1 400px;
  max-width: 600px;
}

.hero-text h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-text p {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Large button variant */
.md-button--lg {
  padding: 0.8rem 1.6rem;
  font-size: 1rem;
}

/* Hero buttons on gradient */
.hero-parallax .md-button--primary {
  background-color: white;
  color: var(--md-primary-fg-color);
  border-color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hero-parallax .md-button--primary:hover {
  background-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.hero-parallax .md-button:not(.md-button--primary) {
  color: white;
  border-color: rgba(255, 255, 255, 0.6);
}

.hero-parallax .md-button:not(.md-button--primary):hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: white;
  transform: translateY(-2px);
}

/* Hero graphic in parallax */
.hero-parallax .hero-graphic {
  flex: 1 1 300px;
  max-width: 450px;
  min-width: 280px;
}

.hero-parallax .hero-graphic svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.3));
}

.hero-parallax .hero-graphic .labels text {
  fill: rgba(255, 255, 255, 0.9);
}

.hero-parallax .hero-graphic .connections line {
  stroke: rgba(255, 255, 255, 0.5);
}

/* Fade transition at bottom of hero */
.hero-parallax__fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 150px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 30%,
    rgba(255, 255, 255, 0.7) 60%,
    var(--md-default-bg-color) 100%
  );
  z-index: 5;
  pointer-events: none;
}

/* Dark mode hero adjustments */
[data-md-color-scheme="slate"] .hero-parallax__bg-layer {
  background: linear-gradient(
    135deg,
    #1a237e 0%,
    #283593 25%,
    #512da8 50%,
    #7c4dff 75%,
    #651fff 100%
  );
}

[data-md-color-scheme="slate"] .hero-parallax__fade {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(30, 34, 45, 0.3) 30%,
    rgba(30, 34, 45, 0.7) 60%,
    var(--md-default-bg-color) 100%
  );
}

/* Responsive hero */
@media screen and (min-width: 76.25em) {
  .hero-parallax {
    margin-top: -1.2rem;
  }

  .hero-parallax__content {
    padding: 8rem 3rem 10rem 3rem;
  }
}

@media screen and (max-width: 959px) {
  .hero-parallax__content {
    flex-direction: column;
    text-align: center;
    padding: 4rem 1.5rem 6rem 1.5rem;
  }

  .hero-text {
    max-width: 100%;
  }

  .hero-parallax .hero-graphic {
    max-width: 350px;
  }
}

@media screen and (max-width: 599px) {
  .hero-parallax {
    min-height: 70vh;
  }

  .hero-parallax__content {
    padding: 3rem 1rem 5rem 1rem;
    gap: 2rem;
  }

  .hero-text h1 {
    font-size: 1.75rem;
  }

  .hero-text p {
    font-size: 1rem;
  }

  .hero-parallax__fade {
    height: 100px;
  }
}

/* Reduced motion - disable parallax and animations */
@media (prefers-reduced-motion: reduce) {
  .hero-parallax__bg-layer {
    animation: none;
    background-position: 0% 50%;
    transform: none;
    inset: 0;
  }

  .hero-parallax__mid-layer {
    transform: none;
    inset: 0;
  }

  .hero-parallax .md-button:hover {
    transform: none;
  }
}


/* ==========================================================================
   Landing Page Sections
   ========================================================================== */

.landing-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1rem;
}

.landing-section h2 {
  text-align: center;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin-bottom: 1rem;
  color: var(--md-default-fg-color);
}

.section-intro {
  text-align: center;
  font-size: 1.1rem;
  color: var(--md-default-fg-color--light);
  max-width: 700px;
  margin: 0 auto 2rem auto;
}

/* Features section - 6 cards grid */
.landing-section--features {
  padding-top: 2rem;
}

.landing-section--features .grid.cards {
  margin-top: 2rem;
}

/* Enhanced card hover effects */
.landing-section .grid.cards > ul > li {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.landing-section .grid.cards > ul > li:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

[data-md-color-scheme="slate"] .landing-section .grid.cards > ul > li:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Feature Highlights (Side-by-side sections)
   ========================================================================== */

.landing-section--highlights {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(63, 81, 181, 0.03) 20%,
    rgba(63, 81, 181, 0.03) 80%,
    transparent 100%
  );
}

[data-md-color-scheme="slate"] .landing-section--highlights {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(124, 77, 255, 0.05) 20%,
    rgba(124, 77, 255, 0.05) 80%,
    transparent 100%
  );
}

.feature-highlight {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3rem;
  margin: 4rem 0;
  padding: 2rem;
  background: var(--md-default-bg-color);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}

.feature-highlight:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-md-color-scheme="slate"] .feature-highlight {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

[data-md-color-scheme="slate"] .feature-highlight:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.feature-highlight__content {
  flex: 1 1 350px;
}

.feature-highlight__content h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--md-primary-fg-color);
}

.feature-highlight__content p {
  line-height: 1.7;
  color: var(--md-default-fg-color--light);
}

.feature-highlight__content a {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 500;
}

.feature-highlight__visual {
  flex: 1 1 300px;
  min-width: 280px;
}

.feature-highlight__visual pre {
  margin: 0;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  padding: 1.5rem;
}

[data-md-color-scheme="slate"] .feature-highlight__visual pre {
  background: rgba(255, 255, 255, 0.03);
}

/* Alternating layout */
.feature-highlight--reverse {
  flex-direction: row-reverse;
}

/* Responsive feature highlights */
@media screen and (max-width: 959px) {
  .feature-highlight {
    flex-direction: column;
    text-align: center;
  }

  .feature-highlight--reverse {
    flex-direction: column;
  }

  .feature-highlight__content {
    max-width: 100%;
  }

  .feature-highlight__visual {
    max-width: 100%;
  }
}

/* ==========================================================================
   Trusted Section
   ========================================================================== */

.landing-section--trusted {
  text-align: center;
}

.landing-section--trusted .company-logos {
  justify-content: center;
  max-width: 800px;
  margin: 2rem auto;
}

/* ==========================================================================
   Video Section
   ========================================================================== */

.landing-section--video {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(63, 81, 181, 0.02) 50%,
    transparent 100%
  );
}

.landing-section--video .video-section {
  max-width: 900px;
}

/* ==========================================================================
   Community Section
   ========================================================================== */

.landing-section--community {
  padding-bottom: 2rem;
}

.landing-section--community .grid.cards {
  max-width: 1000px;
  margin: 2rem auto 0 auto;
}

/* ==========================================================================
   Landing Page Footer
   ========================================================================== */

.landing-footer {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--md-default-fg-color--light);
  font-size: 0.9rem;
}

[data-md-color-scheme="slate"] .landing-footer {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.landing-footer .heart-icon {
  color: #e91e63;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.15);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.15);
  }
  56% {
    transform: scale(1);
  }
}

/* Reduced motion - disable heartbeat */
@media (prefers-reduced-motion: reduce) {
  .landing-footer .heart-icon {
    animation: none;
  }
}

/* ==========================================================================
   Remove default horizontal rules on landing page
   ========================================================================== */

/* Landing page doesn't need the default hr styling */
.md-content__inner > hr {
  display: none;
}

/* Ensure proper spacing in landing sections */
.landing-section + .landing-section {
  margin-top: 0;
}

/* Dark mode header background on landing page - keep indigo in dark mode too */
[data-md-color-scheme="slate"] body:has(.hero-parallax) .md-header,
body:has(.hero-parallax)[data-md-color-scheme="slate"] .md-header {
  background: var(--md-primary-fg-color) !important;
}

/* Also style the tabs bar on landing page with indigo */
body:has(.hero-parallax) .md-tabs {
  background: var(--md-primary-fg-color) !important;
  z-index: 99;
}

/* Ensure tab links are white on landing page */
body:has(.hero-parallax) .md-tabs__link {
  color: rgba(255, 255, 255, 0.7) !important;
}

body:has(.hero-parallax) .md-tabs__link--active,
body:has(.hero-parallax) .md-tabs__link:hover {
  color: white !important;
}

[data-md-color-scheme="slate"] body:has(.hero-parallax) .md-tabs,
body:has(.hero-parallax)[data-md-color-scheme="slate"] .md-tabs {
  background: var(--md-primary-fg-color) !important;
}

/* Ensure ALL header elements have indigo background on landing page */
body:has(.hero-parallax) .md-header,
body:has(.hero-parallax) .md-header__inner,
body:has(.hero-parallax) .md-header__title {
  background: var(--md-primary-fg-color) !important;
}

/* Dark mode - all header elements keep indigo */
[data-md-color-scheme="slate"] body:has(.hero-parallax) .md-header,
[data-md-color-scheme="slate"] body:has(.hero-parallax) .md-header__inner,
[data-md-color-scheme="slate"] body:has(.hero-parallax) .md-header__title,
[data-md-color-scheme="slate"] body:has(.hero-parallax) .md-tabs {
  background: var(--md-primary-fg-color) !important;
}

/* Ensure sidebar renders above hero section on landing page (tablet view fix) */
body:has(.hero-parallax) .md-sidebar--primary {
  z-index: 50;
}

/* ==========================================================================
   Version Pills - Highlight version-specific features
   ========================================================================== */

/* Base pill styles - smaller and more compact */
.md-typeset .pill-new,
.md-typeset .pill-improved,
.md-typeset .pill-experimental {
  display: inline-block;
  padding: 0.1em 0.4em;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: bold;
  vertical-align: middle;
  line-height: 1.4;
}

.md-typeset .pill-new {
  background-color: #4caf50;
  color: white;
}

.md-typeset .pill-improved {
  background-color: #2196f3;
  color: white;
}

.md-typeset .pill-experimental {
  background-color: #ff9800;
  color: white;
}

/* Even smaller pills in page titles (h1) */
.md-typeset h1 .pill-new,
.md-typeset h1 .pill-improved,
.md-typeset h1 .pill-experimental {
  font-size: 0.5rem;
  padding: 0.05em 0.3em;
  vertical-align: middle;
  margin-left: 0.5em;
}

/* ==========================================================================
   Mermaid Fullscreen Viewer

   NOTE: Material for MkDocs renders Mermaid SVGs inside CLOSED shadow DOMs.
   The expand button must be on a wrapper element, not on the .mermaid element.
   ========================================================================== */

/* Wrapper around each mermaid diagram */
.mermaid-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

/* Expand button on mermaid wrapper (NOT on .mermaid - shadow DOM prevents children) */
.mermaid-expand-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  padding: 6px;
  border: none;
  border-radius: 4px;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color--light);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s, transform 0.2s;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mermaid-expand-btn:hover {
  opacity: 1;
  background: var(--md-primary-fg-color);
  color: white;
  transform: scale(1.05);
}

.mermaid-expand-btn:focus-visible {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 2px;
  opacity: 1;
}

.mermaid-expand-btn svg {
  width: 18px;
  height: 18px;
}

/* Dark mode adjustments for expand button */
[data-md-color-scheme="slate"] .mermaid-expand-btn {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Mobile: slightly smaller button */
@media screen and (max-width: 599px) {
  .mermaid-expand-btn {
    width: 28px;
    height: 28px;
    padding: 5px;
    top: 4px;
    right: 4px;
  }

  .mermaid-expand-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* Fullscreen overlay */
.mermaid-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 0.2s, opacity 0.2s;
}

.mermaid-fullscreen-overlay.active {
  visibility: visible;
  opacity: 1;
  transition: visibility 0s, opacity 0.2s;
}

/* Semi-transparent backdrop */
.mermaid-fullscreen-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

[data-md-color-scheme="slate"] .mermaid-fullscreen-backdrop {
  background: rgba(0, 0, 0, 0.9);
}

/* Content container */
.mermaid-fullscreen-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90vw;
  height: 90vh;
  z-index: 1;
}

/* Toolbar */
.mermaid-fullscreen-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-md-color-scheme="slate"] .mermaid-fullscreen-toolbar {
  background: rgba(40, 44, 52, 0.95);
}

/* Zoom buttons */
.mermaid-zoom-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  background: var(--md-primary-fg-color);
  color: white;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mermaid-zoom-btn:hover {
  background: var(--md-primary-fg-color--dark);
  transform: scale(1.05);
}

.mermaid-zoom-btn:active {
  transform: scale(0.95);
}

.mermaid-zoom-btn:focus-visible {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 2px;
}

/* Zoom indicator */
.mermaid-zoom-indicator {
  min-width: 50px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--md-default-fg-color);
  padding: 0 8px;
}

/* Close button */
.mermaid-close-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  background: #e53935;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mermaid-close-btn:hover {
  background: #c62828;
  transform: scale(1.05);
}

.mermaid-close-btn:active {
  transform: scale(0.95);
}

.mermaid-close-btn:focus-visible {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 2px;
}

/* Diagram container in fullscreen overlay */
.mermaid-fullscreen-diagram-container {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: white;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-md-color-scheme="slate"] .mermaid-fullscreen-diagram-container {
  background: #1e222a;
}

/* Style for mermaid element when in fullscreen mode */
.mermaid-in-fullscreen {
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: transform 0.05s ease-out;
  user-select: none;
  -webkit-user-drag: none;
}

/* Prevent text selection during drag */
.mermaid-fullscreen-overlay.active {
  user-select: none;
}

/* Reduced motion - disable transitions */
@media (prefers-reduced-motion: reduce) {
  .mermaid-fullscreen-overlay {
    transition: none;
  }

  .mermaid-in-fullscreen {
    transition: none;
  }

  .mermaid-expand-btn,
  .mermaid-zoom-btn,
  .mermaid-close-btn {
    transition: none;
  }
}
