/* 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;
  }
  
  /* 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 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;
  }
