/* ========================================
   KNOWLEDGE BASE FRONTEND - DESIGN MODERNO
   ======================================== */

/* Reset e Base */
.kb-frontend * {
    box-sizing: border-box;
}

.kb-frontend {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: #f8f9fa;
}

/* Header e Navigazione */
.kb-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 0;
    margin-bottom: 3rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.kb-header h1 {
    color: white;
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.kb-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

.kb-nav a {
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-weight: 500;
}

.kb-nav a:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Barra di Ricerca */
.kb-search-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    margin-bottom: 3rem;
    text-align: center;
}

.kb-search-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.kb-search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 1rem;
}

.kb-search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e9ecef;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.kb-search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.kb-search-button {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.kb-search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Griglia Articoli */
.kb-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.kb-article-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.kb-article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.kb-article-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem;
    color: white;
    position: relative;
}

.kb-article-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    line-height: 1.3;
}

.kb-article-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.kb-article-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kb-article-body {
    padding: 1.5rem;
}

.kb-article-excerpt {
    color: #6c757d;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.kb-article-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.kb-category-tag {
    background: #e9ecef;
    color: #495057;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.kb-category-tag:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.kb-article-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.kb-read-more {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
}

.kb-read-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: white;
}

/* Messaggio Nessun Articolo */
.kb-no-articles {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.kb-no-articles h3 {
    color: #6c757d;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.kb-no-articles p {
    color: #adb5bd;
    font-size: 1.1rem;
}

/* Paginazione */
.kb-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.kb-pagination a,
.kb-pagination span {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 45px;
    text-align: center;
}

.kb-pagination a {
    background: white;
    color: #667eea;
    border: 2px solid #e9ecef;
}

.kb-pagination a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.kb-pagination .current {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Responsive */
@media (max-width: 768px) {
    .kb-header h1 {
        font-size: 2rem;
    }
    
    .kb-nav {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .kb-search-form {
        flex-direction: column;
    }
    
    .kb-articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .kb-article-card {
        margin: 0 1rem;
    }
}

/* Loading States */
.kb-loading {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.kb-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
    margin-left: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Filtri e Ordinamento */
.kb-filters {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.kb-filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    color: #2c3e50;
    min-width: 150px;
}

.kb-filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Risultati Ricerca */
.kb-search-results {
    margin-top: 2rem;
}

.kb-search-results h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.kb-search-highlight {
    background: #fff3cd;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

/* ========================================
   SINGOLO ARTICOLO KB - DESIGN MIGLIORATO
   ======================================== */

/* Container articolo singolo */
.kb-article-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header articolo singolo */
.kb-article-container .kb-article-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem 2rem;
    border-radius: 15px;
    margin-bottom: 3rem;
    text-align: center;
    color: white;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.kb-article-container .kb-article-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.kb-article-container .kb-article-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    font-size: 1rem;
    opacity: 0.9;
}

.kb-article-container .kb-article-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

/* Layout contenuto principale */
.kb-article-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

/* Contenuto principale */
.kb-article-main {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.kb-content-section {
    margin-bottom: 2.5rem;
}

.kb-content-section:last-child {
    margin-bottom: 0;
}

.kb-content-section h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #667eea;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.kb-content-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #2c3e50;
}

/* Dettagli tecnici */
.kb-detail-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #667eea;
}

.kb-detail-item:last-child {
    margin-bottom: 0;
}

.kb-detail-item h3 {
    color: #495057;
    margin: 0 0 1rem 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kb-detail-item p {
    margin: 0;
    color: #6c757d;
    line-height: 1.6;
}

.kb-solution-steps {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    font-family: 'Courier New', monospace;
    white-space: pre-line;
    line-height: 1.6;
    color: #2c3e50;
}

/* Sidebar */
.kb-article-sidebar {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.kb-sidebar-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.kb-sidebar-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.kb-sidebar-section h3 {
    color: #2c3e50;
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Badge stato e priorità */
.kb-status-badge,
.kb-priority-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
    width: 100%;
}

.kb-status-confirmed {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.kb-status-partial {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: white;
}

.kb-status-obsolete {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    color: white;
}

.kb-priority-critical {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    color: white;
}

.kb-priority-high {
    background: linear-gradient(135deg, #fd7e14 0%, #ffc107 100%);
    color: white;
}

.kb-priority-medium {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    color: white;
}

.kb-priority-low {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.kb-visibility-badge {
    background: #e9ecef;
    color: #495057;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    margin-top: 0.5rem;
}

/* Categorie e tag */
.kb-categories-list,
.kb-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.kb-article-container .kb-category-tag,
.kb-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.kb-article-container .kb-category-tag:hover,
.kb-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
}

/* Azioni */
.kb-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kb-action-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    color: #495057;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.kb-action-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

/* Statistiche */
.kb-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kb-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.kb-stat-label {
    font-size: 0.9rem;
    color: #6c757d;
}

.kb-stat-value {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

/* Articoli correlati */
.kb-related-articles {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.kb-related-articles h2 {
    color: #2c3e50;
    margin: 0 0 1.5rem 0;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Responsive per singolo articolo */
@media (max-width: 768px) {
    .kb-article-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .kb-article-sidebar {
        position: static;
    }
    
    .kb-article-container .kb-article-title {
        font-size: 2rem;
    }
    
    .kb-article-container .kb-article-meta {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ========================================
   STILI PER INFORMAZIONI AVANZATE KB
   ======================================== */

/* Informazioni Avanzate */
.kb-advanced-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    border: 1px solid #e9ecef;
}

.kb-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.kb-info-row:hover {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    padding-left: 10px;
    padding-right: 10px;
}

.kb-info-row:last-child {
    border-bottom: none;
}

.kb-info-row strong {
    color: #2c3e50;
    font-weight: 600;
    min-width: 150px;
    font-size: 0.95rem;
}

.kb-info-row span {
    color: #495057;
    text-align: right;
    flex: 1;
    margin-left: 15px;
    font-size: 0.9rem;
}

/* Badge per versione e difficoltà */
.kb-version-badge {
    background: linear-gradient(135deg, #0073aa, #00a0d2);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3);
}

.kb-difficulty-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.kb-difficulty-beginner {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.kb-difficulty-intermediate {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: white;
}

.kb-difficulty-advanced {
    background: linear-gradient(135deg, #fd7e14, #e83e8c);
    color: white;
}

.kb-difficulty-expert {
    background: linear-gradient(135deg, #dc3545, #6f42c1);
    color: white;
}

/* Responsive per informazioni avanzate */
@media (max-width: 768px) {
    .kb-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        text-align: left;
    }
    
    .kb-info-row strong {
        min-width: auto;
    }
    
    .kb-info-row span {
        text-align: left;
        margin-left: 0;
    }
    
    .kb-advanced-info {
        padding: 15px;
    }
}
