/* Admin Mobile Responsive Styles - MOBILE ONLY */
/* These styles ONLY apply to screens 768px and below */

/* Mobile viewport optimization - MOBILE ONLY */
@media (max-width: 768px) {
    /* Body and container adjustments */
    body {
        font-size: 14px;
        overflow-x: hidden;
    }
    
    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* Navbar improvements */
    .navbar-brand {
        font-size: 0.9rem !important;
        white-space: nowrap;
    }
    
    .navbar-brand img {
        height: 30px !important;
        margin-right: 5px !important;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    /* Navbar collapse improvements */
    .navbar-collapse {
        background: rgba(0, 0, 0, 0.1);
        padding: 0.5rem;
        border-radius: 0.5rem;
        margin-top: 0.5rem;
    }
    
    /* Sidebar mobile menu */
    #mobileSidebar .card {
        margin-bottom: 1rem;
    }
    
    #mobileSidebar .list-group-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Main content full width on mobile ONLY */
    .col-lg-10, .col-md-9, .col-lg-2, .col-md-3 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* Section headers */
    .admin-section h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    /* Cards */
    .card {
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Stats cards - full width on mobile */
    .row .col-lg-3,
    .row .col-lg-4,
    .row .col-md-6 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
        margin-bottom: 0.75rem;
    }
    
    /* Tables */
    .table-responsive {
        font-size: 0.8rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 600px;
    }
    
    .table td, .table th {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    /* Buttons */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        min-height: 44px;
    }
    
    .btn-sm {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        min-height: 38px;
    }
    
    /* Forms */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px;
        padding: 0.5rem 0.75rem;
    }
    
    textarea.form-control {
        min-height: 100px;
    }
    
    /* Modals */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Badges */
    .badge {
        font-size: 0.75rem;
        padding: 0.4em 0.8em;
    }
    
    /* Alerts */
    #alertContainer {
        position: fixed;
        top: 60px;
        left: 5px;
        right: 5px;
        z-index: 9999;
    }
    
    /* Admin section headers */
    .admin-section h2 {
        font-size: 1.25rem;
        font-weight: 600;
        margin-bottom: 1rem;
    }
    
    /* Dashboard overview */
    #dashboardSection .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
    
    /* Better padding for main content */
    .container-fluid.py-4 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    /* Admin Users Page */
    .admin-container {
        padding: 10px;
        margin: 10px auto;
    }
    
    .admin-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .admin-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
        gap: 1rem;
    }
    
    .admin-item > div:last-child {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }
    
    .admin-item .btn {
        flex: 1;
        margin: 0;
    }
}

/* Small mobile devices (phones in portrait) - MOBILE ONLY */
@media (max-width: 576px) {
    body {
        font-size: 13px;
    }
    
    .navbar-brand {
        font-size: 0.85rem !important;
        max-width: 55%;
    }
    
    .navbar-brand img {
        height: 25px !important;
    }
    
    .admin-section h2 {
        font-size: 1.1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Landscape orientation - MOBILE ONLY */
@media (max-width: 768px) and (orientation: landscape) {
    .container-fluid.py-4 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    
    .admin-section h2 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
}

/* Touch device optimizations - MOBILE ONLY */
@media (hover: none) and (pointer: coarse) {
    .btn, .list-group-item-action, a {
        min-height: 44px;
    }
    
    * {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

/* DESKTOP PROTECTION - Ensure desktop layout is NOT affected */
@media (min-width: 769px) {
    /* Reset any mobile overrides for desktop */
    .col-lg-10, .col-md-9 {
        width: auto !important;
        flex: 0 0 auto !important;
        max-width: none !important;
    }
    
    .col-lg-2, .col-md-3 {
        width: auto !important;
        flex: 0 0 auto !important;
        max-width: none !important;
    }
    
    .row .col-lg-3,
    .row .col-lg-4,
    .row .col-md-6 {
        width: auto !important;
        flex: 0 0 auto !important;
        max-width: none !important;
    }
    
    /* Ensure desktop sidebar is visible */
    .d-none.d-md-block {
        display: block !important;
    }
    
    /* Fix desktop grid layout */
    .row {
        display: flex !important;
        flex-wrap: wrap !important;
    }
    
    /* Restore proper column widths on desktop */
    .col-lg-2 {
        flex: 0 0 16.666667% !important;
        max-width: 16.666667% !important;
    }
    
    .col-lg-3 {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }
    
    .col-lg-4 {
        flex: 0 0 33.333333% !important;
        max-width: 33.333333% !important;
    }
    
    .col-lg-10 {
        flex: 0 0 83.333333% !important;
        max-width: 83.333333% !important;
    }
    
    .col-md-3 {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }
    
    .col-md-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    .col-md-9 {
        flex: 0 0 75% !important;
        max-width: 75% !important;
    }
    
    /* Reset container padding */
    .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* Category Dropdown - Consistent Black Text Color */
.dropdown-menu {
    color: #000 !important;
    background-color: #fff !important;
}

.dropdown-menu .dropdown-item {
    color: #000 !important;
}

.dropdown-menu .dropdown-item:hover {
    color: #000 !important;
    background-color: #f8f9fa !important;
}

/* Override any colored text in dropdowns */
.dropdown-menu .dropdown-item i,
.dropdown-menu .dropdown-item span,
.dropdown-menu .dropdown-item * {
    color: #000 !important;
}

/* Dropdown headers should also be black */
.dropdown-header {
    color: #000 !important;
}

/* Remove any icon colors in dropdowns */
.dropdown-menu i.fa,
.dropdown-menu i.fas,
.dropdown-menu i.fab {
    color: #000 !important;
}
