/* Mobile Responsive Styles for ProjectLib */

/* Base responsive utilities */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Mobile breakpoints */
@media (max-width: 768px) {
    /* Typography */
    body {
        font-size: 14px !important;
    }
    
    h1 {
        font-size: 24px !important;
    }
    
    h2 {
        font-size: 20px !important;
    }
    
    h3 {
        font-size: 18px !important;
    }
    
    /* Container padding */
    .container,
    .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Navigation */
    .navbar {
        padding: 10px 15px !important;
    }
    
    .navbar-brand {
        font-size: 18px !important;
    }
    
    .nav-link {
        padding: 10px !important;
        font-size: 14px !important;
    }
    
    /* Grids - Make them single column on mobile */
    .trending-grid,
    .udemy-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        padding: 0 15px !important;
    }
    
    /* Cards */
    .card,
    .trending-card,
    .udemy-card {
        margin-bottom: 16px !important;
    }
    
    /* Buttons */
    .btn {
        padding: 10px 20px !important;
        font-size: 14px !important;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .btn-group {
        flex-direction: column !important;
    }
    
    .btn-group .btn {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 8px !important;
    }
    
    /* Forms */
    .form-control {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 12px !important;
    }
    
    .form-group {
        margin-bottom: 15px !important;
    }
    
    /* Modals */
    .modal-dialog {
        margin: 10px !important;
        max-width: calc(100% - 20px) !important;
    }
    
    .modal-content {
        border-radius: 12px !important;
    }
    
    /* Tables - Make them scrollable */
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    table {
        font-size: 12px !important;
    }
    
    /* Images */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Video Player Modal */
    .video-modal video {
        max-height: 50vh !important;
    }
    
    .video-modal .close-video-btn {
        top: 10px !important;
        right: 10px !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 20px !important;
    }
    
    /* Project Cards */
    .project-card,
    .udemy-card-image {
        height: 180px !important;
    }
    
    /* Marketplace sections */
    .marketplace-header {
        padding: 20px 15px !important;
    }
    
    .section-title {
        font-size: 20px !important;
    }
    
    /* Dashboard */
    .dashboard-card {
        padding: 15px !important;
        margin-bottom: 15px !important;
    }
    
    /* Stats */
    .stat-card {
        padding: 15px !important;
    }
    
    .stat-value {
        font-size: 24px !important;
    }
    
    /* Footer */
    footer {
        padding: 20px 15px !important;
    }
    
    footer .col-md-3,
    footer .col-md-4 {
        margin-bottom: 20px !important;
    }
    
    /* Filters */
    .filter-section {
        padding: 15px !important;
    }
    
    .filter-buttons {
        flex-wrap: wrap !important;
    }
    
    .filter-buttons .btn {
        flex: 1 1 calc(50% - 8px) !important;
        min-width: calc(50% - 8px) !important;
        margin: 4px !important;
    }
    
    /* Spacing utilities */
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    .mt-5 {
        margin-top: 2rem !important;
    }
    
    .p-5 {
        padding: 1.5rem !important;
    }
    
    /* Hide on mobile */
    .d-none-mobile {
        display: none !important;
    }
    
    /* Sidebar */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 80% !important;
        height: 100vh !important;
        background: white !important;
        z-index: 9999 !important;
        transition: left 0.3s ease !important;
        overflow-y: auto !important;
    }
    
    .sidebar.active {
        left: 0 !important;
    }
    
    /* Notifications */
    #toast-container {
        right: 10px !important;
        top: 70px !important;
        max-width: calc(100% - 20px) !important;
    }
    
    .toast-notification {
        padding: 12px 16px !important;
        font-size: 14px !important;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    
    .page-item .page-link {
        padding: 8px 12px !important;
        font-size: 14px !important;
    }
}

/* Tablet breakpoint */
@media (min-width: 769px) and (max-width: 1024px) {
    .trending-grid,
    .udemy-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 20px !important;
    }
}

/* Small mobile (iPhone SE, etc) */
@media (max-width: 375px) {
    body {
        font-size: 13px !important;
    }
    
    h1 {
        font-size: 20px !important;
    }
    
    .btn {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }
    
    .filter-buttons .btn {
        flex: 1 1 100% !important;
        min-width: 100% !important;
    }
}

/* Touch-friendly targets */
@media (hover: none) and (pointer: coarse) {
    /* Make all clickable elements easier to tap */
    a,
    button,
    .btn,
    [role="button"],
    input[type="submit"],
    input[type="button"] {
        min-height: 44px !important;
        min-width: 44px !important;
    }
    
    /* Increase padding for better tap targets */
    .nav-link,
    .dropdown-item {
        padding: 12px 16px !important;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .video-modal video {
        max-height: 70vh !important;
    }
    
    .modal-dialog {
        max-width: 90% !important;
    }
}

/* Print styles */
@media print {
    .navbar,
    .sidebar,
    .footer,
    .btn,
    .video-modal,
    #toast-container {
        display: none !important;
    }
    
    body {
        font-size: 12pt !important;
        color: #000 !important;
        background: #fff !important;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
}

/* Fix for iOS Safari bottom bar */
@supports (-webkit-touch-callout: none) {
    .modal-dialog {
        min-height: -webkit-fill-available;
    }
}
