/* Enhanced Internal Links Styling */
/* Optimizes visual presentation of internal links for better UX and SEO */

/* Contextual Links Section */
.contextual-links-section {
    position: relative;
    z-index: 1;
    clear: both;
    margin: 0;
    padding: 0;
}

.contextual-links-section > div {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    animation: fadeInUp 0.6s ease-out;
    max-width: 100%;
    overflow: hidden;
    position: relative;
}

.contextual-links-section h3 {
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.contextual-links-section h3 i {
    color: #1e40af;
    margin-left: 8px;
    font-size: 1.3rem;
    filter: drop-shadow(0 1px 2px rgba(30, 64, 175, 0.3));
}

/* Contextual Link Buttons */
.contextual-link {
    display: inline-flex;
    align-items: center;
    padding: 14px 24px;
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.4);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.contextual-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.contextual-link:hover::before {
    left: 100%;
}

.contextual-link:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
    border-color: rgba(59, 130, 246, 0.3);
    color: white;
}

.contextual-link i {
    margin-left: 8px;
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.contextual-link:hover i {
    transform: scale(1.1);
}

/* Quick Links in Footer */
.quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border-radius: 12px;
    color: #d1d5db;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.quick-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.quick-link:hover::before {
    transform: scale(1);
}

.quick-link:hover {
    color: white;
    transform: translateY(-4px);
}

.quick-link i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.quick-link:hover i {
    transform: scale(1.2);
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.3);
}

.quick-link span {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    position: relative;
    z-index: 1;
    line-height: 1.2;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 0;
}

.breadcrumb-nav ol {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.875rem;
}

.breadcrumb-nav li {
    display: flex;
    align-items: center;
}

.breadcrumb-nav a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.breadcrumb-nav a:hover {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.breadcrumb-nav span {
    color: #64748b;
    font-weight: 600;
    padding: 4px 8px;
}

.breadcrumb-nav i {
    color: #94a3b8;
    font-size: 0.75rem;
    margin: 0 8px;
}

/* HTML Sitemap Container */
#html-sitemap {
    position: relative;
    z-index: 1;
    clear: both;
    width: 100%;
    margin: 0;
    padding: 0;
}

#html-sitemap.hidden {
    display: none !important;
}

.sitemap-container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    overflow: hidden;
}

/* Related Links Section */
#related-links-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 24px;
}

#related-links-section h4 {
    color: white;
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.25rem;
    font-weight: 700;
}

#related-links-section h4 i {
    color: #60a5fa;
    margin-left: 8px;
}

/* Enhanced Link Hover Effects */
a[data-link-type="internal"] {
    position: relative;
    transition: all 0.3s ease;
}

a[data-link-type="internal"]:hover {
    text-decoration: none;
}

/* Navigation Links Enhancement */
nav a {
    position: relative;
    overflow: hidden;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #10b981, #059669);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .contextual-links-section {
        padding: 16px;
        margin: 24px 0;
    }
    
    .contextual-link {
        font-size: 0.8rem;
        padding: 10px 16px;
        margin-bottom: 8px;
    }
    
    .quick-link {
        padding: 12px 8px;
    }
    
    .quick-link i {
        font-size: 1.25rem;
    }
    
    .quick-link span {
        font-size: 0.75rem;
    }
    
    #related-links-section {
        padding: 16px;
    }
    
    .breadcrumb-nav {
        padding: 8px 0;
    }
    
    .breadcrumb-nav ol {
        font-size: 0.8rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .contextual-links-section {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        border-color: #475569;
        color: #e2e8f0;
    }
    
    .contextual-links-section h3 {
        color: #f1f5f9;
    }
    
    .breadcrumb-nav {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        border-color: #475569;
    }
    
    .breadcrumb-nav a {
        color: #60a5fa;
    }
    
    .breadcrumb-nav a:hover {
        background-color: #1e40af;
        color: #93c5fd;
    }
    
    .breadcrumb-nav span {
        color: #cbd5e1;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles for Keyboard Navigation */
a:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 4px;
}

.contextual-link:focus-visible,
.quick-link:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Link Pulse Effect for Important Links */
.important-link {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

/* Print Styles */
@media print {
    .contextual-links-section,
    #related-links-section,
    .breadcrumb-nav {
        display: none;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}
