﻿
/*
 * RolesDialogs.css
 * 
 * This stylesheet contains styles for dialog windows and popups related to roles and permissions.
 * 
 * Note on stylesheet decision:
 * I've opted for a separate, non-scoped CSS file for these styles due to the nested nature
 * of the components involved. Scoped CSS was attempted but proved problematic with deeply
 * nested component structures. This global stylesheet approach allows us to effectively 
 * style child components and override third-party component styles where necessary.
 *
 * Key points:
 * - Styles are specific to add/edit role dialogs, role popups, and delete confirmation dialogs
 *
 */

/* Add a Role dialog window in Roles and Permissions page */
.add-role-window-dialog .k-window-content {
    display: flex;
    flex-direction: column;
    padding: 16px;
    height: 100%;
}

.add-role-window-dialog .k-form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Adds red asterisk before required fields */
.add-role-window-dialog label::before {
    content: "*";
    color: #f31700;
    font-size: 14px;
    font-weight: 400;
    line-height: 150%;
    margin-left: 2px;
    margin-right: 2px;
}

/* Dialog Footer Button Container
   Positions buttons at bottom with border */
.add-role-window-dialog .k-form-buttons.k-actions-start {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    gap: 8px;
    padding: 8px;
    margin-top: auto; /* This pushes the buttons down */
    margin-left: -16px; /* Compensate for parent padding */
    margin-right: -16px; /* Compensate for parent padding */
    padding-left: 16px; /* Add back padding just for the content */
    margin-bottom: -16px; /* Remove bottom space */
}

.add-role-window-dialog [class*="validation-error"] {
    color: #F31700 !important;
}

/* Copy and Delete Roles from the Roles and Permissions page */

/* Rule to remove extra border in popup window on the left-upper corner */
.role-popup .k-popup {
    margin: 0;
    padding: 0;
    border: 0;
}

/* Popup container styling with shadow */
.role-popup .popup-content {
    padding: 4px 0;
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.08);
    position: absolute;
    box-shadow: 0px 8px 10px rgba(0, 0, 0, 0.12), 0px 4px 16px rgba(0, 0, 0, 0.12);
}

/* Menu item base styles */
.role-popup .menu-item {
    padding: 8px 16px;
    cursor: pointer;
}

/* Menu item hover state */
.role-popup .menu-item:hover {
    background: #F5F5F5;
}

/* Delete option styling */
.role-popup .delete-item {
    color: #F31700;
}

.role-popup .menu-item.delete-item.k-invalid {
    color: #F77F54;
    cursor: not-allowed;
}

.delete-confirmation-window .k-window-content {
    padding-block: 0;
    padding-inline: 0;
}

.delete-message-container {
    padding: 16px;
    text-align: center;
    padding-top: 30px;
}

.delete-message-container span:last-child {
    font-weight: 700;
    line-height: 20px;
}

.delete-confirmation-buttons {
    display: flex;
    padding: 8px;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    position: absolute;
    bottom: 0;
    width: 100%;
}

.delete-confirmation-buttons .k-button {
    width: 138px;
}
