/* ========================================
   CHAT NOTIFICATIONS SYSTEM
   Error modals, toasts, inline validation, success animations
   ======================================== */

/* ==================== INLINE ERROR MESSAGES ==================== */

.chat-inline-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 8px;
    margin-bottom: 12px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-inline-error.active {
    opacity: 1;
    transform: translateY(0);
}

.chat-inline-error i {
    font-size: 16px;
    color: #f44336;
    flex-shrink: 0;
}

.chat-inline-error .error-message {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #d32f2f;
    line-height: 1.4;
}

.chat-inline-error .error-dismiss {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-inline-error .error-dismiss:hover {
    background: rgba(244, 67, 54, 0.2);
}

/* Light Theme */
html[data-theme='light'] .chat-inline-error {
    background: rgba(244, 67, 54, 0.08);
    border-color: rgba(244, 67, 54, 0.25);
}

html[data-theme='light'] .chat-inline-error .error-message {
    color: #c62828;
}

/* ==================== ERROR MODAL ==================== */

.chat-error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: 20px;
}

.chat-error-modal.active {
    opacity: 1;
    visibility: visible;
}

.error-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    cursor: pointer;
}

.error-modal-content {
    position: relative;
    z-index: 10001;
    width: 100%;
    max-width: 400px;
    background: #2a2e3a;
    border-radius: 18px;
    padding: 32px 24px 24px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    text-align: center;
}

.chat-error-modal.active .error-modal-content {
    transform: scale(1);
    opacity: 1;
}

.error-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: rgba(244, 67, 54, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: errorPulse 2s ease-in-out infinite;
}

.error-modal-icon i {
    font-size: 32px;
    color: #f44336;
}

@keyframes errorPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.4);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(244, 67, 54, 0);
    }
}

.error-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #e4e6eb;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}

.error-modal-message {
    font-size: 14px;
    color: #b0b3b8;
    line-height: 1.6;
    margin: 0 0 24px;
}

.error-modal-actions {
    display: flex;
    gap: 10px;
}

.error-modal-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
}

.error-btn-primary {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.error-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(244, 67, 54, 0.4);
}

.error-btn-primary:active {
    transform: translateY(0);
}

/* Light Theme */
html[data-theme='light'] .error-modal-content {
    background: #ffffff;
}

html[data-theme='light'] .error-modal-title {
    color: #1c1e21;
}

html[data-theme='light'] .error-modal-message {
    color: #65676b;
}

html[data-theme='light'] .error-modal-overlay {
    background: rgba(0, 0, 0, 0.6);
}

/* ==================== TOAST NOTIFICATIONS ==================== */

.chat-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.chat-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    min-width: 280px;
    max-width: 400px;
}

.chat-toast.active {
    opacity: 1;
    transform: translateX(0);
}

.chat-toast .toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.chat-toast .toast-message {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    flex: 1;
}

/* Toast Types */
.chat-toast-success {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.95), rgba(67, 160, 71, 0.95));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-toast-error {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.95), rgba(211, 47, 47, 0.95));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-toast-warning {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.95), rgba(245, 124, 0, 0.95));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-toast-info {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.95), rgba(25, 118, 210, 0.95));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Light Theme Toasts */
html[data-theme='light'] .chat-toast-success {
    background: linear-gradient(135deg, #4caf50, #43a047);
}

html[data-theme='light'] .chat-toast-error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

html[data-theme='light'] .chat-toast-warning {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

html[data-theme='light'] .chat-toast-info {
    background: linear-gradient(135deg, #2196f3, #1976d2);
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .chat-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .chat-toast {
        min-width: auto;
        max-width: none;
    }
}

/* ==================== SUCCESS ANIMATION (CHECKMARK) ==================== */

.chat-success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.chat-success-overlay.active {
    opacity: 1;
}

.success-checkmark {
    width: 80px;
    height: 80px;
}

.checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #4caf50;
    stroke-miterlimit: 10;
    box-shadow: inset 0 0 0 #4caf50;
}

.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #4caf50;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

/* Light Theme */
html[data-theme='light'] .chat-success-overlay {
    background: rgba(255, 255, 255, 0.95);
}

html[data-theme='light'] .checkmark,
html[data-theme='light'] .checkmark__circle,
html[data-theme='light'] .checkmark__check {
    stroke: #43a047;
}

/* ==================== MOBILE OPTIMIZATIONS ==================== */

@media (max-width: 576px) {
    .error-modal-content {
        max-width: calc(100% - 40px);
        padding: 28px 20px 20px;
    }
    
    .error-modal-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 16px;
    }
    
    .error-modal-icon i {
        font-size: 28px;
    }
    
    .error-modal-title {
        font-size: 18px;
    }
    
    .error-modal-message {
        font-size: 13px;
    }
    
    .success-checkmark,
    .checkmark {
        width: 60px;
        height: 60px;
    }
}

