/* Access Right Page Styles */

.access-right-section {
    margin-bottom: 24px;
}

/* Selection Card */
.selection-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 24px;
}

.selection-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.selection-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selection-item label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.selection-item label i {
    color: #556ee6;
    font-size: 16px;
}

.custom-select-wrapper {
    position: relative;
}

.user-search-input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.user-search-input:focus {
    outline: none;
    border-color: #556ee6;
    box-shadow: 0 0 0 3px rgba(85, 110, 230, 0.1);
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #74788d;
    pointer-events: none;
}

.custom-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 4px;
}

.custom-dropdown.show {
    display: block;
}

.dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item.selected {
    background-color: #e7f0ff;
    color: #556ee6;
}

.selected-display {
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #e7f0ff;
    border-radius: 6px;
    font-size: 14px;
    color: #556ee6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.selected-display i {
    cursor: pointer;
}

/* Roles Card */
.roles-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 24px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.roles-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.role-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 16px;
    background-color: #f8f9fa;
    border-radius: 6px;
    transition: all 0.3s;
    user-select: none;
}

.role-checkbox-label:hover {
    background-color: #e9ecef;
}

.role-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #556ee6;
}

.role-checkbox-label span {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

/* Permissions Card */
.permissions-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 24px;
}

.permissions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.permissions-actions {
    display: flex;
    gap: 12px;
}

.permissions-actions .btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.permissions-actions .btn-primary {
    background-color: #556ee6;
    color: white;
}

.permissions-actions .btn-primary:hover {
    background-color: #4858d4;
}

.permissions-actions .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.permissions-actions .btn-secondary:hover {
    background-color: #5a6268;
}

/* Permissions Grid */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.permission-category {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e9ecef;
}

.category-header {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-header i {
    color: #556ee6;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.permission-item:last-child {
    border-bottom: none;
}

.permission-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #556ee6;
}

.permission-item input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Highlight permission items that are auto-selected from roles */
.permission-item input[type="checkbox"]:checked:disabled {
    accent-color: #28a745;
}

.permission-item:has(input[type="checkbox"]:checked:disabled) {
    background-color: #e8f5e9;
    border-radius: 4px;
    padding: 10px 8px;
    margin: 0 -8px;
}

.permission-item:has(input[type="checkbox"]:checked:disabled) label {
    color: #28a745;
    font-weight: 500;
}

.permission-item label {
    flex: 1;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    margin: 0;
    font-weight: 400;
}

.permission-item label:hover {
    color: #556ee6;
}

/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 16px;
}

.loader {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #556ee6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-container p {
    color: #74788d;
    font-size: 14px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #74788d;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #dee2e6;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* Save Section */
.save-section {
    display: flex;
    justify-content: flex-end;
    padding: 20px 0;
}

.btn-save {
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #556ee6;
    color: white;
}

.btn-save:hover {
    background-color: #4858d4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(85, 110, 230, 0.3);
}

.btn-save:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .permissions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .selection-row {
        grid-template-columns: 1fr;
    }

    .permissions-grid {
        grid-template-columns: 1fr;
    }

    .permissions-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .permissions-actions {
        width: 100%;
        flex-direction: column;
    }

    .permissions-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

