.align-left { float: left; margin-right: 1rem; }
.align-right { float: right; margin-left: 1rem; }

.clearfix { clear: both; display: table; content: ""; }

/* Hide the site title row ("Plotly Documentation") in the sidebar nav. */
.md-nav--primary > .md-nav__title {
  display: none;
}

/* Hide the back-arrow icon Material renders next to the logo in the sidebar's title row. */
.md-nav--primary .md-nav__title .md-nav__icon {
  display: none;
}

.screenshot {
  border-radius: 8px;
  box-shadow: 4px 4px 4px #0000003b;
}

/* Plotly Custom Colors */

/* Define the custom primary color scheme */
[data-md-color-primary="custom"] {
    --md-primary-fg-color: #6E56CF;
    --md-primary-fg-color--light: #8B72D9;
    --md-primary-fg-color--dark: #5A47B8;
    --md-primary-bg-color: #FFFFFF;
    --md-primary-bg-color--light: #F8F7FD;
  }
  
  /* Define the custom accent color scheme */
  [data-md-color-accent="custom"] {
    --md-accent-fg-color: #6E56CF;
    --md-accent-fg-color--transparent: rgba(110, 86, 207, 0.1);
    --md-accent-bg-color: #FFFFFF;
    --md-accent-bg-color--light: #F8F7FD;
  }
  
  /* Additional custom properties for consistency */
  :root {
    --md-primary-fg-color: #6E56CF; /* changes color of header */
    --plotly-primary: #6E56CF;
    --plotly-primary-light: #8B72D9;
    --plotly-primary-dark: #5A47B8;
  }
  
  
  /* All content headings - consistent weight and tighter spacing - responsive to theme */
  h1, h2, h3, h4, h5, h6 {
    color: #202020 !important;
    font-weight: 500 !important;
    margin-bottom: 0.5rem !important;
  }
  
  [data-md-color-scheme="slate"] h1, 
  [data-md-color-scheme="slate"] h2, 
  [data-md-color-scheme="slate"] h3, 
  [data-md-color-scheme="slate"] h4, 
  [data-md-color-scheme="slate"] h5, 
  [data-md-color-scheme="slate"] h6 {
    color: #e0e0e0 !important;
  }
  
  
  /* Content link colors - light mode (exclude navigation) */
  .md-content a {
    color: var(--plotly-primary-dark) !important;
  }
  
  .md-content a:hover {
    color: var(--plotly-primary) !important;
  }
  
  /* Content link colors - dark mode (exclude navigation) */
  [data-md-color-scheme="slate"] .md-content a {
    color: #B39BEF !important;
  }
  
  [data-md-color-scheme="slate"] .md-content a:hover {
    color: var(--plotly-primary-light) !important;
  }
  
  /* Navigation link styling with Plotly colors */
  .md-nav__link {
    color: inherit !important;
  }
  
  /* Navigation hover effects */
  .md-nav__link:hover {
    color: var(--plotly-primary) !important;
  }
  
  [data-md-color-scheme="slate"] .md-nav__link:hover {
    color: var(--plotly-primary-light) !important;
  }
  
  /* Active/current page highlighting - exclude section headers */
  .md-nav__link[data-md-state="blur"]:not(.md-nav__item--section > .md-nav__link), 
  .md-nav__item--active > .md-nav__link:not(.md-nav__item--section > .md-nav__link) {
    color: var(--plotly-primary) !important;
  }
  
  [data-md-color-scheme="slate"] .md-nav__link[data-md-state="blur"]:not(.md-nav__item--section > .md-nav__link),
  [data-md-color-scheme="slate"] .md-nav__item--active > .md-nav__link:not(.md-nav__item--section > .md-nav__link) {
    color: var(--plotly-primary-light) !important;
  }
  
  /* External link icons - UX best practice */
  a[href^="http"]:not([href*="127.0.0.1"]):not([href*="localhost"])::after {
    content: "↗";
    font-size: 0.8em;
    margin-left: 0.3em;
    color: var(--plotly-primary);
    opacity: 0.7;
  }

  .md-header a[href^="http"]:not([href*="127.0.0.1"]):not([href*="localhost"])::after {
    content: none;
  }
  
  /* Header bar gradient - light mode */
  .md-header {
    background: linear-gradient(45deg, #3D2B7A 0%, var(--plotly-primary-light) 100%) !important;
  }
  
  /* Header bar gradient - dark mode */
  [data-md-color-scheme="slate"] .md-header {
    background: linear-gradient(45deg, #15141B 0%, var(--plotly-primary-dark) 100%) !important;
  }
  
  /* Dark mode toggle spacing and styling */
  .md-header__option {
    margin-right: 0.5rem !important;
  }
  
  /* Make toggle icon moderately visible - light grey */
  .md-header__button.md-icon {
    color: #d0d0d0 !important;
    opacity: 0.9 !important;
  }
  
  .md-header__button.md-icon:hover {
    color: white !important;
    opacity: 1 !important;
  }

  /* Chart grid styling */
  .chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
  }

  /* Mobile responsive: 1 column on small screens, 2 on medium */
  @media (max-width: 599px) {
    .chart-grid {
      grid-template-columns: 1fr;
    }
  }

  @media (min-width: 600px) and (max-width: 959px) {
    .chart-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  .chart-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: box-shadow 0.2s;
  }

  .chart-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .chart-card img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 0.5rem auto;
  }

  .chart-card a {
    text-decoration: none;
    color: inherit;
  }

  .chart-card p {
    margin: 0;
  }

  [data-md-color-scheme="slate"] .chart-card {
    border-color: #404040;
  }

  /* Grid card image sizing for consistent display */
  .md-typeset .grid.cards > ul > li > p:first-child img,
  .md-typeset .grid.cards > ul > li > :first-child img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 1rem;
  }

  /* Make homepage tile icons smaller without affecting other card grids. */
  .md-typeset .grid.cards.home-product-tiles .lg {
    font-size: 1.05em !important;
    line-height: 1;
  }

  .md-typeset .grid.cards.home-product-tiles > ul > li > p:first-child {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    line-height: 1.2;
  }

  .md-typeset .grid.cards.home-product-tiles .twemoji,
  .md-typeset .grid.cards.home-product-tiles .emoji {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
  }

  .md-typeset .grid.cards.home-product-tiles .twemoji svg,
  .md-typeset .grid.cards.home-product-tiles .emoji svg {
    width: 1em;
    height: 1em;
    vertical-align: middle;
    transform: translateY(0.06em);
  }

  /* Make entire grid card clickable */
  .md-typeset .grid.cards > ul > li {
    position: relative;
    cursor: pointer;
  }

  /* Create clickable overlay from first link */
  .md-typeset .grid.cards > ul > li a:first-of-type::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }

  /* Card hover effect */
  .md-typeset .grid.cards > ul > li:hover {
    box-shadow: 0 4px 12px rgba(110, 86, 207, 0.15) !important;
    transform: translateY(-2px);
    transition: all 0.2s ease;
  }

    /* Fat footer columns for Resources, Enterprise, and Open Source. */
    [data-md-color-scheme="default"] {
      --md-footer-bg-color: #f8f6fc;
      --md-footer-fg-color: #4a4560;
      --plotly-footer-border: rgba(110, 86, 207, 0.1);
      --plotly-footer-bg-start: #f6f4fb;
      --plotly-footer-bg-end: #efebf8;
      --plotly-footer-heading: #5b5476;
      --plotly-footer-link: #4a4560;
      --plotly-footer-link-hover: #3f3677;
    }

    [data-md-color-scheme="slate"] {
      --md-footer-bg-color: #0f0e19;
      --md-footer-fg-color: #c9c2ea;
      --plotly-footer-border: rgba(139, 114, 217, 0.3);
      --plotly-footer-bg-start: #141320;
      --plotly-footer-bg-end: #0f0e19;
      --plotly-footer-heading: #f2f1f8;
      --plotly-footer-link: #c9c2ea;
      --plotly-footer-link-hover: #e6e1fb;
    }

    .plotly-fat-footer {
      margin-top: 2rem;
      border-top: 1px solid var(--plotly-footer-border);
    }

    .plotly-fat-footer .md-footer-meta {
      background: linear-gradient(180deg, var(--plotly-footer-bg-start) 0%, var(--plotly-footer-bg-end) 100%);
    }

    .plotly-fat-footer .md-footer-meta__inner {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      padding-top: 1.25rem;
      padding-bottom: 1.25rem;
      min-height: 100%;
    }

    .plotly-fat-footer__grid {
      display: grid;
      grid-template-columns: repeat(3, max-content);
      column-gap: 3rem;
      row-gap: 0.75rem;
      justify-content: flex-start;
      margin-bottom: auto;
    }

    .plotly-fat-footer__column {
      min-width: 0;
    }

    .plotly-fat-footer__heading {
      margin: 0 0 0.5rem 0;
      color: var(--plotly-footer-heading) !important;
      font-size: 0.72rem !important;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      font-weight: 600 !important;
    }

    .plotly-fat-footer__list {
      margin: 0;
      padding: 0;
      list-style: none;
      padding-inline-start: 0 !important;
      margin-inline-start: 0 !important;
    }

    .plotly-fat-footer .md-typeset ul.plotly-fat-footer__list {
      padding-left: 0 !important;
      margin-left: 0 !important;
    }

    .plotly-fat-footer .md-typeset ul.plotly-fat-footer__list > li {
      padding-left: 0 !important;
      margin-left: 0 !important;
    }

    .plotly-fat-footer__list li {
      list-style: none;
      margin: 0;
      padding: 0;
      padding-inline-start: 0;
      margin-inline-start: 0;
      line-height: 1.45;
    }

    .plotly-fat-footer__list li + li {
      margin-top: 0.2rem;
    }

    .plotly-fat-footer__list a {
      color: var(--plotly-footer-link) !important;
      font-size: 0.7rem;
      line-height: 1.4;
      text-decoration: none;
    }

    .plotly-fat-footer__list a:hover {
      color: var(--plotly-footer-link-hover) !important;
      text-decoration: underline;
      text-underline-offset: 2px;
    }

    .plotly-fat-footer__bottom {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      justify-content: flex-end;
      gap: 0.15rem;
      margin-top: auto;
      font-size: 0.7rem;
      line-height: 1.4;
      color: var(--plotly-footer-link) !important;
    }

    .plotly-fat-footer__bottom > div {
      display: block;
      text-align: left;
    }

    .plotly-fat-footer__bottom a,
    .md-footer-made-with,
    .md-footer-copyright {
      font-size: 0.7rem;
      line-height: 1.4;
      color: var(--plotly-footer-link) !important;
    }

    @media (max-width: 959px) {
      .plotly-fat-footer__grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
      }
    }
