/* =================================
   DOCUMENTAZIONE - STILE MODERNO
   Ispirato allo style_home.css
   ================================= */

/* --- Variabili Colori --- */
:root {
    --testo-docs: #ffffff;
    --testo-docs-opaco: #ffffffb0;
    --testo-docs-scuro: #e0e0e0;
    --sfondo-card-docs: rgba(26, 26, 40, 0.85);
    --bordo-card-docs: rgba(255, 255, 255, 0.15);
    
    --accent-primary: #00b4d8;
    --accent-secondary: #4ade80;
    --accent-tertiary: #f59e0b;
    --accent-info: #8b5cf6;
    
    --shadow-color-docs: rgba(0, 0, 0, 0.3);
    --radius-grande: 20px;
    --radius-medio: 12px;
    --radius-piccolo: 8px;
}

* { 
    box-sizing: border-box; 
    margin: 0;
    padding: 0;
}

html { 
    height: 100%;
    scroll-behavior: smooth;
}

/* --- Sfondo Animato --- */
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--testo-docs);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
    
    /* Gradiente animato come homepage */
    background: linear-gradient(135deg, 
        #020024, 
        #090979, 
        #00d4ff
    );
    background-size: 400% 400%;
    animation: animated-gradient 15s ease infinite;
    background-color: #020024;
}

@keyframes animated-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Header --- */
.docs-header {
    width: 100%;
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid var(--bordo-card-docs);
    background: rgba(26, 26, 40, 0.3);
    backdrop-filter: blur(10px);
}

.docs-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px;
    letter-spacing: -1px;
    color: var(--testo-docs);
}

.docs-header p {
    font-size: 1.1rem;
    font-weight: 300;
    margin: 0;
    color: var(--testo-docs-opaco);
}

.home-link {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: var(--accent-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-piccolo);
    font-weight: 500;
    transition: all 0.3s ease;
}

.home-link:hover {
    background: #0096b8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 180, 216, 0.4);
}

/* --- Navigazione --- */
.docs-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--sfondo-card-docs);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--bordo-card-docs);
    padding: 15px 20px;
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--testo-docs);
    text-decoration: none;
    border-radius: var(--radius-piccolo);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.3);
}

/* --- Container Principale --- */
.docs-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    flex-grow: 1;
}

/* --- Griglia Card --- */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.doc-card {
    background: var(--sfondo-card-docs);
    border: 1px solid var(--bordo-card-docs);
    border-radius: var(--radius-medio);
    padding: 25px;
    text-decoration: none;
    color: var(--testo-docs);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 var(--shadow-color-docs);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.doc-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px 0 var(--shadow-color-docs);
    border-color: var(--accent-primary);
}

.doc-card-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    line-height: 1;
}

.doc-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 10px;
    color: var(--testo-docs);
}

.doc-card p {
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--testo-docs-opaco);
    margin: 0;
    flex-grow: 1;
}

.doc-card .card-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-piccolo);
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 10px;
    align-self: flex-start;
}

/* --- Sezioni --- */
.docs-section {
    background: var(--sfondo-card-docs);
    border: 1px solid var(--bordo-card-docs);
    border-radius: var(--radius-medio);
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 var(--shadow-color-docs);
}

.docs-section h2 {
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 20px;
    color: var(--testo-docs);
    border-bottom: 2px solid var(--accent-primary);
    padding-bottom: 10px;
}

.docs-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 25px 0 15px;
    color: var(--testo-docs);
}

.docs-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 20px 0 10px;
    color: var(--testo-docs-scuro);
}

.docs-section p {
    margin: 0 0 15px;
    color: var(--testo-docs-scuro);
    line-height: 1.8;
}

.docs-section ul,
.docs-section ol {
    margin: 0 0 15px 25px;
    color: var(--testo-docs-scuro);
}

.docs-section li {
    margin: 8px 0;
    line-height: 1.6;
}

.docs-section a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.docs-section a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.docs-section code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--accent-secondary);
}

.docs-section pre {
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: var(--radius-piccolo);
    overflow-x: auto;
    margin: 15px 0;
    border: 1px solid var(--bordo-card-docs);
}

.docs-section pre code {
    background: transparent;
    padding: 0;
    color: var(--testo-docs-scuro);
}

.docs-section blockquote {
    border-left: 4px solid var(--accent-primary);
    padding: 10px 20px;
    margin: 15px 0;
    background: rgba(0, 180, 216, 0.1);
    border-radius: 0 var(--radius-piccolo) var(--radius-piccolo) 0;
}

.docs-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.docs-section th,
.docs-section td {
    padding: 12px;
    text-align: left;
    border: 1px solid var(--bordo-card-docs);
}

.docs-section th {
    background: rgba(0, 180, 216, 0.2);
    font-weight: 600;
}

.docs-section tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* --- Footer --- */
.docs-footer {
    width: 100%;
    text-align: center;
    padding: 30px 20px;
    margin-top: auto;
    font-size: 0.9rem;
    color: var(--testo-docs-opaco);
    border-top: 1px solid var(--bordo-card-docs);
    background: rgba(26, 26, 40, 0.3);
    backdrop-filter: blur(10px);
}

.docs-footer a {
    color: var(--testo-docs);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.docs-footer a:hover {
    color: var(--accent-primary);
}

.docs-footer span {
    margin: 0 10px;
    opacity: 0.5;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .docs-header h1 {
        font-size: 2rem;
    }
    
    .docs-grid {
        grid-template-columns: 1fr;
    }
    
    .docs-section {
        padding: 20px;
    }
    
    .nav-content {
        flex-direction: column;
        gap: 10px;
    }
}

/* --- Accessibilità --- */
@media (prefers-reduced-motion: reduce) {
    body { animation: none !important; }
    * { transition: none !important; }
}

@media (forced-colors: active) {
    .doc-card:focus-visible,
    .nav-link:focus-visible { 
        outline-color: Highlight; 
    }
}

/* Focus visibile */
.doc-card:focus-visible,
.nav-link:focus-visible,
.home-link:focus-visible {
    outline: 3px solid rgba(255,255,255,0.85);
    outline-offset: 4px;
}

/* --- Utilità --- */
.text-center { text-align: center; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }

/* Screenshot */
.docs-section img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-piccolo);
    border: 1px solid var(--bordo-card-docs);
    margin: 15px 0;
    display: block;
}
