/* Roles Management CSS - Matching Clients/Users Table Design */

/* Modal and Form Styling */
.modal-open { 
    font-size: inherit !important; 
}

.modal-open html, .modal-open body { 
    font-size: inherit !important; 
    transform: none !important; 
    zoom: 1 !important;
}

.modal, .modal-dialog, .modal-content { 
    font-size: inherit !important; 
}

.xcrud-modal { 
    font-size: inherit !important; 
}

/* XCRUD Table Styling */
.xcrud-main {
    border-radius: 0.625rem !important;
    box-shadow: 0 0.1rem 1.25rem 0.125rem rgba(0, 0, 0, 0.05) !important;
}

.xcrud-main .card-header {
    padding: 1.5rem !important;
}

.xcrud-main .card-body {
    padding: 1.5rem !important;
}

/* Reduce top padding for search and add button section */
.xcrud-main .card-header.border-0.pt-6 {
    padding-top: 0.75rem !important;
}

/* Reduce spacing between header and table to match left/top padding */
.xcrud-main .card-body.py-4 {
    padding-top: 0.25rem !important;
    padding-bottom: 1.5rem !important;
}

/* Role Table Optimizations - Matching Clients/Users Table */
#kt_roles_table {
    width: 100%;
    border-collapse: collapse;
}

#kt_roles_table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 12px 8px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #6c757d;
}

#kt_roles_table td {
    padding: 12px 8px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

#kt_roles_table tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

/* Role Status Indicators */
.role-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-status.active {
    background-color: #d1e7dd;
    color: #0f5132;
}

.role-status.inactive {
    background-color: #f8d7da;
    color: #721c24;
}

/* Form Field Optimizations */
.form-control-solid {
    background-color: #f5f8fa;
    border-color: #e1e3ea;
    color: #3f4254;
    transition: all 0.2s ease;
}

.form-control-solid:focus {
    background-color: #ffffff;
    border-color: #6200ee;
    box-shadow: 0 0 0 0.2rem rgba(98, 0, 238, 0.25);
}

.form-select-solid {
    background-color: #f5f8fa;
    border-color: #e1e3ea;
    color: #3f4254;
    transition: all 0.2s ease;
}

.form-select-solid:focus {
    background-color: #ffffff;
    border-color: #6200ee;
    box-shadow: 0 0 0 0.2rem rgba(98, 0, 238, 0.25);
}

/* Loading States */
.xcrud-loading {
    position: relative;
    min-height: 200px;
}

.xcrud-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #6200ee;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    #kt_roles_table {
        font-size: 0.875rem;
    }
    
    #kt_roles_table th,
    #kt_roles_table td {
        padding: 8px 4px;
    }
    
    .card-body {
        padding: 1rem !important;
    }
}

@media (max-width: 576px) {
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Performance Optimizations */
.xcrud-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Accessibility Improvements */
.form-label.required::after {
    content: ' *';
    color: #dc3545;
}

.btn:focus {
    outline: 2px solid #6200ee;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .btn,
    .card-toolbar,
    .pagination {
        display: none !important;
    }
    
    .card {
        border: none !important;
        box-shadow: none !important;
    }
    
    #kt_roles_table {
        border: 1px solid #000;
    }
    
    #kt_roles_table th,
    #kt_roles_table td {
        border: 1px solid #000;
        padding: 4px;
    }
}
