/* Dashboard styles */
body {
    font-size: 0.875rem;
    background-color: #f8f9fa;
}

/* Login overlay */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
}

#loginModal .modal-dialog {
    max-width: 400px;
    margin: 1.75rem auto;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

/* Main content should not overlap with sidebar on desktop */
@media (min-width: 768px) {
    main {
        margin-left: 16.666667%; /* col-md-2 width */
    }
    
    @media (min-width: 992px) {
        main {
            margin-left: 16.666667%; /* col-lg-2 width */
        }
    }
}

.sidebar .nav-link {
    font-weight: 500;
    color: #adb5bd;
    padding: 0.75rem 1rem;
    margin-bottom: 0.2rem;
}

.sidebar .nav-link:hover {
    color: #fff;
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link i {
    margin-right: 4px;
    color: #adb5bd;
}

.sidebar .nav-link.active i,
.sidebar .nav-link:hover i {
    color: #fff;
}

/* Main content */
main {
    padding-top: 1.5rem;
}

/* Cards */
.card {
    margin-bottom: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: none;
}

.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    font-weight: 500;
}

/* Tables */
.table {
    margin-bottom: 0;
}

/* Pagination */
.pagination {
    margin-top: 1rem;
    margin-bottom: 0;
}

/* Status badges */
.badge-status {
    padding: 0.35em 0.65em;
    font-size: 0.85em;
    border-radius: 0.25rem;
}

/* Status colors */
.status-active, .status-initiated {
    background-color: #0d6efd;
    color: white;
}

.status-completed {
    background-color: #198754;
    color: white;
}

.status-cancelled {
    background-color: #dc3545;
    color: white;
}

.status-pending, .status-payment_sent {
    background-color: #ffc107;
    color: black;
}

.status-payment_confirmed {
    background-color: #0dcaf0;
    color: black;
}

.status-disputed {
    background-color: #dc3545;
    color: white;
}

.status-open {
    background-color: #dc3545;
    color: white;
}

.status-resolved_buyer, .status-resolved_seller {
    background-color: #198754;
    color: white;
}

/* Forms */
.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Button styles */
.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* Modal styles */
.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.modal-content {
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Navigation toggle button */
#sidebarToggleBtn {
    display: none;
    cursor: pointer;
    z-index: 1050;
    padding: 5px 8px;
    font-size: 1.2rem;
    border-radius: 4px;
    position: relative;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 80%;
        height: 100%;
        z-index: 1040;
        background-color: #212529;
        overflow-y: auto;
        transition: all 0.3s ease;
        padding-top: 48px;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
        transform: translateX(0);
    }
    
    .sidebar.d-none {
        transform: translateX(-100%);
        display: block !important;
        visibility: hidden;
    }
    
    /* Mobile navigation button (fixed at bottom right) */
    #mobileNavBtn {
        display: flex;
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1050;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background-color: #0d6efd;
        color: white;
        border: none;
        box-shadow: 0 2px 5px rgba(0,0,0,0.3);
        align-items: center;
        justify-content: center;
        font-size: 24px;
        transition: all 0.2s ease;
    }
    
    #mobileNavBtn:hover {
        background-color: #0b5ed7;
        transform: scale(1.05);
    }
    
    #mobileNavBtn:active {
        transform: scale(0.95);
    }
    
    #sidebarToggleBtn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        margin-right: 10px;
        font-size: 1.25rem;
        background-color: #f8f9fa;
        border-color: #6c757d;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1050;
    }
    
    /* Make sure header has enough space for toggle button */
    main .d-flex.justify-content-between {
        padding-left: 10px;
    }
    
    #sidebarCloseBtn {
        color: #adb5bd;
        background: transparent;
        border: none;
        font-size: 1.2rem;
    }
    
    #sidebarCloseBtn:hover {
        color: #fff;
    }
    
    .sidebar.d-none {
        display: none !important;
    }
    
    /* Improve table responsiveness on mobile */
    .table-responsive {
        font-size: 0.8rem;
    }
    
    /* Better button spacing on mobile */
    .btn-toolbar .btn {
        margin-bottom: 5px;
    }
    
    /* Adjust card padding on mobile */
    .card-body {
        padding: 0.75rem;
    }
    
    /* Ensure headers are visible and clear on mobile */
    main h1.h2 {
        font-size: 1.5rem;
    }
}