/* Custom styles for Akash Python SDK documentation */

/* Custom color scheme for Akash branding */
:root {
  --md-primary-fg-color: #6366f1;
  --md-primary-fg-color--light: #818cf8;
  --md-primary-fg-color--dark: #4f46e5;
  --md-accent-fg-color: #8b5cf6;
}

/* Dark mode custom colors */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #8b5cf6;
  --md-primary-fg-color--light: #a78bfa;
  --md-primary-fg-color--dark: #7c3aed;
  --md-accent-fg-color: #c084fc;
}

/* Custom card grid styling */
.md-typeset .grid.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.md-typeset .grid.cards > * {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: all 0.2s ease;
  background: var(--md-default-bg-color);
}

.md-typeset .grid.cards > *:hover {
  border-color: var(--md-primary-fg-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Dark mode card styling */
[data-md-color-scheme="slate"] .md-typeset .grid.cards > * {
  border-color: var(--md-default-fg-color--lightest);
  background: var(--md-code-bg-color);
}

[data-md-color-scheme="slate"] .md-typeset .grid.cards > *:hover {
  border-color: var(--md-primary-fg-color);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

/* Enhanced code block styling */
.md-typeset .highlight {
  border-radius: 0.5rem;
  overflow: hidden;
}

.md-typeset .highlight pre {
  margin: 0;
  border-radius: 0;
}

/* Code block titles */
.md-typeset .highlight[data-title]::before {
  content: attr(data-title);
  display: block;
  padding: 0.5rem 1rem;
  background: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Custom admonition styling for tips and examples */
.md-typeset .admonition.tip {
  border-color: #10b981;
}

.md-typeset .admonition.tip > .admonition-title {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
}

.md-typeset .admonition.example {
  border-color: #3b82f6;
}

.md-typeset .admonition.example > .admonition-title {
  background-color: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
}

/* Navigation improvements */
.md-tabs__link {
  font-weight: 500;
}

.md-tabs__link--active {
  color: var(--md-primary-fg-color);
}

/* Search improvements */
.md-search__input {
  border-radius: 0.5rem;
}

/* Table styling improvements */
.md-typeset table:not([class]) {
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.md-typeset table:not([class]) th {
  background: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
  font-weight: 600;
}

/* Button styling */
.md-button {
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.md-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.md-button--primary {
  background: var(--md-primary-fg-color);
  border-color: var(--md-primary-fg-color);
}

/* Emoji and icon improvements */
.twemoji {
  width: 1.2em;
  height: 1.2em;
}

/* Progress bar styling */
.md-typeset .task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
  background-color: var(--md-primary-fg-color);
}

/* Footer improvements */
.md-footer {
  background: linear-gradient(135deg, var(--md-primary-fg-color), var(--md-accent-fg-color));
}

/* Responsive improvements */
@media screen and (max-width: 768px) {
  .md-typeset .grid.cards {
    grid-template-columns: 1fr;
  }
  
  .md-typeset .grid.cards > * {
    padding: 1rem;
  }
}

/* Print styles */
@media print {
  .md-header,
  .md-footer,
  .md-sidebar,
  .md-nav__link[data-md-state="blur"] {
    display: none !important;
  }
  
  .md-content__inner {
    margin: 0 !important;
  }
}

/* Custom animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.md-typeset .grid.cards > * {
  animation: fadeInUp 0.6s ease forwards;
}

/* Performance optimization */
.md-typeset .highlight {
  contain: layout style paint;
}

/* Accessibility improvements */
.md-typeset .grid.cards > *:focus {
  outline: 2px solid var(--md-primary-fg-color);
  outline-offset: 2px;
}

/* Custom logo styling */
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 2rem;
  width: auto;
}

/* Constructor Parameters table formatting fix */
/* Prevent wrapping in Parameter, Type, and Default columns */
table th:nth-child(1),
table td:nth-child(1),
table th:nth-child(2),
table td:nth-child(2),
table th:nth-child(3),
table td:nth-child(3) {
    white-space: nowrap;
}

/* Ensure the Description column can wrap */
table th:nth-child(4),
table td:nth-child(4) {
    white-space: normal;
    word-wrap: break-word;
}

/* Enhanced table layout for constructor parameters */
.md-typeset table:not([class]) {
    table-layout: auto;
    width: 100%;
}

/* Specific styling for constructor parameter tables */
.md-typeset table:not([class]) td,
.md-typeset table:not([class]) th {
    padding: 12px 16px;
    vertical-align: top;
}

/* Better column distribution */
.md-typeset table:not([class]) th:nth-child(1),
.md-typeset table:not([class]) td:nth-child(1) {
    min-width: 120px; /* Parameter column */
}

.md-typeset table:not([class]) th:nth-child(2),
.md-typeset table:not([class]) td:nth-child(2) {
    min-width: 60px; /* Type column */
}

.md-typeset table:not([class]) th:nth-child(3),
.md-typeset table:not([class]) td:nth-child(3) {
    min-width: 200px; /* Default column */
}

.md-typeset table:not([class]) th:nth-child(4),
.md-typeset table:not([class]) td:nth-child(4) {
    width: auto; /* Description column takes remaining space */
}