/* Stile base per la documentazione */
.doc {
    --primary-color: #3b82f6;
    --secondary-color: #1e40af;
    --text-color: #1f2937;
    --light-text: #6b7280;
    --light-bg: #f3f4f6;
    --code-bg: #f8fafc;
    --border-color: #e5e7eb;
    --accent-color: #dbeafe;
    --warning-color: #fef3c7;
    --success-color: #d1fae5;
    
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background-color: #fff;
    font-size: 16px;
  }
  
  /* Titoli */
  .doc h1, .doc h2, .doc h3, .doc h4, .doc h5, .doc h6 {
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
    color: var(--secondary-color);
  }
  
  .doc h1 {
    font-size: 2.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    margin-top: 0;
  }
  
  .doc h2 {
    font-size: 1.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
    margin-top: 2.5rem;
  }
  
  .doc h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
  }
  
  .doc h4 {
    font-size: 1.25rem;
  }
  
  .doc h5 {
    font-size: 1.1rem;
  }
  
  .doc h6 {
    font-size: 1rem;
    color: var(--light-text);
  }
  
  /* Paragrafi e testo */
  .doc p {
    margin-bottom: 1rem;
  }
  
  .doc strong {
    font-weight: 600;
    color: var(--secondary-color);
  }
  
  .doc em {
    font-style: italic;
  }
  
  /* Liste */
  .doc ul, .doc ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
  }
  
  .doc ul {
    list-style-type: disc;
  }
  
  .doc ol {
    list-style-type: decimal;
  }
  
  .doc li {
    margin-bottom: 0.5rem;
  }
  
  .doc li > ul, .doc li > ol {
    margin: 0.5rem 0;
  }
  
  /* Codice XML */
  .doc pre {
    background-color: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
  }
  
  .doc code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
    background-color: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    color: var(--secondary-color);
  }
  
  .doc pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    color: inherit;
    font-size: 0.9rem;
  }
  
  /* Note e avvertenze */
  .doc blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 0.75rem 1rem;
    margin: 1.5rem 0;
    background-color: var(--accent-color);
    border-radius: 0 0.375rem 0.375rem 0;
  }
  
  .doc blockquote p {
    margin-bottom: 0;
  }
  
  /* Elementi speciali */
  .doc .nota, .doc .warning {
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 0.375rem;
  }
  
  .doc .nota {
    background-color: var(--accent-color);
    border-left: 4px solid var(--primary-color);
  }
  
  .doc .warning {
    background-color: var(--warning-color);
    border-left: 4px solid #f59e0b;
  }
  
  .doc .nota::before, .doc .warning::before {
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
  }
  
  .doc .nota::before {
    content: "📝 Nota";
    color: var(--secondary-color);
  }
  
  .doc .warning::before {
    content: "⚠️ Attenzione";
    color: #b45309;
  }
  
  /* Tabelle */
  .doc table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
  }
  
  .doc th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    text-align: left;
  }
  
  .doc th, .doc td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
  }
  
  .doc tr:nth-child(even) {
    background-color: var(--light-bg);
  }
  
  /* Elementi data */
  .doc .data-field {
    font-family: 'Fira Code', 'Consolas', monospace;
    color: #d946ef;
    font-weight: 500;
  }
  
  .doc .attribute {
    color: #059669;
  }
  
  .doc .required::after {
    content: "*";
    color: #dc2626;
    margin-left: 0.25rem;
  }
  
  /* Responsive design */
  @media (max-width: 768px) {
    .doc {
      padding: 1rem;
      font-size: 15px;
    }
    
    .doc h1 {
      font-size: 1.8rem;
    }
    
    .doc h2 {
      font-size: 1.5rem;
    }
    
    .doc h3 {
      font-size: 1.25rem;
    }
    
    .doc pre, .doc code {
      font-size: 0.85rem;
    }
    
    .doc table {
      font-size: 0.85rem;
    }
  }
  
  /* Stile per i collegamenti */
  .doc a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s, border-bottom 0.2s;
    border-bottom: 1px solid transparent;
  }
  
  .doc a:hover, .doc a:focus {
    color: var(--secondary-color);
    border-bottom: 1px solid var(--secondary-color);
  }
  
  /* Elementi XML specifici */
  .doc .xml-tag {
    color: #2563eb;
  }
  
  .doc .xml-attribute {
    color: #7c3aed;
  }
  
  .doc .xml-value {
    color: #b91c1c;
  }
  
  .doc .xml-comment {
    color: #65a30d;
    font-style: italic;
  }
  
  /* Box per esempi XML */
  .doc .example-box {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    position: relative;
  }
  
  .doc .example-box::before {
    content: "Esempio";
    position: absolute;
    top: -0.75rem;
    left: 1rem;
    background-color: white;
    padding: 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
  }
  
  /* Highlight per campi obbligatori */
  .doc .required-field {
    background-color: #fee2e2;
    border-radius: 0.25rem;
    padding: 0.1em 0.3em;
  }
  
  /* Stile per le note di avviso */
  .doc .alert {
    background-color: #fef2f2;
    border-left: 4px solid #dc2626;
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 0 0.375rem 0.375rem 0;
  }
  
  .doc .alert::before {
    content: "⚠️ Importante";
    display: block;
    font-weight: 600;
    color: #dc2626;
    margin-bottom: 0.5rem;
  }
  
  /* Stile per la navigazione interna della documentazione */
  .doc .doc-nav {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding-right: 1rem;
  }
  
  .doc .doc-nav ul {
    list-style-type: none;
    padding-left: 0;
  }
  
  .doc .doc-nav li {
    margin-bottom: 0.25rem;
  }
  
  .doc .doc-nav a {
    display: block;
    padding: 0.25rem 0;
  }
  
  .doc .doc-nav .nav-h2 {
    font-weight: 600;
    margin-top: 0.5rem;
  }
  
  .doc .doc-nav .nav-h3 {
    padding-left: 1rem;
    font-size: 0.9rem;
  }
  
  .doc .doc-nav .nav-h4 {
    padding-left: 2rem;
    font-size: 0.85rem;
    color: var(--light-text);
  }
  
  /* Colori sintassi per XML */
  .doc .language-xml .tag {
    color: #2563eb;
  }
  
  .doc .language-xml .attr-name {
    color: #7c3aed;
  }
  
  .doc .language-xml .attr-value {
    color: #b91c1c;
  }
  
  .doc .language-xml .comment {
    color: #65a30d;
  }
  
  /* Campi descrizione dati */
  .doc .field-description {
    display: flex;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    overflow: hidden;
  }
  
  .doc .field-name {
    flex: 0 0 30%;
    background-color: var(--light-bg);
    padding: 0.75rem;
    font-weight: 600;
    border-right: 1px solid var(--border-color);
  }
  
  .doc .field-details {
    flex: 1;
    padding: 0.75rem;
  }
  
  .doc .field-type {
    font-size: 0.85rem;
    color: var(--light-text);
    margin-bottom: 0.5rem;
  }
  
  .doc .field-required {
    display: inline-block;
    background-color: #fee2e2;
    color: #b91c1c;
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
    margin-left: 0.5rem;
  }
  
  .doc .field-optional {
    display: inline-block;
    background-color: #e0e7ff;
    color: #4338ca;
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
    margin-left: 0.5rem;
  }