/**
 * Mobile Responsive Styles for Edujog
 * Optimized for cPanel shared hosting (no heavy frameworks)
 */

/* Mobile Navigation - Bottom Tab Bar */
@media (max-width: 768px) {
    /* Bottom Navigation Bar */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e5e7eb;
        padding: 0.5rem 0;
        z-index: 50;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0.5rem;
        text-decoration: none;
        color: #6b7280;
        font-size: 0.75rem;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }
    
    .mobile-bottom-nav a.active {
        color: #2563eb;
    }
    
    /* Touch-friendly buttons */
    button, a.button, .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1rem;
    }
    
    /* Form inputs - larger on mobile */
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="date"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        min-height: 44px;
    }
    
    /* Responsive Tables - Card View on Mobile */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Card view for tables on mobile */
    @media (max-width: 640px) {
        .table-card-view {
            display: block;
        }
        
        .table-card-view thead {
            display: none;
        }
        
        .table-card-view tbody,
        .table-card-view tr,
        .table-card-view td {
            display: block;
            width: 100%;
        }
        
        .table-card-view tr {
            margin-bottom: 1rem;
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            padding: 1rem;
            background: white;
        }
        
        .table-card-view td {
            border: none;
            padding: 0.5rem 0;
            text-align: left !important;
        }
        
        .table-card-view td:before {
            content: attr(data-label);
            font-weight: 600;
            display: inline-block;
            width: 40%;
            color: #374151;
        }
        
        .table-card-view td:after {
            content: '';
            display: block;
            margin-bottom: 0.5rem;
        }
    }
    
    /* Collapsible Filters - Accordion Style */
    .filter-accordion {
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .filter-accordion-header {
        padding: 1rem;
        background: #f9fafb;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 44px;
    }
    
    .filter-accordion-content {
        display: none;
        padding: 1rem;
        border-top: 1px solid #e5e7eb;
    }
    
    .filter-accordion.active .filter-accordion-content {
        display: block;
    }
    
    /* Sidebar - Hidden on mobile, show hamburger */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Mobile Menu Overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 40;
        display: none;
    }
    
    .mobile-menu-overlay.active {
        display: block;
    }
    
    /* Grid adjustments */
    .grid {
        grid-template-columns: 1fr !important;
    }
    
    .md\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
    
    .lg\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }
    
    /* Padding adjustments */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Card spacing */
    .card {
        margin-bottom: 1rem;
    }
    
    /* Text sizing */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .sidebar,
    .mobile-bottom-nav,
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* Accessibility - Focus states */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-gray-50 {
        background-color: white;
    }
    
    .text-gray-600 {
        color: #000;
    }
}

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

