/* Internal Linking and Navigation Styles */

/* Related Links Section */
.related-links {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.related-links h3 {
    color: #2c3e50;
    font-size: 1.2em;
    margin-bottom: 15px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.related-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-links-list li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.related-links-list li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #3498db;
    font-weight: bold;
}

.related-links-list a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.related-links-list a:hover {
    color: #3498db;
    text-decoration: underline;
}

/* Breadcrumb Navigation */
.breadcrumb {
    background: transparent;
    padding: 10px 0;
    margin-bottom: 20px;
    border-radius: 0;
    font-size: 0.9em;
}

.breadcrumb-item {
    color: #6c757d;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6c757d;
    padding: 0 8px;
}

.breadcrumb-item a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #2c3e50;
    font-weight: 500;
}

/* Contextual Menu */
.contextual-menu {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.contextual-menu h4 {
    color: #2c3e50;
    font-size: 1.1em;
    margin-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 8px;
}

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

.contextual-menu li {
    margin-bottom: 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.contextual-menu li:hover {
    background-color: #f8f9fa;
}

.contextual-menu li.active {
    background-color: #e3f2fd;
    border-left: 3px solid #3498db;
    padding-left: 10px;
}

.contextual-menu a {
    display: block;
    padding: 8px 12px;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.contextual-menu a:hover {
    color: #3498db;
    background-color: #f8f9fa;
}

/* Footer Links */
.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 40px 0;
}

.footer-link-category h4 {
    color: #2c3e50;
    font-size: 1.1em;
    margin-bottom: 15px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.footer-link-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-link-category li {
    margin-bottom: 8px;
}

.footer-link-category a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9em;
}

.footer-link-category a:hover {
    color: #3498db;
}

/* Sitemap Links */
.sitemap-links {
    padding: 40px 0;
}

.sitemap-links h2 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 40px;
    font-size: 2em;
}

.sitemap-section {
    margin-bottom: 30px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sitemap-section h3 {
    color: #2c3e50;
    font-size: 1.3em;
    margin-bottom: 15px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.sitemap-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.sitemap-section li {
    padding: 5px 0;
}

.sitemap-section a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9em;
}

.sitemap-section a:hover {
    color: #3498db;
    text-decoration: underline;
}

/* Table of Contents */
.table-of-contents {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    position: sticky;
    top: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.table-of-contents h3 {
    color: #2c3e50;
    font-size: 1.1em;
    margin-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 8px;
}

.table-of-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.table-of-contents li {
    margin-bottom: 5px;
}

.table-of-contents .toc-level-1 {
    padding-left: 0;
}

.table-of-contents .toc-level-2 {
    padding-left: 15px;
}

.table-of-contents .toc-level-3 {
    padding-left: 30px;
}

.table-of-contents a {
    color: #2c3e50;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
    display: block;
    padding: 3px 0;
}

.table-of-contents a:hover {
    color: #3498db;
}

/* Navigation Enhancement */
.nav-enhancement {
    position: relative;
}

.nav-enhancement::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #3498db;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-enhancement:hover::after,
.nav-enhancement.active::after {
    width: 100%;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .footer-links {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sitemap-section ul {
        grid-template-columns: 1fr;
    }
    
    .table-of-contents {
        position: static;
        max-height: none;
    }
    
    .contextual-menu {
        margin: 15px 0;
        padding: 15px;
    }
    
    .related-links {
        margin: 20px 0;
        padding: 15px;
    }
}

/* RTL Support */
[dir="rtl"] .related-links-list li:before {
    content: "←";
    right: 0;
    left: auto;
}

[dir="rtl"] .related-links-list li {
    padding-right: 20px;
    padding-left: 0;
}

[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    content: "‹";
}

[dir="rtl"] .contextual-menu li.active {
    border-right: 3px solid #3498db;
    border-left: none;
    padding-right: 10px;
    padding-left: 0;
}

/* Accessibility */
.related-links a:focus,
.contextual-menu a:focus,
.footer-link-category a:focus,
.sitemap-section a:focus,
.table-of-contents a:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .related-links,
    .contextual-menu,
    .table-of-contents {
        break-inside: avoid;
    }
    
    .sitemap-links {
        page-break-before: always;
    }
}