/* ==========================================================================
   ESTATE IN-HOUSE NOTIFICATION, ALERT MODAL & TOAST SYSTEM
   ========================================================================== */

:root {
    --estate-dialog-zindex: 10500;
    --estate-toast-zindex: 10600;
    --estate-font: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* -------------------------------------------------------------
   1. DIALOG MODAL BACKDROP & CONTAINER
   ------------------------------------------------------------- */
.estate-dialog-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: var(--estate-dialog-zindex);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
    font-family: var(--estate-font);
}

.estate-dialog-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.estate-dialog-box {
    background: #ffffff;
    border-radius: 1.25rem;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.06);
    transform: scale(0.92) translateY(10px);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s ease;
    overflow: hidden;
    position: relative;
}

.estate-dialog-backdrop.active .estate-dialog-box {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Dialog Header & Icon Pill */
.estate-dialog-header {
    padding: 1.75rem 1.75rem 0.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.estate-dialog-icon {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    border-radius: 50% !important;
    aspect-ratio: 1 / 1 !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.08);
}

.estate-dialog-icon.danger {
    background: #fee2e2;
    color: #dc2626;
    border: 3px solid #fecaca;
}

.estate-dialog-icon.warning {
    background: #fef3c7;
    color: #d97706;
    border: 3px solid #fde68a;
}

.estate-dialog-icon.info {
    background: #e0f2fe;
    color: #0284c7;
    border: 3px solid #bae6fd;
}

.estate-dialog-icon.success {
    background: #dcfce7;
    color: #16a34a;
    border: 3px solid #bbf7d0;
}

.estate-dialog-icon.prompt,
.estate-dialog-icon.primary {
    background: #e0e7ff;
    color: #4f46e5;
    border: 3px solid #c7d2fe;
}

.estate-dialog-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
    line-height: 1.35;
}

.estate-dialog-message {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
    line-height: 1.55;
    padding: 0 0.5rem;
    word-break: break-word;
}

/* Dialog Body (Prompt Inputs) */
.estate-dialog-body {
    padding: 1rem 1.75rem 0.25rem 1.75rem;
}

.estate-dialog-input,
.estate-dialog-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: #0f172a;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 0.75rem;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.estate-dialog-input:focus,
.estate-dialog-textarea:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.estate-dialog-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Dialog Footer & Action Buttons */
.estate-dialog-footer {
    padding: 1.25rem 1.75rem 1.75rem 1.75rem;
    display: flex;
    gap: 0.75rem;
}

.estate-dialog-btn {
    flex: 1;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 0.85rem;
    cursor: pointer;
    border: none;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    outline: none;
}

.estate-dialog-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4);
}

.estate-dialog-btn-cancel {
    background: #f1f5f9;
    color: #475569;
}

.estate-dialog-btn-cancel:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.estate-dialog-btn-danger {
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.estate-dialog-btn-danger:hover {
    background: #b91c1c;
}

.estate-dialog-btn-warning {
    background: #d97706;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

.estate-dialog-btn-warning:hover {
    background: #b45309;
}

.estate-dialog-btn-primary {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.estate-dialog-btn-primary:hover {
    background: #1d4ed8;
}

.estate-dialog-btn-success {
    background: #16a34a;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

.estate-dialog-btn-success:hover {
    background: #15803d;
}

/* -------------------------------------------------------------
   2. FLOATING TOAST NOTIFICATION CONTAINER & CARDS
   ------------------------------------------------------------- */
.estate-toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: var(--estate-toast-zindex);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-width: 400px;
    width: calc(100vw - 2.5rem);
    pointer-events: none;
    font-family: var(--estate-font);
}

.estate-toast-card {
    pointer-events: auto;
    background: #ffffff;
    border-radius: 1rem;
    padding: 0.9rem 1.1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    position: relative;
    overflow: hidden;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.estate-toast-card.show {
    transform: translateX(0);
    opacity: 1;
}

.estate-toast-card.hide {
    transform: translateX(120%);
    opacity: 0;
}

.estate-toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.estate-toast-card.success .estate-toast-icon {
    background: #dcfce7;
    color: #16a34a;
}

.estate-toast-card.error .estate-toast-icon,
.estate-toast-card.danger .estate-toast-icon {
    background: #fee2e2;
    color: #dc2626;
}

.estate-toast-card.warning .estate-toast-icon {
    background: #fef3c7;
    color: #d97706;
}

.estate-toast-card.info .estate-toast-icon {
    background: #e0f2fe;
    color: #0284c7;
}

.estate-toast-content {
    flex: 1;
    min-width: 0;
}

.estate-toast-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.15rem 0;
    line-height: 1.3;
}

.estate-toast-text {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
    word-break: break-word;
}

.estate-toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background-color 0.15s;
    flex-shrink: 0;
}

.estate-toast-close:hover {
    color: #334155;
    background: #f1f5f9;
}

/* Progress Bar at bottom of Toast */
.estate-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: rgba(0, 0, 0, 0.04);
}

.estate-toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    transition: transform linear;
}

.estate-toast-card.success .estate-toast-progress-bar { background: #16a34a; }
.estate-toast-card.error .estate-toast-progress-bar,
.estate-toast-card.danger .estate-toast-progress-bar { background: #dc2626; }
.estate-toast-card.warning .estate-toast-progress-bar { background: #d97706; }
.estate-toast-card.info .estate-toast-progress-bar { background: #0284c7; }

/* -------------------------------------------------------------
   3. IN-HOUSE NOTIFICATION BADGE & PULSE UTILITIES
   ------------------------------------------------------------- */
.estate-notif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    border-radius: 9999px;
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.estate-notif-badge-pill {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    border: 2px solid #ffffff;
}

@media (max-width: 480px) {
    .estate-dialog-box {
        max-width: 100%;
        border-radius: 1rem;
    }
    .estate-toast-container {
        top: 0.75rem;
        right: 0.75rem;
        width: calc(100vw - 1.5rem);
    }
}
