/* 
   ============================================================
   CUSTOM GLASSMORPHIC UI — custom-toast.css
   CustoMingle CRM · Notification & Modal System
   ============================================================ 
*/

#toast-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 15px;
    pointer-events: none;
}

.custom-toast {
    pointer-events: auto;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    transform: translateY(40px) scale(0.96);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    opacity: 0;
}

.custom-toast.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.custom-toast.hide {
    transform: translateY(40px) scale(0.96);
    opacity: 0;
}

/* Top Accent Bar */
.custom-toast-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #770084;
}

/* Standard Toast Layout */
.toast-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 20px 18px 20px;
}

/* Icon Styles for Standard Toasts */
.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

/* Content Styles */
.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1f2a44;
    margin-bottom: 2px;
    display: block;
}

.toast-message {
    font-size: 0.85rem;
    color: #58657c;
    line-height: 1.4;
    margin: 0;
}

/* Close Button */
.toast-close {
    background: transparent;
    border: none;
    color: #9ea5b1;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    margin: 0;
    transition: color 0.2s;
    line-height: 1;
}

.toast-close:hover {
    color: #1a1d23;
}

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

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

/* Variants */
.custom-toast-success .toast-icon {
    background: rgba(119, 0, 132, 0.1);
    color: #770084;
}
.custom-toast-success .toast-progress-bar,
.custom-toast-success .custom-toast-top-bar {
    background: #770084;
}

.custom-toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}
.custom-toast-error .toast-progress-bar,
.custom-toast-error .custom-toast-top-bar {
    background: #ef4444;
}

.custom-toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}
.custom-toast-info .toast-progress-bar,
.custom-toast-info .custom-toast-top-bar {
    background: #3b82f6;
}

.custom-toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}
.custom-toast-warning .toast-progress-bar,
.custom-toast-warning .custom-toast-top-bar {
    background: #f59e0b;
}

/* Notification Popup Specific Styles */
.toast-avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f3defc;
    color: #770084;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

.toast-avatar-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.toast-details-col {
    flex: 1;
    min-width: 0;
}

.toast-meta-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.toast-sender-name {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.toast-time-label {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 400;
}

.toast-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    margin: 0;
    transition: color 0.15s ease;
}

.toast-close-btn:hover {
    color: #475569;
}

.toast-subject-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin: 2px 0 6px 0;
    line-height: 1.3;
}

.toast-body-text {
    font-size: 13px;
    color: #64748b;
    line-height: 1.45;
    margin: 0 0 14px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.toast-footer-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.toast-action-btn {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 13.5px;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.toast-action-reply {
    color: #770084;
    font-weight: 700;
}

.toast-action-reply:hover {
    opacity: 0.85;
}

.toast-action-read {
    color: #94a3b8;
    font-weight: 500;
}

.toast-action-read:hover {
    color: #64748b;
}

/* Dark Mode Support (if user-theme is dark) */
.dark-theme .custom-toast {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-theme .toast-title {
    color: #f8fafc;
}

.dark-theme .toast-message {
    color: #94a3b8;
}

/* ── Confirmation Modal ── */
.custom-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.custom-confirm-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.custom-confirm-modal {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 15px 35px rgba(31, 42, 68, 0.1);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-confirm-overlay.show .custom-confirm-modal {
    transform: scale(1);
}

.confirm-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
}

.confirm-icon.icon-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.confirm-icon.icon-success {
    background: rgba(119, 0, 132, 0.1);
    color: #770084;
}

.confirm-icon.icon-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.confirm-icon.icon-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.confirm-icon.icon-primary {
    background: rgba(119, 0, 132, 0.1);
    color: #770084;
}

.confirm-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2a44;
    margin-bottom: 8px;
}

.confirm-message {
    font-size: 0.95rem;
    color: #58657c;
    line-height: 1.5;
    margin-bottom: 28px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    flex: 1;
    max-width: 200px;
}

.confirm-btn-cancel {
    background: #f4f6fb;
    border: 1px solid #e4e9f1;
    color: #4d5b75;
}

.confirm-btn-cancel:hover {
    background: #e9ecef;
}

.confirm-btn-confirm, .confirm-btn-primary, .confirm-btn-success {
    background: linear-gradient(135deg, #770084 0%, #8a1cc5 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(119, 0, 132, 0.3);
}

.confirm-btn-confirm:hover, .confirm-btn-primary:hover, .confirm-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(119, 0, 132, 0.4);
}

.confirm-btn-error, .confirm-btn-danger {
    background: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(225, 29, 72, 0.3);
}

.confirm-btn-error:hover, .confirm-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(225, 29, 72, 0.4);
}

.confirm-btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.confirm-btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

/* Dark Mode Support */
.dark-theme .custom-confirm-modal {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.dark-theme .confirm-title { color: white; }
.dark-theme .confirm-message { color: #94a3b8; }
.dark-theme .confirm-btn-cancel { background: rgba(255, 255, 255, 0.1); color: white; }
