/* 
 * Mobile Hamburger Menu Styles
 */

/* Hamburger Button */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    width: 45px;
    height: 45px;
    background: var(--color-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.hamburger-btn:hover {
    background: var(--color-primary-hover);
}

.hamburger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger Animation */
.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
}

/* Sidebar Mobile Styles */
@media (max-width: 968px) {
    /* Show hamburger button */
    .hamburger-btn {
        display: flex;
    }
    
    /* Hide sidebar by default */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }
    
    /* Show sidebar when active */
    .sidebar.active {
        transform: translateX(0);
    }
    
    /* Show overlay when sidebar is active */
    .sidebar-overlay.active {
        display: block;
    }
    
    /* Adjust main content */
    .main-content {
        margin-left: 0;
        padding-top: 70px;
    }
    
    /* Adjust content width */
    .content-wrapper {
        max-width: 100%;
        padding: 0 15px;
    }
    
    /* Navigation adjustments */
    .nav-list {
        padding-top: 20px;
    }
    
    .nav-item {
        margin: 0;
    }
    
    .nav-link {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .nav-section-title {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* Sidebar footer adjustments */
    .sidebar-footer {
        padding: 20px;
        margin-top: 20px;
    }
}

/* Tablet adjustments */
@media (max-width: 768px) {
    .hamburger-btn {
        width: 40px;
        height: 40px;
    }
    
    .hamburger-btn span {
        width: 20px;
        height: 2px;
    }
    
    .sidebar {
        width: 260px;
    }
    
    .main-content {
        padding-top: 60px;
    }
}

/* Small phone adjustments */
@media (max-width: 480px) {
    .sidebar {
        width: 240px;
    }
    
    .content-wrapper {
        padding: 0 10px;
    }
    
    /* Adjust section styles for mobile */
    .section {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .command-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .command-card {
        padding: 10px;
    }
    
    .command-box, .output-box {
        font-size: 12px;
        padding: 8px;
        overflow-x: auto;
    }
    
    /* Table responsiveness */
    .comparison-table {
        font-size: 12px;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 8px 4px;
    }
    
    /* SVG responsiveness */
    .diagram-container svg {
        max-width: 100%;
        height: auto;
    }
}

/* Focus states for accessibility */
.hamburger-btn:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.nav-link:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

/* Prevent body scroll when sidebar is open */
body.sidebar-open {
    overflow: hidden;
}

@media (max-width: 968px) {
    body.sidebar-open {
        overflow: hidden;
    }
}