/* RBAC Specific Styles */
.avatar {
    width: 32px;
    height: 32px;
    font-size: 14px;
    font-weight: 600;
}

.permission-cell:hover {
    background-color: #f8f9fa !important;
    transition: background-color 0.2s ease;
}

.permission-icon {
    font-size: 18px;
    transition: all 0.2s ease;
}

.permission-icon:hover {
    transform: scale(1.2);
}

/* Table enhancements */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-hover tbody tr:hover {
    background-color: rgba(65, 84, 241, 0.05);
}

/* Badge enhancements */
.badge {
    padding: 0.35em 0.65em;
    font-size: 0.85em;
    font-weight: 500;
}

/* Card enhancements */
.card-shadow {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* Role type badges */
.badge-system {
    background-color: #ffc107;
    color: #212529;
}

.badge-custom {
    background-color: #0d6efd;
    color: white;
}

/* Permission matrix specific */
.permission-matrix-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .permission-cell {
        padding: 0.25rem !important;
    }

    .permission-icon {
        font-size: 16px;
    }
}

/* Animation for permission changes */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.permission-changed {
    animation: pulse 0.5s ease;
}

/* Role inheritance accordion */
#roleInheritanceAccordion .accordion-button {
    background-color: #f8f9fa;
}

#roleInheritanceAccordion .accordion-button:not(.collapsed) {
    background-color: #e9ecef;
    color: #0d6efd;
}

/* Search input styling */
#userSearch, #roleSearch {
    border-radius: 0.25rem 0 0 0.25rem;
    border-right: 0;
}

#userSearch:focus, #roleSearch:focus {
    z-index: 3;
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Filter dropdown */
.filter-dropdown {
    min-width: 150px;
}

/* Status indicators */
.status-active {
    color: #198754;
}

.status-inactive {
    color: #6c757d;
}

/* Empty state */
.empty-state {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

/* Pagination */
.pagination-sm .page-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Form control enhancements */
.form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Button group styling */
.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 0.25rem 0 0 0.25rem;
}

.btn-group .btn:last-child {
    border-radius: 0 0.25rem 0.25rem 0;
}

/* Modal enhancements */
.modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem;
}

.modal-body {
    padding: 1.5rem;
}

/* Tooltip styling */
.tooltip-inner {
    max-width: 300px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Loading spinner */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #0d6efd;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Code display */
code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 0.2rem;
    font-size: 0.9em;
}

/* Table group divider */
.table-group-divider {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Permission matrix specific */
.permission-matrix-container {
    overflow-x: auto;
    max-width: 100%;
}

.permission-matrix-table {
    min-width: 1200px;
    table-layout: fixed;
}

/* Role badges in tables */
.role-badge {
    display: inline-block;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

/* User avatar in tables */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    margin-right: 0.5rem;
}

/* Responsive table cells */
@media (max-width: 576px) {
    .responsive-cell {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
}
