/* Admin Credit Allocation Modal Styles */

#adminCreditAllocationModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1050;
    align-items: center;
    justify-content: center;
}

#adminCreditAllocationModal.show {
    display: flex;
}

#adminCreditAllocationModal .modal-dialog {
    max-width: 800px;
    width: 90%;
    margin: 20px;
}

#adminCreditAllocationModal .modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

#adminCreditAllocationModal .modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#adminCreditAllocationModal .modal-title {
    margin: 0;
    color: #333;
    font-size: 1.25rem;
    font-weight: 600;
}

#adminCreditAllocationModal .modal-title i {
    color: #ffc107;
    margin-right: 0.5rem;
}

#adminCreditAllocationModal .btn-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

#adminCreditAllocationModal .btn-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

#adminCreditAllocationModal .modal-body {
    padding: 1.5rem;
}

#adminCreditAllocationModal .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
    text-align: right;
}

/* Search Section */
.admin-search-section .input-group-text {
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    color: #6c757d;
}

.admin-search-section .form-control {
    border-left: none;
}

.admin-search-section .form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Users List */
.users-list {
    max-height: 400px;
    overflow-y: auto;
}

.user-row {
    background-color: #fff;
    transition: all 0.2s;
    border: 1px solid #e9ecef !important;
}

.user-row:hover {
    background-color: #f8f9fa;
    border-color: #007bff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.user-info {
    flex: 1;
}

.user-name {
    color: #333;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.user-email {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.user-role .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.user-credits {
    margin: 0 1rem;
    min-width: 120px;
}

.current-credits {
    font-size: 1.1rem;
    color: #28a745;
    margin-bottom: 0.25rem;
}

.credit-stats {
    font-size: 0.8rem;
    color: #6c757d;
}

.admin-user-select-btn {
    white-space: nowrap;
}

/* Loading and Error States */
.loading-spinner i {
    color: #007bff;
}

.error-message i {
    color: #dc3545;
}

.no-users i {
    color: #6c757d;
}

/* Pagination */
.admin-pagination .pagination {
    margin-bottom: 0;
}

.admin-pagination .page-link {
    color: #007bff;
    border: 1px solid #dee2e6;
    padding: 0.375rem 0.75rem;
}

.admin-pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.admin-pagination .page-link:hover {
    color: #0056b3;
    background-color: #e9ecef;
}

/* Credit Allocation Form */
#admin-credit-form-section {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.selected-user-info {
    margin-bottom: 1rem;
}

.selected-user-card {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: #fff;
    margin-top: 0.5rem;
}

.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.form-control {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0.75rem;
    transition: all 0.2s;
}

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

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
}

.badge-outline-secondary {
    color: #6c757d;
    border: 1px solid #6c757d;
    background: transparent;
}

.badge-outline-primary {
    color: #007bff;
    border: 1px solid #007bff;
    background: transparent;
}

.badge-outline-info {
    color: #17a2b8;
    border: 1px solid #17a2b8;
    background: transparent;
}

.badge-outline-success {
    color: #28a745;
    border: 1px solid #28a745;
    background: transparent;
}

.badge-outline-warning {
    color: #ffc107;
    border: 1px solid #ffc107;
    background: transparent;
}

.badge-outline-danger {
    color: #dc3545;
    border: 1px solid #dc3545;
    background: transparent;
}

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-primary:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    opacity: 0.6;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
    border-color: #545b62;
}

.btn-outline-primary {
    color: #007bff;
    border-color: #007bff;
    background: transparent;
}

.btn-outline-primary:hover {
    background-color: #007bff;
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Success Alert */
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    border: 1px solid transparent;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-success i {
    color: #28a745;
    margin-right: 0.5rem;
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    padding: 0.75rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    #adminCreditAllocationModal .modal-dialog {
        width: 95%;
        margin: 10px;
    }
    
    .user-row {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .user-credits {
        margin: 0;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    #adminCreditAllocationModal .modal-content {
        margin: 10px;
    }
    
    #adminCreditAllocationModal .modal-body {
        padding: 1rem;
    }
    
    .users-list {
        max-height: 300px;
    }
}