/* ============================================================================
   RESPONSIVE DESIGN FIXES FOR COCUISINA
   Optimizes layout for large desktop screens
   ============================================================================ */

/* ===================================
   CONTAINER WIDTH OPTIMIZATION
   Remove Bootstrap's fixed max-width constraint on large screens
   =================================== */

/* Large desktops (1200px and up) - Use more screen space */
@media (min-width: 1200px) {
    .container {
        max-width: 95% !important; /* Use 95% of available width */
    }
}

/* Extra large desktops (1400px and up) - Even more space */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px !important; /* Cap at reasonable reading width */
    }
}

/* Ultra-wide screens (1600px and up) - Cap for readability */
@media (min-width: 1600px) {
    .container {
        max-width: 1500px !important; /* Optimal reading width */
    }
}

/* ===================================
   MAIN CONTAINER OPTIMIZATION
   Ensure content containers also scale
   =================================== */
@media (min-width: 1200px) {
    .main-container {
        max-width: 100%;
        padding: 48px;
    }
}

/* ===================================
   RECIPE GRID OPTIMIZATION
   Better use of horizontal space on large screens
   =================================== */
@media (min-width: 1200px) {
    /* Recipe cards in grid layout */
    .recipe-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 24px;
    }
    
    /* Recipe detail pages - wider content area */
    .recipe-detail-container {
        max-width: 100%;
    }
}

@media (min-width: 1400px) {
    .recipe-grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
        gap: 32px;
    }
}

/* ===================================
   FORM LAYOUT OPTIMIZATION
   Better form layouts on wide screens
   =================================== */
@media (min-width: 1200px) {
    /* Two-column form layouts */
    .form-row-wide {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
    
    /* Onboarding and settings forms */
    .settings-container,
    .profile-container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* ===================================
   NAVIGATION OPTIMIZATION
   Better spacing in navbar on large screens
   =================================== */
@media (min-width: 1200px) {
    .navbar .container {
        max-width: 95% !important;
    }
    
    .navbar-nav .nav-item {
        margin-left: 0.75rem;
        margin-right: 0.75rem;
    }
}

/* ===================================
   MODAL OPTIMIZATION
   Larger modals on big screens
   =================================== */
@media (min-width: 1200px) {
    .modal-lg {
        max-width: 1000px !important;
    }
    
    .modal-xl {
        max-width: 1200px !important;
    }
}

/* ===================================
   CARD DECK OPTIMIZATION
   Better card layouts on wide screens
   =================================== */
@media (min-width: 1200px) {
    .card-deck {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 24px;
    }
    
    .card-deck .card {
        margin-bottom: 0;
    }
}

/* ===================================
   TABLE OPTIMIZATION
   Better table layouts on large screens
   =================================== */
@media (min-width: 1200px) {
    .table-container {
        max-width: 100%;
        overflow-x: visible;
    }
    
    /* Saved recipes table */
    .saved-recipes-table {
        width: 100%;
    }
}

/* ===================================
   HERO SECTION OPTIMIZATION
   Better hero layouts on wide screens
   =================================== */
@media (min-width: 1200px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-content {
        max-width: 800px;
        margin: 0 auto;
    }
}

/* ===================================
   GROUPS PAGE OPTIMIZATION
   Better group layouts on large screens
   =================================== */
@media (min-width: 1200px) {
    .groups-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 24px;
    }
}

/* ===================================
   PRICING PAGE OPTIMIZATION
   Better pricing card layouts
   =================================== */
@media (min-width: 1200px) {
    .pricing-container {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .pricing-cards {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 32px;
        align-items: start;
    }
}

/* ===================================
   SEARCH RESULTS OPTIMIZATION
   Better search result layouts
   =================================== */
@media (min-width: 1200px) {
    .search-results-container {
        max-width: 100%;
    }
    
    .search-results-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 24px;
    }
}

/* ===================================
   PROFILE PAGE OPTIMIZATION
   Better profile layouts on wide screens
   =================================== */
@media (min-width: 1200px) {
    .profile-layout {
        display: grid;
        grid-template-columns: 300px 1fr;
        gap: 32px;
    }
    
    .profile-sidebar {
        position: sticky;
        top: 20px;
    }
}

/* ===================================
   UTILITY CLASSES
   Responsive utility classes for custom layouts
   =================================== */
@media (min-width: 1200px) {
    .w-lg-75 {
        width: 75% !important;
    }
    
    .w-lg-90 {
        width: 90% !important;
    }
    
    .w-lg-95 {
        width: 95% !important;
    }
    
    .max-w-lg-1200 {
        max-width: 1200px !important;
    }
    
    .max-w-lg-1400 {
        max-width: 1400px !important;
    }
}

/* ===================================
   PREVENT OVER-STRETCHING
   Ensure content doesn't become too wide for readability
   =================================== */
@media (min-width: 1800px) {
    .container {
        max-width: 1600px !important;
    }
    
    /* Reading content should never be too wide */
    .content-reading-width {
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ===================================
   FLEXBOX IMPROVEMENTS
   Better flex layouts on large screens
   =================================== */
@media (min-width: 1200px) {
    .d-lg-flex {
        display: flex !important;
    }
    
    .flex-lg-row {
        flex-direction: row !important;
    }
    
    .flex-lg-column {
        flex-direction: column !important;
    }
    
    .justify-content-lg-between {
        justify-content: space-between !important;
    }
    
    .gap-lg-4 {
        gap: 2rem !important;
    }
}
