/* Custom styles for Altimate DataMates docs */

.md-header {
  padding-top: 16px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
}

/* Spark animation element */
.header-spark {
  position: absolute;
  left: -300px; /* Start off-screen - increased to match new width */
  width: 300px; /* Increased from 100px to 300px */
  height: 2px;
  background: linear-gradient(90deg, 
    rgba(255,255,255,0) 0%, 
    rgba(255,255,255,0.3) 20%, 
    rgba(255,255,255,1) 50%, 
    rgba(255,255,255,0.3) 80%, 
    rgba(255,255,255,0) 100%);
  box-shadow: 0 0 10px 2px rgba(255,255,255,0.7);
  z-index: 10;
  pointer-events: none;
  transform: translateZ(0); /* Force hardware acceleration */
}

/* Position for bottom spark */
.bottom-spark {
  bottom: 0;
}

/* Position for top spark */
.top-spark {
  top: 0;
}

@keyframes sparkle {
  0% {
    left: -300px; /* Updated to match new width */
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    left: calc(100% + 300px); /* Updated to match new width */
    opacity: 0;
  }
}

/* Adjust logo position with the added padding */
.md-header__inner {
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}

/* Override MkDocs Material default header title behavior */
.md-header__title {
  height: auto !important;
}

/* Force the header title to display as a single line */
.md-header__title {
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
  width: auto !important;
  white-space: nowrap !important;
  overflow: visible !important;
}

/* Reset the default animation and positioning */
.md-header__title[data-md-component="header-title"] {
  height: auto !important;
}

/* Force topics to display inline */
.md-header__title .md-header__topic {
  position: relative !important;
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  display: inline !important;
  width: auto !important;
  height: auto !important;
  float: none !important;
  vertical-align: baseline !important;
}

/* Style for the site name that's always visible */
.md-header__title .md-header__topic:first-child {
  font-weight: 600;
  white-space: nowrap; /* Prevent wrapping */
  position: static !important;
}

/* Add separator between site name and section title */
.md-header--shadow .md-header__title .md-header__topic:first-child::after,
.md-header--scrolled .md-header__title .md-header__topic:first-child::after {
  content: "—";
  display: inline;
  margin: 0 0.4rem;
  opacity: 0.7;
}

/* Style for the H1 title that appears when scrolling */
.md-header__title .md-header__topic:last-child {
  padding-left: 0;
  font-size: 0.9rem;
  font-style: italic;
  white-space: nowrap;
  display: none;
  position: static !important;
}

/* Show H1 title when scrolled */
.md-header--shadow .md-header__title .md-header__topic:last-child,
.md-header--scrolled .md-header__title .md-header__topic:last-child {
  display: inline;
}

/* Center images with the .center class */
img.center {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

/* Logo styling with glowing effect */
.md-header__button.md-logo {
  position: relative;
  z-index: 2;
  overflow: visible;
  margin: 0.2rem;
}

.md-header__button.md-logo::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 25px 8px rgba(255, 255, 255, 0.4);
  z-index: -1;
  animation: pulse 4s infinite ease-in-out;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 15px 2px rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.85);
    transform: translate(-50%, -50%) scale(0.95);
  }
  50% {
    box-shadow: 0 0 30px 10px rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 1);
    transform: translate(-50%, -50%) scale(1.05);
  }
  100% {
    box-shadow: 0 0 15px 2px rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.85);
    transform: translate(-50%, -50%) scale(0.95);
  }
}

.md-header__button.md-logo img {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.3));
}

/* Card grid styling */
.grid.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.grid.cards > * {
  border-radius: 0.2rem;
  box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.05), 0 0 0.05rem rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  padding: 1rem;
  transition: box-shadow 0.25s, transform 0.25s;
}

.grid.cards > *:hover {
  box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.1), 0 0 0.2rem rgba(0, 0, 0, 0.2);
  transform: translateY(-0.1rem);
}

.grid.cards > * > :first-child {
  margin-top: 0;
}

.grid.cards > * > :last-child {
  margin-bottom: 0;
}

/* H1 header styling - smaller with blue glow */
.md-typeset h1 {
  font-size: 1rem !important;
  font-weight: 500;
  margin-bottom: 1rem;
  color: #1976d2;
  text-shadow: 0 0 5px rgba(25, 118, 210, 0.3);
  letter-spacing: 0.02em;
}

/* Exception for the main page title */
.md-content__inner:first-child > h1:first-child {
  font-size: 1rem !important;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #1976d2;
  /* text-shadow: 0 0 8px rgba(25, 118, 210, 0.4); */
}

/* H2 header styling - more bold and prominent with gradient line */
.md-typeset h2 {
  font-weight: 800 !important;
  color: #1976d2;
  margin-top: 0.5rem;
  margin-bottom: .1rem;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  position: relative;
  display: inline-block;
  padding-bottom: 0rem;
}

.md-typeset h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #1976d2, #00bcd4);
  border-radius: 1px;
  box-shadow: 0 0 8px 1px rgba(25, 118, 210, 0.4);
}

/* Adjust spacing between adjacent headers */
.md-typeset h1 + h2 {
  margin-top: 0;
}

/* Navigation tabs styling - Make transparent */
.md-header {
  background: linear-gradient(45deg, rgba(25, 70, 150, 0.25), rgba(4, 61, 235, 0.25)) !important;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 0.2rem rgba(0, 0, 0, 0.1), 0 0.2rem 0.4rem rgba(0, 0, 0, 0.2) !important;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Add subtle gradient for better text readability */
.md-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
  z-index: -1;
}

.md-tabs {
  background-color: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.md-tabs__link {
  font-weight: 600;
}

.md-tabs__link--active {
  color: #ffffff !important;
  opacity: 1;
}

/* Improve header contrast for better readability */
.md-header {
  color: #ffffff;
}

/* Make navigation text more readable */
.md-tabs__link {
  color: rgba(255, 255, 255, 0.85);
}

.md-tabs__link:hover {
  color: rgba(255, 255, 255, 1);
}

/* Header title text */
.md-header__title {
  color: rgba(255, 255, 255, 0.95);
}

/* Header navigation items */
.md-header__topic {
  color: rgba(255, 255, 255, 0.95);
}

/* Header buttons */
.md-header__button {
  color: rgba(255, 255, 255, 0.85);
}

.md-header__button:hover {
  color: rgba(255, 255, 255, 1);
}

/* Add background to header on scroll for better readability */
.md-header--shadow,
.md-header--scrolled {
  background: linear-gradient(45deg, rgba(25, 70, 150, 0.25), rgba(4, 61, 235, 0.25)) !important;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 0.2rem rgba(0, 0, 0, 0.1), 0 0.2rem 0.4rem rgba(0, 0, 0, 0.2) !important;
}

/* Main content area */
.md-main {
  background: linear-gradient(135deg, rgba(25, 118, 210, 0.03), rgba(0, 188, 212, 0.03));
  padding-top: 120px; /* Add padding to account for fixed header */
}

/* Style links to match the color scheme */
.md-content a:not(.md-button):not(.md-tabs__link) {
  color: #1976d2;
}

.md-content a:not(.md-button):not(.md-tabs__link):hover {
  color: #00bcd4;
}

/* Responsive iframe */
.responsive-iframe-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
}

.responsive-iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Add futuristic glow and rounded corners to hero image */
.center[src*="hero.png"] {
  border-radius: 12px;
  box-shadow: 0 0 20px 5px rgba(0, 153, 255, 0.7);
  transition: box-shadow 0.3s ease;
}

.center[src*="hero.png"]:hover {
  box-shadow: 0 0 30px 8px rgba(0, 153, 255, 0.9);
}

/* Add rounded corners to all component overview images */
.md-content img[src*="integrations.png"],
.md-content img[src*="knowledge-hub.png"],
.md-content img[src*="use_memory.png"],
.md-content img[src*="guardrails.png"] {
  border-radius: 10px;
  transition: transform 0.2s ease;
}

/* Optional hover effect for component images */
.md-content img[src*="integrations.png"]:hover,
.md-content img[src*="knowledge-hub.png"]:hover,
.md-content img[src*="use_memory.png"]:hover,
.md-content img[src*="guardrails.png"]:hover {
  transform: scale(1.02);
}

/* Search bar styling with rounded edges */
.md-search__form {
  border-radius: 20px;
  overflow: hidden;
}

.md-search__input {
  border-radius: 20px;
}

/* Style the search icon container */
.md-search__icon {
  border-radius: 20px;
}

/* Style the search results container */
.md-search__output {
  border-radius: 10px;
  overflow: hidden;
  margin-top: 5px;
}

/* Style the search results */
.md-search-result {
  border-radius: 10px;
}
