/* Enhanced Messenger Error Display Styles */

.tk-messenger-error {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
    border: 2px solid #ff6b6b;
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    display: flex;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15);
    animation: slideIn 0.3s ease-out;
}

/* RTL Support for Arabic */
.tk-messenger-error[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

.tk-messenger-error[dir="rtl"] .tk-error-icon {
    order: 2;
}

/* Error Icon */
.tk-error-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: #ff6b6b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.tk-error-icon i::before {
    content: "⚠";
    font-style: normal;
}

/* Error Content */
.tk-error-content {
    flex: 1;
    min-width: 0;
}

.tk-error-title {
    margin: 0 0 10px 0;
    color: #d32f2f;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.tk-error-message {
    margin: 0 0 12px 0;
    color: #5f1414;
    font-size: 14px;
    line-height: 1.6;
}

/* Reasons List */
.tk-error-reasons {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    padding: 12px;
}

.tk-error-reasons li {
    color: #721c1c;
    font-size: 13px;
    line-height: 1.8;
    padding: 4px 0;
    position: relative;
}

/* RTL bullet points */
.tk-messenger-error[dir="rtl"] .tk-error-reasons li {
    text-align: right;
}

/* Solution */
.tk-error-solution {
    margin: 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.8);
    border-left: 4px solid #ff6b6b;
    border-radius: 4px;
    color: #5f1414;
    font-size: 14px;
    line-height: 1.6;
}

.tk-messenger-error[dir="rtl"] .tk-error-solution {
    border-left: none;
    border-right: 4px solid #ff6b6b;
}

.tk-error-solution strong {
    color: #d32f2f;
    font-weight: 600;
}

/* Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Inline Error Message (for chat bubbles) */
.tk-message.tk-error-message {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%) !important;
    border: 1px solid #ff6b6b !important;
    color: #721c1c !important;
    padding: 12px 16px !important;
    position: relative;
}

.tk-message.tk-error-message::before {
    content: "⚠";
    position: absolute;
    top: 8px;
    left: 12px;
    color: #ff6b6b;
    font-size: 16px;
}

.tk-message.tk-error-message[dir="rtl"]::before {
    left: auto;
    right: 12px;
}

.tk-message.tk-error-message .tk-error-text {
    padding-left: 24px;
    display: block;
}

.tk-message.tk-error-message[dir="rtl"] .tk-error-text {
    padding-left: 0;
    padding-right: 24px;
}

/* Compact Error (for notifications) */
.tk-error-compact {
    background: #fff5f5;
    border: 1px solid #ff6b6b;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #721c1c;
}

.tk-error-compact .tk-error-icon {
    width: 20px;
    height: 20px;
    background: #ff6b6b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
}

/* Dark Mode Support */
.tk-dark-mode .tk-messenger-error {
    background: linear-gradient(135deg, #3d1f1f 0%, #2d1515 100%);
    border-color: #ff8a8a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tk-dark-mode .tk-error-title {
    color: #ff8a8a;
}

.tk-dark-mode .tk-error-message,
.tk-dark-mode .tk-error-reasons li,
.tk-dark-mode .tk-error-solution {
    color: #ffd4d4;
}

.tk-dark-mode .tk-error-reasons {
    background: rgba(0, 0, 0, 0.3);
}

.tk-dark-mode .tk-error-solution {
    background: rgba(0, 0, 0, 0.4);
    border-left-color: #ff8a8a;
}

.tk-dark-mode .tk-messenger-error[dir="rtl"] .tk-error-solution {
    border-right-color: #ff8a8a;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .tk-messenger-error {
        padding: 15px;
        gap: 12px;
    }
    
    .tk-error-icon {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    .tk-error-title {
        font-size: 15px;
    }
    
    .tk-error-message,
    .tk-error-solution {
        font-size: 13px;
    }
    
    .tk-error-reasons li {
        font-size: 12px;
    }
}