/* Navigation Fluidity Fix */
.top-navigation {
    padding: 1rem !important;
    background: var(--card-background) !important;
    border-bottom: 2px solid var(--border-color) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 998 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
}

.top-navigation .toc-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 0.5rem !important;
}

.top-navigation .toc-item {
    padding: 0.5rem 0.25rem !important;
    gap: 0.25rem !important;
    box-shadow: none !important;
    border: 1px solid var(--border-color) !important;
    transition: all 0.3s ease !important;
}

.top-navigation .toc-item:hover {
    transform: translateY(-2px) !important;
}

.top-navigation .toc-item i {
    font-size: 1.2rem !important;
}

.top-navigation .toc-item span {
    font-size: 0.7rem !important;
    line-height: 1.1 !important;
}

/* Smooth scroll offset */
html {
    scroll-padding-top: 120px !important;
}

/* Section scroll margin */
section[id] {
    scroll-margin-top: 120px !important;
}

/* Reviews banner adjustment */
.reviews-banner {
    position: relative !important;
    top: 0 !important;
}

/* Back to top button z-index */
.back-to-top {
    z-index: 997 !important;
}

@media (max-width: 992px) {
    .top-navigation {
        padding: 0.75rem 0.5rem !important;
    }
    
    .top-navigation .toc-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.4rem !important;
    }
    
    html {
        scroll-padding-top: 100px !important;
    }
    
    section[id] {
        scroll-margin-top: 100px !important;
    }
}

@media (max-width: 768px) {
    .top-navigation {
        padding: 0.6rem 0.4rem !important;
    }
    
    .top-navigation .toc-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.3rem !important;
    }
    
    .top-navigation .toc-item {
        padding: 0.4rem 0.2rem !important;
    }
    
    .top-navigation .toc-item i {
        font-size: 1rem !important;
    }
    
    .top-navigation .toc-item span {
        font-size: 0.6rem !important;
    }
    
    html {
        scroll-padding-top: 80px !important;
    }
    
    section[id] {
        scroll-margin-top: 80px !important;
    }
}

@media (max-width: 480px) {
    .top-navigation .toc-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .top-navigation .toc-item {
        padding: 0.35rem 0.15rem !important;
    }
    
    .top-navigation .toc-item i {
        font-size: 0.9rem !important;
    }
    
    .top-navigation .toc-item span {
        font-size: 0.55rem !important;
    }
}
