/* ============================================
   Professional Mobile Styles for Documentation
   ============================================ */

@media (max-width: 1024px) {
    .docs-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .docs-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }
    
    .docs-content {
        margin-left: 0;
        padding: 2rem 1.5rem;
        width: 100%;
    }
    
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        border-radius: 12px;
        background: linear-gradient(135deg, var(--docs-primary) 0%, var(--docs-primary-dark) 100%);
        box-shadow: var(--docs-shadow-lg);
        transition: all 0.3s ease;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-menu-btn:active {
        transform: scale(0.95);
    }
    
    .mobile-menu-btn i {
        font-size: 1.25rem;
        color: white;
    }
    
    /* Overlay when sidebar is open */
    .docs-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        display: none;
    }
    
    .docs-overlay.active {
        display: block;
    }
}

@media (max-width: 768px) {
    
    /* ============================================
       SIDEBAR MOBILE
       ============================================ */
    
    .docs-sidebar {
        width: 280px;
        max-width: 85vw;
        z-index: 100;
    }
    
    .mobile-menu-btn {
        top: 1rem;
        left: 1rem;
    }
    
    /* ============================================
       CONTENT MOBILE OPTIMIZATION
       ============================================ */
    
    .docs-content {
        padding: 1.5rem 1.25rem !important;
    }
    
    .docs-header {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }
    
    .docs-header h1 {
        font-size: 2rem !important;
        line-height: 1.2;
        margin-bottom: 0.75rem;
    }
    
    .docs-subtitle {
        font-size: 1rem !important;
        line-height: 1.6;
    }
    
    /* ============================================
       TYPOGRAPHY MOBILE
       ============================================ */
    
    .docs-content h1 {
        font-size: 1.875rem !important;
        margin-top: 2rem;
        margin-bottom: 1rem;
    }
    
    .docs-content h2 {
        font-size: 1.625rem !important;
        margin-top: 1.75rem;
        margin-bottom: 0.875rem;
    }
    
    .docs-content h3 {
        font-size: 1.375rem !important;
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .docs-content h4 {
        font-size: 1.125rem !important;
        margin-top: 1.25rem;
        margin-bottom: 0.625rem;
    }
    
    .docs-content p {
        font-size: 1rem !important;
        line-height: 1.7;
        margin-bottom: 1rem;
    }
    
    /* ============================================
       CODE BLOCKS MOBILE
       ============================================ */
    
    .docs-content pre {
        padding: 1rem !important;
        border-radius: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.875rem !important;
        line-height: 1.6;
    }
    
    .docs-content code {
        font-size: 0.875rem !important;
        padding: 0.25rem 0.5rem;
        border-radius: 6px;
    }
    
    /* ============================================
       CARDS & SECTIONS MOBILE
       ============================================ */
    
    .docs-section {
        margin-bottom: 2.5rem;
    }
    
    .feature-grid,
    .quick-nav {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }
    
    .feature-card,
    .quick-nav-card {
        padding: 1.5rem !important;
    }
    
    .feature-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.25rem !important;
    }
    
    .feature-card h3,
    .quick-nav-card h3 {
        font-size: 1.125rem !important;
        margin-bottom: 0.5rem;
    }
    
    .feature-card p,
    .quick-nav-card p {
        font-size: 0.9375rem !important;
        line-height: 1.5;
    }
    
    /* ============================================
       BUTTONS MOBILE
       ============================================ */
    
    .docs-content .btn,
    .btn-primary,
    .btn-secondary {
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
        min-height: 48px;
        border-radius: 12px;
        width: 100%;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    /* ============================================
       TABLES MOBILE
       ============================================ */
    
    .docs-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }
    
    .docs-content table thead {
        display: none;
    }
    
    .docs-content table tbody,
    .docs-content table tr,
    .docs-content table td {
        display: block;
        width: 100%;
    }
    
    .docs-content table tr {
        margin-bottom: 1rem;
        border: 1px solid var(--docs-border);
        border-radius: 12px;
        padding: 1rem;
        background: var(--docs-card-bg);
    }
    
    .docs-content table td {
        border: none;
        padding: 0.5rem 0;
        text-align: left;
    }
    
    .docs-content table td::before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
        margin-bottom: 0.25rem;
        color: var(--docs-primary);
    }
    
    /* ============================================
       LISTS MOBILE
       ============================================ */
    
    .docs-content ul,
    .docs-content ol {
        padding-left: 1.5rem;
        margin-bottom: 1.25rem;
    }
    
    .docs-content li {
        margin-bottom: 0.625rem;
        line-height: 1.7;
    }
    
    /* ============================================
       SIDEBAR NAVIGATION MOBILE
       ============================================ */
    
    .docs-nav {
        padding: 1.5rem 1rem;
    }
    
    .docs-nav ul {
        padding-left: 0;
    }
    
    .docs-nav li {
        margin-bottom: 0.5rem;
    }
    
    .docs-nav a {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
        border-radius: 8px;
        display: block;
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
    }
    
    .docs-nav a:hover,
    .docs-nav a.active {
        background: rgba(59, 130, 246, 0.1);
        padding-left: 1.25rem;
    }
    
    /* ============================================
       INSTALLATION STEPS MOBILE
       ============================================ */
    
    .installation-steps {
        padding: 1.5rem !important;
        border-radius: 12px;
    }
    
    .installation-steps ol {
        padding-left: 1.5rem;
    }
    
    .installation-steps li {
        margin-bottom: 1rem;
        line-height: 1.7;
    }
    
    /* ============================================
       SEARCH MOBILE
       ============================================ */
    
    .docs-search {
        margin: 1.5rem 0;
    }
    
    .docs-search input {
        padding: 1rem 1.25rem;
        font-size: 1rem;
        min-height: 48px;
        border-radius: 12px;
    }
    
    /* ============================================
       SECTION INTRO MOBILE
       ============================================ */
    
    .section-intro {
        font-size: 1rem !important;
        line-height: 1.7;
        margin-bottom: 1.5rem;
    }
    
    /* ============================================
       SCROLL BEHAVIOR
       ============================================ */
    
    html {
        scroll-behavior: smooth;
    }
    
    .docs-section {
        scroll-margin-top: 80px;
    }
}

@media (max-width: 480px) {
    
    .docs-content {
        padding: 1.25rem 1rem !important;
    }
    
    .docs-header h1 {
        font-size: 1.75rem !important;
    }
    
    .docs-content h1 {
        font-size: 1.625rem !important;
    }
    
    .docs-content h2 {
        font-size: 1.5rem !important;
    }
    
    .docs-content h3 {
        font-size: 1.25rem !important;
    }
    
    .feature-card,
    .quick-nav-card {
        padding: 1.25rem !important;
    }
    
    .mobile-menu-btn {
        width: 44px;
        height: 44px;
        top: 0.75rem;
        left: 0.75rem;
    }
    
    .docs-sidebar {
        width: 100%;
        max-width: 100vw;
    }
}

/* ============================================
   TOUCH OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .docs-nav a,
    .docs-content .btn,
    .mobile-menu-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .docs-nav a:focus-visible,
    .docs-content .btn:focus-visible {
        outline: 3px solid rgba(59, 130, 246, 0.5);
        outline-offset: 2px;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .docs-sidebar,
    .mobile-menu-btn,
    .docs-overlay {
        transition: none !important;
        animation: none !important;
    }
}

