/* ============================================================
   Notification Admin pages
   Used by:
     - /Admin/Notifications          (NotificationListPage)
     - /Admin/Notifications/Create   (NotificationCreatePage)
     - /Admin/Notifications/Users    (AdminUsersPage)
   ============================================================ */

/* ---------- Shared form label ---------- */
.ess-form-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--ess-color-text-primary, #1f2937);
    margin-bottom: 6px;
}

/* ---------- Target-type picker (NotificationCreatePage) ---------- */
.ess-target-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px solid var(--ess-color-border-default, #d1d5db);
    border-radius: var(--ess-radius-xl, 12px);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    background: var(--ess-color-surface-primary, #fff);
}

.ess-target-option:hover {
    border-color: var(--ess-color-primary, #2e3386);
    background: var(--ess-color-primary-50, #eef0fb);
}

.ess-target-option.selected {
    border-color: var(--ess-color-primary, #2e3386);
    background: var(--ess-color-primary-50, #eef0fb);
    box-shadow: 0 0 0 3px rgba(46, 51, 134, 0.15);
}

.ess-target-option.selected i {
    color: var(--ess-color-primary, #2e3386);
}

/* ---------- Upload zone (banner + attachments) ---------- */
.ess-upload-zone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: 2px dashed var(--ess-color-border-default, #d1d5db);
    border-radius: var(--ess-radius-xl, 12px);
    background: var(--ess-color-surface-secondary, #f9fafb);
    cursor: pointer;
    transition: all 0.2s;
}

.ess-upload-zone:hover {
    border-color: var(--ess-color-primary, #2e3386);
    background: var(--ess-color-primary-50, #eef0fb);
}

.ess-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.ess-upload-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    color: var(--ess-color-text-primary, #1f2937);
    pointer-events: none;
}

.ess-upload-hint small {
    color: var(--ess-color-text-tertiary, #9ca3af);
    font-size: 12px;
}

.ess-upload-status {
    margin-top: 8px;
    color: var(--ess-color-text-secondary, #6b7280);
}

/* ---------- Uploaded banner image preview ---------- */
.ess-uploaded-image {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--ess-color-border-subtle, #e5e7eb);
    border-radius: var(--ess-radius-xl, 12px);
    background: var(--ess-color-surface-primary, #fff);
}

.ess-uploaded-image img {
    max-width: 100%;
    max-height: 240px;
    object-fit: contain;
    border-radius: 8px;
}

.ess-uploaded-image-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    color: var(--ess-color-text-secondary, #6b7280);
}

/* ---------- Attachment list ---------- */
.ess-attachment-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ess-attachment-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--ess-color-border-subtle, #e5e7eb);
    border-radius: 8px;
    background: var(--ess-color-surface-primary, #fff);
}

.ess-attachment-name {
    flex: 1;
    color: var(--ess-color-primary, #2e3386);
    text-decoration: none;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ess-attachment-name:hover {
    text-decoration: underline;
}

.ess-attachment-size {
    font-size: 12px;
    color: var(--ess-color-text-tertiary, #9ca3af);
    white-space: nowrap;
}

/* ---------- Form section headings (Create + AdminUsers pages) ---------- */
.ess-section-heading {
    margin: 0 0 24px 0;
    color: var(--ess-color-primary, #2e3386);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ess-section-heading--compact {
    margin-bottom: 16px;
}

.ess-section-heading i {
    font-size: 18px;
}

.ess-section-heading--lg i {
    font-size: 20px;
}

/* ---------- Required-field marker ---------- */
.ess-required-marker {
    color: var(--ess-color-error, #ef4444);
}

/* ---------- Optional-field marker ---------- */
.ess-optional-marker {
    color: var(--ess-color-text-tertiary, #9ca3af);
}

/* ---------- Hint text under inputs ---------- */
.ess-input-hint {
    font-size: 12px;
    color: var(--ess-color-text-tertiary, #9ca3af);
    margin-top: 4px;
    display: block;
}

/* ---------- Form-actions bar (Create page footer) ---------- */
.ess-form-actions {
    border-top: 2px solid var(--ess-color-border-subtle, #e5e7eb);
    padding-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ---------- Empty-state panel (List page when no notifications) ---------- */
.ess-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.ess-empty-state__icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--ess-color-primary-50, #eef0fb);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.ess-empty-state__icon i {
    font-size: 32px;
    color: var(--ess-color-primary, #2e3386);
}

.ess-empty-state__title {
    color: var(--ess-color-text-primary, #1f2937);
    margin-bottom: 8px;
}

.ess-empty-state__hint {
    color: var(--ess-color-text-secondary, #6b7280);
    margin-bottom: 24px;
}

.ess-empty-state--small {
    text-align: center;
    padding: 40px 20px;
    color: var(--ess-color-text-secondary, #6b7280);
}

/* ---------- Layout helpers ---------- */
.ess-form-container {
    max-width: 900px;
}

.ess-form-container--admin-users {
    max-width: 900px;
    margin-bottom: 24px;
}

.ess-target-row {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.ess-date-input {
    width: 300px;
}

/* ---------- Rich-text editor for the notification body ---------- */
.ess-message-editor {
    width: 100%;
}

.ess-message-editor .rz-html-editor-content {
    min-height: 220px;
    /* Default to RTL because notifications are written in Arabic.
       unicode-bidi: plaintext makes each paragraph auto-pick its direction
       based on the first strong character, so an English-only paragraph
       still flows LTR within the RTL editor. */
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
}

/* ---------- Admin Users grant form row ---------- */
.ess-grant-form-name {
    flex: 1;
    min-width: 200px;
}

.ess-grant-form-role {
    min-width: 160px;
}

.ess-alert-spacer {
    margin-top: 16px;
}

.ess-grid-cell--bold {
    font-weight: 600;
}

/* ---------- Selected employees list (Create page, Specific Employees) ---------- */
.ess-selected-employees {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.ess-selected-employee {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--ess-color-primary-50, #eef0fb);
    border: 1px solid var(--ess-color-primary, #2e3386);
    border-radius: var(--ess-radius-lg, 8px);
    font-size: 13px;
    max-width: 100%;
}

.ess-selected-employee-code {
    font-weight: 600;
    color: var(--ess-color-primary, #2e3386);
    white-space: nowrap;
}

.ess-selected-employee-name {
    color: var(--ess-color-text-primary, #1f2937);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ess-selected-employee-name-ar {
    color: var(--ess-color-text-secondary, #6b7280);
    direction: rtl;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ess-selected-employee-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--ess-color-primary, #2e3386);
    cursor: pointer;
    flex-shrink: 0;
}

.ess-selected-employee-remove:hover {
    background: var(--ess-color-primary, #2e3386);
    color: #fff;
}
