

/* Variabili aggiuntive per docs */
:root {
    --sidebar-width: 280px;
    --header-height: 60px;
    --code-bg: #282a36;
    --code-border: #44475a;
}

/* Override body per docs */
body {
    background: #fafafa;
}

/* Layout Documentazione */
.docs-container {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* Header docs */
.docs-header {
    background: white;
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 2rem;
}

.docs-header-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--border);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    position: fixed;
    padding: 2rem 0;
    transition: transform 0.3s ease;
}

.sidebar-section {
    margin-bottom: 2rem;
    padding: 0 1.5rem;
}

.sidebar-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-links a {
    color: var(--text);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: var(--transition);
    font-size: 0.95rem;
    position: relative;
}

.sidebar-links a:hover {
    background: var(--light);
    color: var(--primary);
}

.sidebar-links a.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

.sidebar-links a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 70%;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 3rem;
    max-width: 900px;
    background: white;
    min-height: 100%;
}

.doc-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border);
}

.doc-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.doc-header .subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
}

/* Content Typography */
.content h2 {
    font-size: 2rem;
    margin: 3rem 0 1.5rem;
    color: var(--dark);
    padding-top: 1rem;
}

.content h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--dark);
}

.content h4 {
    font-size: 1.25rem;
    margin: 1.5rem 0 1rem;
    color: var(--dark);
}

.content p {
    margin-bottom: 1.5rem;
    color: var(--text);
    line-height: 1.7;
}

.content ul, 
.content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.content a {
    color: var(--primary);
    text-decoration: underline;
}

.content a:hover {
    color: var(--primary-dark);
}

/* Code Blocks */
.content pre {
    background: var(--code-bg);
    color: #f8f8f2;
    padding: 1.5rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    border: 1px solid var(--code-border);
}

.content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    color: var(--primary-dark);
}

.content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Code with line numbers */
.code-block {
    position: relative;
    margin-bottom: 1.5rem;
}

.code-block pre {
    margin: 0;
}

/* Copy button */
.copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition);
    font-family: inherit;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.copy-button.copied {
    background: var(--primary);
    border-color: var(--primary);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert strong {
    font-weight: 600;
}

.alert-info {
    background: var(--secondary-light);
    border-color: var(--secondary);
    color: #1565C0;
}

.alert-success {
    background: var(--primary-light);
    border-color: var(--primary);
    color: #2E7D32;
}

.alert-warning {
    background: #FFF3E0;
    border-color: #FF9800;
    color: #E65100;
}

.alert-danger {
    background: #FFEBEE;
    border-color: #F44336;
    color: #C62828;
}

/* Tables */
.content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.content th {
    background: var(--light);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid var(--border);
}

.content td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.content tr:last-child td {
    border-bottom: none;
}

.content tr:hover {
    background: #fafafa;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    font-family: inherit;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

/* Steps */
.step {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

/* Navigation buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
}

.nav-button:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Search box */
.search-box {
    position: relative;
    margin-right: 2rem;
}

.search-input {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 300px;
    font-size: 0.95rem;
    transition: var(--transition);
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

/* Feature cards for docs */
.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.feature-card h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.feature-card p {
    margin-bottom: 0;
    font-size: 0.95rem;
    color: var(--text-light);
}

/* TOC (Table of Contents) */
.toc {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.toc h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc li {
    margin-bottom: 0.5rem;
}

.toc a {
    color: var(--text);
    text-decoration: none;
}

.toc a:hover {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 999;
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .main-content {
        margin-left: 0;
        padding: 2rem 1rem;
    }
    
    .search-box {
        display: none;
    }
    
    .doc-header h1 {
        font-size: 2rem;
    }
    
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab {
        white-space: nowrap;
    }
    
    .nav-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-button {
        width: 100%;
        justify-content: center;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .docs-header,
    .nav-buttons,
    .copy-button {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
        max-width: 100%;
    }
    
    .content pre {
        white-space: pre-wrap;
    }
}