/**
 * rh_dialogs.css
 * Système exclusif de boîtes de dialogue et alertes en premier plan (In-Page Modals & Toasts)
 * Los Santos Police Department — Division Ressources Humaines
 */

/* ==========================================================================
   BACKDROP & MODALE PRINCIPALE (EN PREMIER PLAN DU SITE)
   ========================================================================== */
.rh-dialog-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 15, 29, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.rh-dialog-backdrop.rh-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.rh-dialog-card {
    background: linear-gradient(150deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 18px;
    box-shadow: 0 25px 65px -10px rgba(0, 0, 0, 0.85), 0 0 30px rgba(56, 189, 248, 0.2);
    width: 100%;
    max-width: 480px;
    padding: 26px 28px;
    color: #f8fafc;
    position: relative;
    transform: scale(0.92) translateY(12px);
    transition: transform 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
}

.rh-dialog-backdrop.rh-active .rh-dialog-card {
    transform: scale(1) translateY(0);
}

/* Variantes selon le type (danger, warning, success, info) */
.rh-dialog-card.type-danger {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 25px 65px -10px rgba(0, 0, 0, 0.85), 0 0 35px rgba(239, 68, 68, 0.25);
}
.rh-dialog-card.type-warning {
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 25px 65px -10px rgba(0, 0, 0, 0.85), 0 0 35px rgba(245, 158, 11, 0.25);
}
.rh-dialog-card.type-success {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 25px 65px -10px rgba(0, 0, 0, 0.85), 0 0 35px rgba(16, 185, 129, 0.25);
}

/* Entête de la boîte de dialogue */
.rh-dialog-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.rh-dialog-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    flex-shrink: 0;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.type-danger .rh-dialog-icon-wrap {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}
.type-warning .rh-dialog-icon-wrap {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.4);
}
.type-success .rh-dialog-icon-wrap {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.4);
}

.rh-dialog-titles {
    flex-grow: 1;
}

.rh-dialog-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    line-height: 1.25;
    letter-spacing: 0.3px;
}

.rh-dialog-subtitle {
    font-size: 0.74rem;
    font-weight: 700;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-top: 3px;
}

.rh-dialog-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.35rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 6px;
    transition: color 0.18s, transform 0.18s;
}
.rh-dialog-close-btn:hover {
    color: #ffffff;
    transform: scale(1.15);
}

/* Corps du message */
.rh-dialog-body {
    font-size: 0.95rem;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 22px;
    white-space: pre-line;
    word-break: break-word;
}

/* Champ de saisie pour Prompt */
.rh-dialog-input {
    width: 100%;
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 10px;
    padding: 11px 14px;
    color: #ffffff;
    font-size: 0.95rem;
    margin-top: 12px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.rh-dialog-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

/* Actions / Boutons */
.rh-dialog-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.rh-dialog-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.90rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.rh-dialog-btn-cancel {
    background: #334155;
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.rh-dialog-btn-cancel:hover {
    background: #475569;
    color: #ffffff;
    transform: translateY(-1px);
}

.rh-dialog-btn-primary {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.rh-dialog-btn-primary:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.rh-dialog-btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}
.rh-dialog-btn-danger:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.45);
}

/* ==========================================================================
   TOASTS NOTIFICATIONS EN PREMIER PLAN (ANGLE DU SITE)
   ========================================================================== */
.rh-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000000 !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 380px;
    width: 90%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.rh-toast-item {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    padding: 14px 16px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    animation: rhToastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.25s, transform 0.25s;
    backdrop-filter: blur(10px);
}

.rh-toast-item.type-success {
    border-color: rgba(16, 185, 129, 0.4);
}
.rh-toast-item.type-danger {
    border-color: rgba(239, 68, 68, 0.4);
}
.rh-toast-item.type-warning {
    border-color: rgba(245, 158, 11, 0.4);
}

.rh-toast-item.rh-toast-hiding {
    opacity: 0;
    transform: translateX(30px);
}

.rh-toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    color: #38bdf8;
}
.type-success .rh-toast-icon { color: #10b981; }
.type-danger .rh-toast-icon { color: #ef4444; }
.type-warning .rh-toast-icon { color: #f59e0b; }

.rh-toast-content {
    flex-grow: 1;
    font-size: 0.88rem;
    line-height: 1.4;
    color: #cbd5e1;
}

.rh-toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.rh-toast-close:hover {
    color: #ffffff;
}

@keyframes rhToastIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
