/* Custom styles for enhanced documentation */

/* Enhanced code blocks */
.highlight {
  border-radius: 0.5rem;
  margin: 1em 0;
}

/* Better admonition styling */
.md-typeset .admonition {
  border-radius: 0.5rem;
  box-shadow: 0 0.2rem 0.5rem rgba(0,0,0,.05);
}

/* Enhanced tables */
.md-typeset table:not([class]) {
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 0.2rem 0.5rem rgba(0,0,0,.05);
}

/* Product sections with better spacing */
.md-typeset h3[id*="material-"] {
  margin-top: 2rem;
  padding: 1rem;
  background: rgba(var(--md-primary-fg-color--rgb), 0.05);
  border-radius: 0.5rem;
  border-left: 0.25rem solid var(--md-primary-fg-color);
}

/* Better link styling for navigation arrows */
.md-typeset a[href*="octicons-arrow-right"] {
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s;
}

.md-typeset a[href*="octicons-arrow-right"]:hover {
  background-color: rgba(var(--md-primary-fg-color--rgb), 0.1);
}

/* Screenshot styling */
.screenshot {
  margin: 1.5rem 0;
  text-align: center;
  border-radius: 0.75rem;
  overflow: hidden;
}
.center {
  text-align: center;  
}

.screenshot img {
  max-width: 75%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.screenshot img:hover {
  transform: scale(1.02);
  box-shadow: 
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Optimal screenshot sizing - responsive and professional round corner*/
.screenshot-shadowc {
  max-width: 85% !important;
  height: auto !important;
  border-radius: 0.5rem !important;
  box-shadow: 
    0 8px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  display: block !important;
  margin: 1.5rem auto !important;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out !important;
}

/* Optimal screenshot sizing - responsive and professional */
.screenshot-shadow {
  max-width: 85% !important;
  height: auto !important;  
  box-shadow: 
    0 8px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  display: block !important;
  margin: 1.5rem auto !important;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out !important;
}

.screenshot-center {
  max-width: 85% !important;
  height: auto !important;
  display: block !important;
  margin: 1.5rem auto !important;
}


.screenshot-shadow:hover {
  transform: scale(1.02) !important;
  border-radius: 0.7rem !important;
  box-shadow: 
    0 12px 30px -8px rgba(0, 0, 0, 0.15),
    0 12px 15px -8px rgba(0, 0, 0, 0.1) !important;
}

/* Responsive screenshot sizing for different screen sizes */
@media (min-width: 1200px) {
  .screenshot-shadow {
    max-width: 80% !important;  /* Slightly smaller on very large screens */
  }
}

@media (max-width: 1024px) {
  .screenshot-shadow {
    max-width: 90% !important;  /* Larger on tablets */
  }
}

@media (max-width: 768px) {
  .screenshot-shadow {
    max-width: 95% !important;  /* Nearly full width on phones */
    margin: 1rem auto !important;
  }
}

/* Responsive screenshot sizing */
@media (max-width: 768px) {
  .screenshot {
    margin: 1rem -1rem;
  }
  
  .screenshot img {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* Keyboard key styling */
.md-typeset .keys kbd {
  background: #fafafa;
  border: 1px solid #ccc;
  border-bottom: 2px solid #bbb;
  border-radius: 0.3rem;
  padding: 0.2rem 0.5rem;
  font-family: monospace;
  box-shadow: inset 0 -1px 0 #bbb;
}

/* Mermaid diagram styling */
.mermaid {
  text-align: center;
  margin: 1rem 0;
}

/* Version badge */
.version-badge {
  display: inline-block;
  background: #4a90e2;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

/* ===== OPTIMIZED SEARCH RESULTS ===== */
/* Shorter, more concise search result snippets */

.md-search-result {
  border-radius: 0.5rem;
  margin-bottom: 0.75rem !important;
}

.md-search-result__teaser {
  line-height: 1.4 !important;
  max-height: 2.8em !important;
  overflow: hidden !important;
  font-size: 0.85rem !important;
  color: var(--md-default-fg-color--light) !important;
}

.md-search-result__title {
  font-weight: 600 !important;
  margin-bottom: 0.25rem !important;
  line-height: 1.3 !important;
}

.md-search-result__meta {
  font-size: 0.8rem !important;
  opacity: 0.7 !important;
  margin-top: 0.25rem !important;
  color: var(--md-default-fg-color--lighter) !important;
}

/* Enhanced search term highlighting */
.md-search-result__teaser mark,
.md-search-result__title mark {
  background-color: rgba(255, 235, 59, 0.6) !important;
  color: inherit !important;
  padding: 0 2px !important;
  border-radius: 2px !important;
  font-weight: 600 !important;
}

/* Dark mode search highlights */
[data-md-color-scheme="slate"] .md-search-result__teaser mark,
[data-md-color-scheme="slate"] .md-search-result__title mark {
  background-color: rgba(255, 193, 7, 0.3) !important;
}

/* Compact search results */
.md-search-result__list {
  max-height: 70vh !important;
  overflow-y: auto !important;
}

.md-search-result__item {
  padding: 0.75rem !important;
  border-bottom: 1px solid var(--md-default-fg-color--lightest) !important;
}

.md-search-result__item:last-child {
  border-bottom: none !important;
}

/* Better search result structure */
.md-search-result__article {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.25rem !important;
}

/* Hide overly long URLs in search meta */
.md-search-result__meta .md-search-result__terms {
  max-width: 300px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* 404 Page Styling */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.error-page h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--md-primary-fg-color);
}

.error-page .search-enhanced {
  max-width: 500px;
  width: 100%;
  margin: 2rem 0;
}

.error-page .search-enhanced input {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  border: 2px solid var(--md-primary-fg-color--light);
  border-radius: 0.75rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  transition: all 0.3s ease;
}

.error-page .search-enhanced input:focus {
  outline: none;
  border-color: var(--md-primary-fg-color);
  box-shadow: 0 0 0 3px rgba(var(--md-primary-fg-color-rgb), 0.1);
}

/* Enhanced grid cards for 404 page */
.grid.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.grid.cards .card {
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.grid.cards .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  border-color: var(--md-primary-fg-color--light);
}

.grid.cards .card h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--md-primary-fg-color);
}

.grid.cards .card .md-button {
  margin-top: 1rem;
  border-radius: 0.5rem;
}

/* Button spacing in grid cards */
.grid.cards .md-button {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.grid.cards .md-button:last-child {
  margin-right: 0;
}

/* Responsive design for 404 page */
@media screen and (max-width: 768px) {
  .error-page h1 {
    font-size: 2rem;
  }
  
  .grid.cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .grid.cards .card {
    padding: 1.5rem;
  }
}