/**
 * Responsive Fixes for Image Market
 * Addresses issues in mobile and desktop layouts
 */

/* General responsive improvements */
@media (max-width: 768px) {
    .container, .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* Dashboard layout fixes */
@media (min-width: 992px) {
    /* Hide close button in desktop view */
    #closeSidebar {
        display: none !important;
    }
}

@media (max-width: 991px) {
    /* Fix sidebar layout on mobile */
    #sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 260px !important;
        z-index: 1050 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease !important;
    }
    
    #sidebar.active {
        transform: translateX(0) !important;
    }
    
    /* Close button positioning */
    #closeSidebar {
        position: absolute;
        top: 15px;
        right: 15px;
    }
    
    /* Main content full width when sidebar is closed */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Admin Panel Specific */
.admin-content {
    padding: 20px 15px;
    min-height: calc(100vh - 60px);
}

.admin-card {
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

/* User Badge Fixes */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 0.375rem;
}

/* Mobile button icon sizing */
@media (max-width: 576px) {
    .btn-sm .fa, 
    .btn-sm .fas, 
    .btn-sm .far {
        font-size: 0.85rem;
    }
    
    .card-header .btn {
        padding: 0.25rem 0.5rem;
    }
}

/* Table Responsive Improvements */
.table-responsive {
    border-radius: 0.25rem;
    overflow-x: auto;
}

@media (max-width: 768px) {
    .table th, .table td {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
}

/* Live Chat Widget Fixes */
.chat-setup-notice {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #fff3cd;
    color: #856404;
    padding: 10px 15px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 9999;
    max-width: 250px;
    font-size: 0.9rem;
}

.chat-setup-notice a {
    color: #0a58ca;
    text-decoration: underline;
}

/* Wallet Page Responsive Adjustments */
@media (max-width: 576px) {
    .plan-card {
        margin-bottom: 15px;
    }
}

/* Form Controls Responsive */
@media (max-width: 576px) {
    .form-control, .form-select {
        font-size: 0.9rem;
        padding: 0.375rem 0.5rem;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
}

/* Fix mobile navigation issues */
@media (max-width: 767px) {
    .navbar-nav {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .navbar-nav .nav-link {
        padding-left: 0;
    }
}

/* Improved toast notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

/* Admin Live Support Chat Styling */
.admin-chat-container {
    height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
}

.admin-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f9f9f9;
}

/* Admin dashboard stats on mobile */
@media (max-width: 767px) {
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .stats-card .card-body {
        padding: 0.75rem;
    }
}

/* Fix double borders on tables */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.025);
}

/* Better contrast for alert messages */
.alert-warning {
    background-color: #fff8e1;
    border-color: #ffe57f;
    color: #b0640a;
}

.alert-info {
    background-color: #e3f2fd;
    border-color: #90caf9;
    color: #0d47a1;
}

.alert-success {
    background-color: #e8f5e9;
    border-color: #a5d6a7;
    color: #2e7d32;
}

.alert-danger {
    background-color: #ffebee;
    border-color: #ef9a9a;
    color: #c62828;
}
