/* DataTables Responsive Styling */
.dataTables_wrapper{
    margin-bottom: 20px !important;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-bottom: 10px;
}

/* Custom Checkbox Styling */
.styled-checkbox {
    width: 20px;
    height: 20px;
    appearance: none;
    background-color: #fff;
    border: 2px solid #007bff;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.styled-checkbox:checked {
    background-color: #007bff;
    border-color: #007bff;
    position: relative;
}

.styled-checkbox:checked::after {
    content: '✔';
    color: #fff;
    font-size: 14px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-striped-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.checkbox-striped-wrapper:hover {
    background-color: #f5f5f5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Table Styling */
.table th, .table td {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: #f9f9f9;
}

/* Badge Styling */
.badge {
    font-size: 0.75em;
    padding: 0.5em 0.75em;
}

/* Progress Bar Styling */
.progress {
    border-radius: 0.375rem;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
    font-size: 0.75rem;
    line-height: 1.5;
}

/* Modal Enhancements */
.custom-modal-1-inner {
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}

.custom-modal-1-inner h3 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

/* Form Styling */
.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

/* Button Styling */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

/* Card Styling */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .right {
        margin-top: 20px;
    }
    
    .table-responsive {
        border: none;
    }
    
    .btn-group-sm .btn {
        padding: 0.125rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .custom-modal-1-dialog {
        max-width: 95%;
        margin: 1rem auto;
    }
    
    .custom-modal-1-inner {
        padding: 15px;
    }
    
    .row .col-md-6,
    .row .col-md-4,
    .row .col-md-3 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .d-flex.align-items-center.justify-content-between {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .d-flex.align-items-center.justify-content-between .btn {
        margin-top: 10px;
        width: 100%;
    }
    
    .table th,
    .table td {
        font-size: 0.875rem;
        padding: 0.5rem;
    }
    
    .progress {
        height: 1.5rem;
    }
    
    .progress-bar {
        font-size: 0.7rem;
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #007bff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Multi-select Styling */
select[multiple] {
    min-height: 120px;
}

select[multiple] option {
    padding: 5px;
}

select[multiple] option:checked {
    background-color: #007bff;
    color: white;
}

/* Status Badge Colors */
.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-info {
    background-color: #17a2b8 !important;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
}

.badge.bg-primary {
    background-color: #007bff !important;
}

/* Action Buttons */
.action-buttons {
    white-space: nowrap;
}

.action-buttons .btn {
    margin-right: 5px;
}

.action-buttons .btn:last-child {
    margin-right: 0;
}

/* Responsive Table */
@media (max-width: 768px) {
    .table-responsive table {
        font-size: 0.8rem;
    }
    
    .table-responsive th,
    .table-responsive td {
        min-width: 100px;
    }
    
    .action-buttons .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
}

/* Form Row Spacing */
.row .py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Improved Focus States */
.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Toast Notification Style (if implementing custom toast) */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background-color: white;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

.toast.warning {
    border-left: 4px solid #ffc107;
}

.toast.info {
    border-left: 4px solid #17a2b8;
}