/* Estilos específicos para la página de fundamentos de redes */

/* Mejoras visuales para la página de fundamentos de redes */
.networking-fundamentals .article-section {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.networking-fundamentals .article-section:last-child {
    border-bottom: none;
}

.networking-fundamentals .article-section h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1.2rem;
}

.networking-fundamentals .article-section h3 {
    color: var(--text-color-secondary);
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem;
}

.networking-fundamentals .article-section h4 {
    font-size: 1.2rem;
    margin: 1.2rem 0 0.8rem;
    color: var(--text-color);
}

/* Estilos para la sección de evolución de redes (no colapsable) */
.networking-fundamentals #historia .collapsible-section:first-of-type .collapsible-header,
.networking-fundamentals #historia .collapsible-section:first-of-type .collapsible-content {
    display: block;
    max-height: none;
    padding: 1.5rem;
    background-color: var(--bg-primary);
    cursor: default;
}

.networking-fundamentals #historia .collapsible-section:first-of-type .collapsible-header i:last-child {
    display: none;
}

.networking-fundamentals #historia .collapsible-section:first-of-type {
    box-shadow: var(--shadow-sm);
}

.networking-fundamentals #historia .collapsible-section:first-of-type .collapsible-header:hover {
    background-color: var(--bg-primary);
    transform: none;
}

.networking-fundamentals #historia .collapsible-section:first-of-type p {
    margin-bottom: 1rem;
    line-height: 1.6;
    text-align: justify;
}

/* Estilos para la introducción */
.article-intro {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

/* Mejoras para listas */
.networking-fundamentals ul, 
.networking-fundamentals ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.networking-fundamentals li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Estilos para las preguntas frecuentes */
.faq-item {
    margin-bottom: 1.5rem;
    padding: 1.2rem;
    background-color: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.faq-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.faq-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

/* Estilos para artículos relacionados */
.related-articles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Estilos para recursos adicionales */
.resources-grid {
    margin-top: 1.5rem;
}

.resource-card {
    text-align: center;
}

.related-article {
    padding: 1.2rem;
    background-color: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
}

.related-article:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.related-article a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.related-article h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.related-article h3 i {
    color: var(--primary-color);
}

.related-article p {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
}

.related-article::after {
    content: '\f054';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    color: var(--primary-color);
    font-size: 0.8rem;
    opacity: 0.7;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.related-article:hover::after {
    transform: translateX(3px);
    opacity: 1;
}

/* Estilos para la barra lateral */
.sidebar {
    position: sticky;
    top: calc(var(--header-height) + 2rem);
    align-self: flex-start;
    padding: 1.5rem;
    background-color: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-top: 0;
    height: fit-content;
}

.table-of-contents h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.table-of-contents ul {
    list-style: none;
    margin-left: 0;
}

.table-of-contents li {
    margin-bottom: 0.5rem;
}

.table-of-contents a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
    padding: 0.3rem 0;
    border-left: 2px solid transparent;
    padding-left: 0.5rem;
}

.table-of-contents a:hover,
.table-of-contents a.active {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.cta-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    text-align: center;
}

.cta-box h3 {
    color: var(--text-color);
    margin-bottom: 0.8rem;
}

.cta-box p {
    margin-bottom: 1rem;
}

.cta-box .btn-primary,
.cta-box .btn-secondary {
    display: block;
    margin-bottom: 0.5rem;
    padding: 0.6rem 1rem;
}

/* Mostrar secciones de herramientas sin colapsar */
.networking-fundamentals #herramientas .collapsible-header,
.networking-fundamentals #herramientas .collapsible-content {
    display: block;
    max-height: none;
    padding: 1.5rem;
    background-color: var(--bg-primary);
    cursor: default;
}

.networking-fundamentals #herramientas .collapsible-header i:last-child {
    display: none;
}

.networking-fundamentals #herramientas .collapsible-section {
    box-shadow: var(--shadow-sm);
}

.networking-fundamentals #herramientas .collapsible-header:hover {
    background-color: var(--bg-primary);
    transform: none;
}

/* Ajustar iconos de topologías */
.networking-fundamentals #topologias .info-table td:first-child {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.networking-fundamentals #topologias .info-table td:first-child i {
    display: block;
    margin-top: 0.5rem;
}

/* Eliminar fondos verdes de las tarjetas */
.networking-fundamentals .advantage-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
}

.networking-fundamentals .advantage-card:hover {
    border-color: var(--primary-color);
}

/* Layout para pantallas grandes */
@media (min-width: 992px) {
    .content-container {
        display: grid;
        grid-template-columns: 1fr 3fr;
        gap: 2rem;
    }
    
    .sidebar {
        margin-top: 0;
    }
}

/* Responsive */
@media (max-width: 991px) {
    .content-container {
        display: block;
    }
    
    .sidebar {
        position: static;
        margin-top: 2rem;
    }
    
    .related-articles {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .network-components-grid,
    .results-summary,
    .advantages-grid,
    .related-articles {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .network-component-card,
    .summary-card,
    .advantage-card,
    .related-article {
        padding: 1.25rem;
    }
    
    .component-icon {
        font-size: 2rem;
    }
    
    .network-component-card h4 {
        font-size: 1.1rem;
    }
    
    .horizontal-toc-container {
        overflow-x: auto;
    }
    
    .networking-fundamentals .article-section h2 {
        font-size: 1.5rem;
    }
    
    .networking-fundamentals .article-section h3 {
        font-size: 1.2rem;
    }
    
    .article-intro {
        padding: 1rem;
    }
    
    .faq-item,
    .related-article {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .networking-fundamentals .article-section h2 {
        font-size: 1.4rem;
    }
    
    .networking-fundamentals .article-section h3 {
        font-size: 1.2rem;
    }
    
    .toc {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .toc a {
        padding: 0.3rem 0;
    }
}