/* ==========================================================================
   RESPONSIVE IMPROVEMENTS FOR NEOHEBERG DOCUMENTATION
   ========================================================================== */

/* Mobile menu overlay and transitions */
@media (max-width: 1024px) {
    .doc-sidebar {
        width: 280px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 50;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
    
    .doc-sidebar.active {
        transform: translateX(0);
    }
    
    .doc-sidebar.active::after {
        content: '';
        position: fixed;
        top: 0;
        right: 0;
        width: calc(100vw - 280px);
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 40;
        pointer-events: none;
        opacity: 1;
        transition: opacity 0.3s ease;
    }
    
    body.overflow-hidden {
        overflow: hidden;
    }
}

/* Very small screens */
@media (max-width: 640px) {
    .doc-sidebar {
        width: 90vw;
    }
    
    .doc-sidebar.active::after {
        width: calc(100vw - 90vw);
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .sidebar-link {
        padding: 0.75rem 1rem;
        margin: 0.25rem 0;
        border-radius: 0.5rem;
    }
    
    .sidebar-link:hover {
        background-color: rgba(38, 0, 255, 0.05);
    }
    
    .mobile-doc-menu {
        -webkit-tap-highlight-color: transparent;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .doc-sidebar {
        border-right-width: 0.5px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .doc-sidebar,
    .sidebar-link::before {
        transition: none !important;
    }
}

/* Landscape mobile optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .doc-sidebar {
        padding-top: 1rem;
        overflow-y: auto;
    }
    
    nav {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .pt-16 {
        padding-top: 3.5rem !important;
    }
}

/* Better focus states for accessibility */
.sidebar-link:focus,
.mobile-doc-menu:focus {
    outline: 2px solid #2600ff;
    outline-offset: 2px;
}

/* Dark mode adjustments */
.dark .sidebar-link {
    color: #d1d5db;
}

.dark .sidebar-link:hover {
    color: white;
}

.dark .sidebar-link.active {
    color: white;
}