/* ============================================ */
/* SELLNOW VERSION 1 - RESPONSIVE STYLES        */
/* Developed By Global Tech                     */
/* Mobile-First Responsive Design               */
/* ============================================ */

/* ============================================ */
/* EXTRA SMALL DEVICES (Phones < 576px)         */
/* ============================================ */
@media (max-width: 575.98px) {
    .sidebar {
        width: 85%;
        max-width: 300px;
        position: fixed;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 4rem;
    }
    
    .navbar-brand {
        font-size: 1.125rem;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
    
    .product-card img {
        height: 140px;
    }
    
    .product-card .price {
        font-size: 1rem;
    }
    
    .wallet-balance {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        font-size: 0.8125rem;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 0.5rem 0.625rem;
        white-space: nowrap;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-lg {
        padding: 0.625rem 1.25rem;
        font-size: 1rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .store-card img {
        width: 60px;
        height: 60px;
    }
    
    .pagination .page-link {
        padding: 0.375rem 0.625rem;
        font-size: 0.8125rem;
    }
    
    .card-header {
        padding: 0.875rem 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .row.g-4 {
        --bs-gutter-y: 1rem;
    }
    
    .col-6 {
        width: 50%;
    }
    
    .d-flex.flex-wrap.gap-1 {
        gap: 0.25rem !important;
    }
    
    .dropdown-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        border-radius: 12px 12px 0 0 !important;
        max-height: 60vh;
        overflow-y: auto;
    }
}

/* ============================================ */
/* SMALL DEVICES (Large Phones 576px - 767px)   */
/* ============================================ */
@media (min-width: 576px) and (max-width: 767.98px) {
    .sidebar {
        width: 240px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1.25rem;
        padding-top: 4rem;
    }
    
    .product-card img {
        height: 160px;
    }
    
    .wallet-balance {
        font-size: 1.75rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ============================================ */
/* MEDIUM DEVICES (Tablets 768px - 991px)       */
/* ============================================ */
@media (min-width: 768px) and (max-width: 991.98px) {
    .sidebar {
        width: 240px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
        padding-top: 4rem;
    }
    
    .product-card img {
        height: 180px;
    }
    
    .container {
        max-width: 720px;
    }
}

/* ============================================ */
/* LARGE DEVICES (Laptops 992px - 1199px)       */
/* ============================================ */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .sidebar {
        width: 260px;
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 260px;
    }
    
    .sidebar-toggle {
        display: none;
    }
    
    .container {
        max-width: 960px;
    }
    
    .product-card img {
        height: 190px;
    }
}

/* ============================================ */
/* EXTRA LARGE DEVICES (Desktops 1200px+)       */
/* ============================================ */
@media (min-width: 1200px) {
    .sidebar {
        width: 280px;
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 280px;
    }
    
    .sidebar-toggle {
        display: none;
    }
    
    .container {
        max-width: 1140px;
    }
    
    .product-card img {
        height: 220px;
    }
}

/* ============================================ */
/* ULTRA WIDE SCREENS (1400px+)                 */
/* ============================================ */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .product-card img {
        height: 250px;
    }
}

/* ============================================ */
/* HIGH DPI SCREENS                             */
/* ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ============================================ */
/* DARK MODE PREFERENCE                         */
/* ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #0F0F0F;
        --primary-light: #1A1A1A;
        --primary-lighter: #2A2A2A;
    }
}

/* ============================================ */
/* LANDSCAPE MOBILE                             */
/* ============================================ */
@media (max-width: 767.98px) and (orientation: landscape) {
    .modal-dialog {
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .sidebar {
        max-height: 100vh;
        overflow-y: auto;
    }
}

/* ============================================ */
/* SPECIFIC COMPONENT RESPONSIVE FIXES          */
/* ============================================ */

/* Dashboard widgets */
@media (max-width: 575.98px) {
    .stat-card {
        margin-bottom: 0.5rem;
    }
    
    .stat-card .display-6 {
        font-size: 1.5rem;
    }
}

/* Order details */
@media (max-width: 767.98px) {
    .order-details .row > div {
        margin-bottom: 0.75rem;
    }
}

/* Campaign marketplace grid */
@media (max-width: 575.98px) {
    .campaign-grid .col-6 {
        width: 100%;
    }
}

/* Product grid */
@media (max-width: 575.98px) {
    .product-grid .col-6 {
        width: 100%;
    }
}

/* Form layouts */
@media (max-width: 575.98px) {
    .form-row .col-md-6 {
        margin-bottom: 0.625rem;
    }
}

/* Table responsiveness */
@media (max-width: 767.98px) {
    .table-responsive table {
        min-width: 600px;
    }
}

/* Navbar responsiveness */
@media (max-width: 991.98px) {
    .navbar-nav {
        padding: 0.5rem 0;
    }
    
    .nav-link {
        padding: 0.625rem 1rem;
    }
    
    .navbar .dropdown-menu {
        border: none;
        background: transparent;
        padding-left: 1rem;
    }
    
    .navbar .dropdown-item {
        color: var(--secondary-dark);
        padding: 0.5rem 1rem;
    }
}

/* Footer responsiveness */
@media (max-width: 767.98px) {
    .footer {
        padding: 2rem 0 1rem;
        margin-top: 2rem;
    }
    
    .footer .col-md-2,
    .footer .col-md-4 {
        margin-bottom: 1.5rem;
    }
}

/* Modal responsiveness */
@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 0.25rem;
    }
    
    .modal-content {
        border-radius: 8px;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem;
    }
}

/* Auth pages */
@media (max-width: 575.98px) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-container .card-body {
        padding: 1.5rem !important;
    }
}

/* AI widget responsiveness */
@media (max-width: 400px) {
    .ai-widget .ai-chat-window {
        width: 100vw;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
        z-index: 1060;
    }
}

/* Pagination responsiveness */
@media (max-width: 575.98px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Alert responsiveness */
@media (max-width: 575.98px) {
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.8125rem;
    }
}