/* CSS personalizzato per documentazione Salabam Solutions */

:root {
  --salabam-primary: #212D44;
  --salabam-secondary: #64748b;
  --salabam-accent: #0A76BD;
  --salabam-accent-light: #0077CA;
  --salabam-success: #10b981;
  --salabam-warning: #f59e0b;
  --salabam-error: #ef4444;
  --salabam-info: #0077CA;
  --salabam-light: #F2F1F1;
}

/* Override MkDocs Material colors */
[data-md-color-primary="custom"] {
  --md-primary-fg-color: #212D44;
  --md-primary-fg-color--light: #0A76BD;
  --md-primary-fg-color--dark: #1a2333;
}

[data-md-color-accent="custom"] {
  --md-accent-fg-color: #0077CA;
  --md-accent-fg-color--transparent: rgba(0, 119, 202, 0.1);
}

/* Header personalizzato */
.md-header {
  background: linear-gradient(135deg, var(--salabam-primary) 0%, var(--salabam-accent) 100%);
}

/* Logo e titolo */
.md-header__title {
  font-weight: 600;
  color: white;
}

/* Badge e status */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
}

.badge.bg-success {
  background-color: var(--salabam-success);
  color: white;
}

.badge.bg-warning {
  background-color: var(--salabam-warning);
  color: white;
}

.badge.bg-danger {
  background-color: var(--salabam-error);
  color: white;
}

.badge.bg-info {
  background-color: var(--salabam-info);
  color: white;
}

.badge.bg-secondary {
  background-color: var(--salabam-secondary);
  color: white;
}

.badge.bg-primary {
  background-color: var(--salabam-primary);
  color: white;
}

/* Stili per API Reference */
.api-endpoint {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  margin: 1rem 0;
  overflow: hidden;
}

.api-endpoint-header {
  background: #1e293b;
  color: white;
  padding: 0.75rem 1rem;
  font-family: 'Roboto Mono', monospace;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.api-method {
  background: var(--salabam-accent);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 4rem;
  text-align: center;
}

.api-method.get { background-color: var(--salabam-accent-light); }
.api-method.post { background-color: var(--salabam-success); }
.api-method.put { background-color: var(--salabam-warning); }
.api-method.delete { background-color: var(--salabam-error); }

.api-endpoint-body {
  padding: 1rem;
}

/* Code blocks migliorati */
.highlight {
  border-radius: 0.5rem;
  overflow: hidden;
}

/* Tabelle responsive */
.md-typeset table:not([class]) {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}

.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td {
  padding: 0.75rem;
  vertical-align: top;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.md-typeset table:not([class]) th {
  background: #f8fafc;
  font-weight: 600;
  color: #1e293b;
}

/* Status codes */
.status-code {
  font-family: 'Roboto Mono', monospace;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

.status-200 { background: #dcfce7; color: #166534; }
.status-201 { background: #dcfce7; color: #166534; }
.status-204 { background: #f3f4f6; color: #374151; }
.status-400 { background: #fef2f2; color: #991b1b; }
.status-401 { background: #fef2f2; color: #991b1b; }
.status-403 { background: #fef2f2; color: #991b1b; }
.status-404 { background: #fef2f2; color: #991b1b; }
.status-422 { background: #fefbec; color: #92400e; }
.status-429 { background: #fefbec; color: #92400e; }
.status-500 { background: #fef2f2; color: #991b1b; }

/* Esempi di codice */
.code-example {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
  overflow-x: auto;
}

.code-example h4 {
  color: #38bdf8;
  margin: 0 0 0.5rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Icone personalizzate */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 0.25rem;
  vertical-align: text-top;
}

/* Alert personalizzati */
.admonition {
  border-radius: 0.5rem;
  border-left: 4px solid;
  margin: 1.5rem 0;
  padding: 0 1rem;
  page-break-inside: avoid;
}

.admonition.info {
  border-left-color: var(--salabam-info);
}

.admonition.warning {
  border-left-color: var(--salabam-warning);
}

.admonition.danger {
  border-left-color: var(--salabam-error);
}

.admonition.success {
  border-left-color: var(--salabam-success);
}

/* Navigation migliorata */
.md-nav__item--active > .md-nav__link {
  color: var(--salabam-accent);
  font-weight: 600;
}

/* Search migliorata */
.md-search__form {
  border-radius: 1rem;
}

/* Footer personalizzato */
.md-footer {
  background: var(--salabam-primary);
  color: #94a3b8;
}

.md-footer-meta {
  background: #1a2333;
}

/* Footer version info styling */
.md-version-info {
  margin-top: 0.5rem !important;
  font-size: 0.75rem !important;
  color: #64748b !important;
  opacity: 0.8;
}

/* Responsive improvements */
@media screen and (max-width: 768px) {
  .md-typeset table:not([class]) {
    font-size: 0.875rem;
  }
  
  .api-endpoint-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .api-method {
    align-self: flex-start;
  }
}

/* Print styles */
@media print {
  .md-header,
  .md-footer,
  .md-nav,
  .md-sidebar {
    display: none !important;
  }
  
  .md-main__inner {
    margin: 0 !important;
  }
  
  .md-content {
    margin: 0 !important;
  }
}

/* Dark mode adjustments */
[data-md-color-scheme="slate"] {
  --md-code-bg-color: #1e293b;
  --md-code-fg-color: #e2e8f0;
}

[data-md-color-scheme="slate"] .api-endpoint {
  background: #1e293b;
  border-color: #334155;
}

[data-md-color-scheme="slate"] .api-endpoint-header {
  background: #0f172a;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
  background: #334155;
  color: #e2e8f0;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) td {
  border-bottom-color: #334155;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }

.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }

.rounded { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }

.font-mono { font-family: 'Roboto Mono', monospace; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

/* Highlights */
.highlight-box {
  background: linear-gradient(135deg, var(--salabam-light) 0%, #e8f4fd 100%);
  border: 1px solid var(--salabam-accent);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1rem 0;
}

.highlight-box h4 {
  color: var(--salabam-accent);
  margin-top: 0;
}

/* Animazioni subtle */
.md-nav__link:hover {
  transition: color 0.2s ease;
}

.md-nav__item--active > .md-nav__link {
  transition: color 0.2s ease;
}

/* Migliora la leggibilità dei link */
.md-content a {
  color: var(--salabam-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-bottom-color 0.2s ease;
}

.md-content a:hover {
  border-bottom-color: var(--salabam-accent);
}

/* Stili per banner/copertina homepage */
.hero-banner {
  max-width: 100%;
  height: auto;
  margin: 20px 0;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.hero-container {
  text-align: center;
  margin: 2rem 0;
}

/* Logo header ottimizzato */
.md-header__button.md-logo {
  padding: 0.4rem;
  margin: 0;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: auto !important;
  max-height: 80px;
  width: auto;
  background: #ffffff;
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Stili responsive per il banner */
@media screen and (max-width: 768px) {
  .hero-banner {
    margin: 15px 0;
    border-radius: 8px;
  }
}