﻿/* ===== AI Chat Styles ===== */

/* Main Container */
.ai-chat-container {
    height: 85vh;
    display: flex;
    font-family: 'IBMPlexSansArabic', sans-serif;
    background: #ffffff;
}

/* Natural ChatGPT-style input area */
.ai-input-area {
    background: #ffffff;
    border-top: 1px solid #e5e5e5;
    padding: 16px 24px;
    flex-shrink: 0;
}

/* ===== Sidebar Styles ===== */
.ai-chat-sidebar {
    width: 260px;
    background: #f7f7f8;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.ai-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.ai-new-chat-btn {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.ai-new-chat-btn:hover {
    background: #f3f4f6;
    border-color: #00928f;
}

.ai-conversations-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.ai-conversation-item {
    padding: 12px 16px;
    margin: 2px 8px;
    border-radius: 8px;
    cursor: pointer;
    color: #374151;
    transition: all 0.2s ease;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border: 1px solid transparent;
}

.ai-conversation-item:hover {
    background: #f3f4f6;
}

.ai-conversation-item.active {
    border: 1px solid #00928f;
    background: #f0fdfa;
}

/* ===== Main Chat Area ===== */
.ai-main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 85vh;
    overflow: hidden;
}

.ai-chat-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    background: white;
    flex-shrink: 0;
}

.ai-chat-title {
    margin: 0;
    color: white;
    font-size: 20px;
    font-weight: 300;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.ai-messages-container {
    flex: 1;
    overflow-y: auto;
    background: #ffffff;
    min-height: 0;
    padding: 16px 0;
}

/* Welcome Screen */
.ai-welcome-screen {
    text-align: center;
    padding: 60px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.ai-welcome-icon {
    font-size: 64px;
    margin-bottom: 24px;
    color: #00928f;
}

.ai-welcome-icon i {
    font-size: 5rem;
    color: #00928f;
}

.ai-welcome-title {
    color: #374151;
    margin-bottom: 16px;
    font-size: 28px;
    font-weight: 600;
}

.ai-welcome-subtitle {
    color: #6b7280;
    margin-bottom: 40px;
    font-size: 16px;
}

.ai-suggestions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.ai-suggestion-btn {
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #374151;
}

.ai-suggestion-btn:hover {
    background: #f3f4f6;
    border-color: #00928f;
    transform: translateY(-1px);
}

/* ===== Message Styles ===== */
.ai-message-wrapper {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.ai-message-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.ai-message-container.user {
    flex-direction: row-reverse;
}

.ai-message-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.ai-message-avatar i {
    font-size: 18px;
}

.ai-message-avatar.robot i {
    color: #00928f;
}

.ai-message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-message-bubble.user {
    background: #00928f;
    color: #fff;
}

.ai-message-bubble.assistant {
    background: #f7f7f8;
    color: #374151;
}

.ai-message-bubble.typing {
    background: #f7f7f8;
    color: #6b7280;
    font-style: italic;
}

/* ===== Input Area ===== */
.ai-input-container {
    display: flex;
    max-width: 768px;
    margin: 0 auto;
    align-items: center;
    position: relative;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ai-message-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    resize: none;
    max-height: 120px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    padding: 12px 16px;
    background: transparent;
    border-radius: 0;
    cursor: text;
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ai-message-input::-webkit-scrollbar {
    display: none;
}

.ai-message-input:hover,
.ai-message-input:focus,
.ai-message-input:active {
    border: none !important;
    outline: none !important;
}

.ai-message-input:disabled {
    background: transparent;
    cursor: not-allowed;
    color: #9ca3af;
}

.ai-message-input:disabled::placeholder {
    color: #d1d5db;
}

.ai-input-container:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.ai-input-container:focus-within,
.ai-input-container.focused {
    border-color: #00928f !important;
    box-shadow: 0 0 0 2px rgba(0, 146, 143, 0.1) !important;
    transform: translateY(-1px);
}

.ai-message-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.ai-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #00928f 0%, #007a78 100%);
    color: white;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 8px;
    box-shadow: 0 4px 12px rgba(0, 146, 143, 0.3);
}

.ai-send-btn:hover {
    background: linear-gradient(135deg, #007a78 0%, #006d6a 100%);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 146, 143, 0.4);
}

.ai-send-btn:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, #006d6a 0%, #005f5c 100%);
}

.ai-send-btn:disabled {
    background: #e5e7eb;
    cursor: not-allowed;
    color: #9ca3af;
    box-shadow: none;
}

.ai-send-btn:disabled i {
    color: #9ca3af;
}

.ai-send-btn i {
    font-size: 16px;
    transition: color 0.2s ease;
}

.ai-send-btn.has-text {
    background: #00928f;
    color: white;
}

.ai-send-btn.has-text:hover {
    background: #007a78;
    color: white;
    transform: scale(1.05);
}

.ai-send-btn.has-text:active {
    transform: scale(0.95);
    background: #006d6a;
}

/* ===== Typing Indicator ===== */
.ai-typing-indicator {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.ai-typing-dots {
    animation: ai-typing-animation 1.5s infinite;
}

@keyframes ai-typing-animation {
    0%, 20% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Robot avatar specific styling */
.ai-message-avatar.robot {
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%);
    border-radius: 50%;
    border: 2px solid #00928f20;
}

.ai-message-avatar.user {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 50%;
    border: 2px solid #e2e8f020;
}

.ai-message-avatar.user i {
    color: #374151;
}

/* ===== Loading States ===== */
.ai-loading {
    opacity: 0.6;
    pointer-events: none;
}

.ai-loading .ai-send-btn {
    background: #9ca3af;
}

/* ===== AI Widget Styles ===== */

/* Widget Container */
.ai-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

.ai-chat-icon {
    margin-bottom: 8px;
}

.ai-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 12px;
    background: #00928f;
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 146, 143, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.ai-chat-toggle:hover {
    background: #007a78;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 146, 143, 0.4);
}

/* Chat Window */
.ai-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 400px;
    height: 520px;
    display: none;
    z-index: 1060;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 146, 143, 0.1);
}

.ai-chat-window.show {
    transform: scale(1);
    opacity: 1;
}

/* Widget Chat Header */
.ai-chat-header {
    background: linear-gradient(135deg, #00928f 0%, #007a78 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.ai-chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.ai-avatar {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.ai-avatar i {
    font-size: 20px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.ai-status strong {
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ai-status small {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 400;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ai-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    /* padding: 10px; */
    border-radius: 8px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.ai-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Widget Chat Body */
.ai-chat-body {
    height: calc(100% - 160px);
    overflow-y: auto;
    background: #ffffff;
    padding: 0;
z-index: 999;
position: relative;
}

.ai-chat-messages {
    height: 100%;
    overflow-y: auto;
    padding: 0;
}

/* Widget Welcome Message */
.ai-welcome-message {
    text-align: center;
   /*  padding: 30px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%); */
    margin: 0;
}

.ai-avatar-large {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border: 4px solid #00928f20;
    box-shadow: 0 8px 24px rgba(0, 146, 143, 0.15);
}

.ai-avatar-large i {
    font-size: 36px;
    color: #00928f;
    text-shadow: 0 2px 4px rgba(0, 146, 143, 0.2);
}

/* Widget Suggestions */
.ai-suggestions {
    margin-top: 20px;
}

.suggestion-category {
    margin-bottom: 24px;
}

.suggestion-title {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    text-align: right;
    padding: 0 4px;
}

.suggestion-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
}

.suggestion-buttons .btn {
    font-size: 16px;
    padding: 10px 16px;
    border-radius: 24px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #374151;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

.suggestion-buttons .btn:hover {
    background: #f8fafc;
    border-color: #00928f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 146, 143, 0.15);
}

.btn-login-suggestion {
    background: #00928f !important;
    color: white !important;
    border-color: #00928f !important;
}

.btn-login-suggestion:hover {
    background: #007a78 !important;
}

/* Widget Messages */
.ai-message {
    padding: 14px 18px;
    margin-bottom: 12px;
    border-radius: 16px;
    max-width: 85%;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-message.user {
    background: linear-gradient(135deg, #00928f 0%, #007a78 100%);
    color: white;
    margin-left: auto;
    margin-right: 0;
    box-shadow: 0 4px 12px rgba(0, 146, 143, 0.2);
}

.ai-message.bot {
    background: #f8fafc;
    color: #374151;
    margin-left: 0;
    margin-right: auto;
    border: 1px solid #e5e7eb;
}

.message-content {
    margin-bottom: 4px;
    line-height: 1.4;
}

.message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    opacity: 0.7;
}

.message-time {
    color: inherit;
}

.message-actions {
    display: flex;
    gap: 4px;
}

.btn-copy {
    background: transparent;
    border: none;
    color: inherit;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-copy:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Widget Typing Indicator */
.ai-typing {
    padding: 14px 18px;
    background: #f8fafc;
    color: #6b7280;
    border-radius: 16px;
    margin-bottom: 12px;
    max-width: 85%;
    font-style: italic;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.typing-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-avatar {
    width: 24px;
    height: 24px;
    background: #00928f20;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.typing-avatar i {
    font-size: 12px;
    color: #00928f;
}

.typing-content {
    flex: 1;
}

.typing-text {
    margin-bottom: 4px;
}

.typing-dots {
    display: flex;
    gap: 2px;
}

.typing-dots span {
    width: 4px;
    height: 4px;
    background: #6b7280;
    border-radius: 50%;
    animation: typing-animation 1.5s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-animation {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Widget Chat Footer */
.ai-chat-footer {
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 16px 20px;
    position: relative;
}

.ai-chat-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #e5e7eb 50%, transparent 100%);
}

.ai-chat-footer .ai-input-container {
    max-width: 100%;
    margin: 0;
}

.ai-input {
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    padding: 12px 18px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f8fafc;
    font-weight: 400;
}

.ai-input:focus {
    outline: none;
    border-color: #00928f;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 146, 143, 0.1);
    transform: translateY(-1px);
}

.ai-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* Loading Overlay */
.loadingOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(3px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #e0e0e0;
    border-top-color: #00928f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinnerData {
    margin-top: 15px;
    font-family: 'IBMPlexSansArabic', sans-serif;
    color: #00928f;
    font-size: 16px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/*custom editing*/
.ai-custom-position{
    bottom: 90px; right: 20px; width: 380px; height: 500px; display: none; z-index: 1060; transform: scale(0.8); opacity: 0; transition: 0.3s;
}
/* ===== Responsive Design ===== */
@media (min-width: 1400px) {
    .ai-chat-window {
        width: 420px;
        height: 560px;
    }
    
    .ai-chat-header {
        padding: 24px;
    }
    
    .ai-avatar {
        width: 48px;
        height: 48px;
    }
    
    .ai-avatar i {
        font-size: 22px;
    }
    
    .ai-status strong {
        font-size: 18px;
    }
    
    .ai-status small {
        font-size: 14px;
    }
    
    .ai-avatar-large {
        width: 100px;
        height: 100px;
    }
    
    .ai-avatar-large i {
        font-size: 40px;
    }
    
    .suggestion-buttons .btn {
        font-size: 14px;
        /* padding: 12px 20px; */
    }
}

@media (max-width: 1200px) {
    .ai-chat-window {
        width: 380px;
        height: 500px;
    }
}

@media (max-width: 992px) {
    .ai-chat-window {
        width: 360px;
        height: 480px;
    }
    
    .ai-chat-header {
        padding: 18px;
    }
    
    .ai-avatar {
        width: 40px;
        height: 40px;
    }
    
    .ai-avatar i {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .ai-chat-container {
        flex-direction: column;
        height: 85vh;
    }
    
    .ai-main-chat {
        height: calc(85vh - 60px);
    }
    
    .ai-messages-container {
        padding-bottom: 0;
    }
    
    .ai-input-area {
        padding: 12px 16px;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    }
    
    .ai-message-input {
        font-size: 16px !important;
    }
    
    .ai-chat-sidebar {
        width: 100%;
        height: 60px;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        flex-direction: row;
        overflow-x: auto;
    }
    
    .ai-sidebar-header {
        padding: 8px;
        border-bottom: none;
        border-right: 1px solid #e5e7eb;
    }
    
    .ai-new-chat-btn {
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .ai-conversations-container {
        padding: 4px;
        flex-direction: row;
        overflow-x: auto;
    }
    
    .ai-conversation-item {
        margin: 2px 4px;
        padding: 8px 12px;
        min-width: 120px;
        font-size: 12px;
    }
    
    .ai-suggestions-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .ai-message-bubble {
        max-width: 90%;
        font-size: 13px;
    }
    
    .ai-chat-title {
        font-size: 18px;
    }
    
    /* Widget Mobile Styles */
    .ai-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 20px;
        right: 20px;
        left: 20px;
        border-radius: 16px;
    }
    
    .ai-chat-widget {
        right: 20px;
        bottom: 20px;
    }
    
    .ai-chat-header {
        padding: 16px;
    }
    
    .ai-avatar {
        width: 36px;
        height: 36px;
    }
    
    .ai-avatar i {
        font-size: 16px;
    }
    
    .ai-status strong {
        font-size: 14px;
    }
    
    .ai-status small {
        font-size: 11px;
    }
    
    .ai-avatar-large {
        width: 70px;
        height: 70px;
    }
    
    .ai-avatar-large i {
        font-size: 28px;
    }
    
  /*   .suggestion-buttons .btn {
        font-size: 12px;
        padding: 8px 14px;
    } */
    
    /* RTL Mobile Support */
    [dir="rtl"] .ai-chat-widget {
        left: 20px;
        right: auto;
    }
    
    [dir="rtl"] .ai-chat-window {
        left: 20px;
        right: auto;
    }
    .ai-custom-position{
    bottom: 0; right: 0; width: 380px;
}
}

@media (max-width: 480px) {
    .ai-input-container {
        gap: 5px;
        padding: 5px;
    }
    
    .ai-message-input {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .ai-send-btn {
        width: 32px;
        height: 32px;
    }
    
    .ai-send-btn i {
        font-size: 14px;
    }
    
    .ai-welcome-icon {
        font-size: 48px;
    }
    
    .ai-welcome-title {
        font-size: 24px;
    }
    
    /* Widget Mobile Styles */
    .ai-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        right: 10px;
        left: 10px;
        border-radius: 12px;
    }
    
    .ai-chat-toggle {
        width: 50px;
        height: 50px;
        padding: 10px;
    }
    
    .ai-chat-header {
        padding: 12px;
    }
    
    .ai-avatar {
        width: 32px;
        height: 32px;
    }
    
    .ai-avatar i {
        font-size: 14px;
    }
    
    .ai-status strong {
        font-size: 13px;
    }
    
    .ai-status small {
        font-size: 10px;
    }
    
    .ai-avatar-large {
        width: 60px;
        height: 60px;
    }
    
    .ai-avatar-large i {
        font-size: 24px;
    }
    
  /*   .suggestion-buttons .btn {
        font-size: 11px;
        padding: 6px 10px;
    } */
    
    .ai-input {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .ai-send-btn {
        width: 32px;
        height: 32px;
    }
    
    .ai-send-btn i {
        font-size: 14px;
    }
    
    /* RTL Small Mobile Support */
    [dir="rtl"] .ai-chat-widget {
        left: 10px;
        right: auto;
    }
    
    [dir="rtl"] .ai-chat-window {
        left: 10px;
        right: auto;
    }
    
    [dir="rtl"] .ai-send-btn {
        margin-right: 6px;
        margin-left: 0;
    }
     .ai-custom-position{
    width: 100%;
}
}

@media (max-width: 360px) {
    .ai-chat-window {
        width: calc(100vw - 16px);
        height: calc(100vh - 80px);
        right: 8px;
        left: 8px;
        border-radius: 8px;
    }
    
    .ai-chat-widget {
        right: 8px;
        bottom: 16px;
    }
    
    .ai-chat-toggle {
        width: 48px;
        height: 48px;
        padding: 8px;
    }
    
    .ai-chat-header {
        padding: 10px;
    }
    
    .ai-avatar {
        width: 28px;
        height: 28px;
    }
    
    .ai-avatar i {
        font-size: 12px;
    }
    
    .ai-status strong {
        font-size: 12px;
    }
    
    .ai-status small {
        font-size: 9px;
    }
    
    .ai-avatar-large {
        width: 50px;
        height: 50px;
    }
    
    .ai-avatar-large i {
        font-size: 20px;
    }
    
 /*    .suggestion-buttons .btn {
        font-size: 10px;
        padding: 5px 8px;
    } */
    
    .ai-chat-footer .ai-input-container {
        padding: 3px;
    }
    
    .ai-input {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .ai-send-btn {
        width: 28px;
        height: 28px;
    }
    
    .ai-send-btn i {
        font-size: 12px;
    }
    
    /* RTL Extra Small Mobile Support */
    [dir="rtl"] .ai-chat-widget {
        left: 8px;
        right: auto;
    }
    
    [dir="rtl"] .ai-chat-window {
        left: 8px;
        right: auto;
    }
}

/* Landscape Orientation Support */
@media (max-height: 500px) and (orientation: landscape) {
    .ai-chat-window {
        height: calc(100vh - 40px);
        bottom: 20px;
    }
    
    .ai-chat-body {
        height: calc(100% - 120px);
    }
    
    .ai-chat-header {
        padding: 12px 20px;
    }
    
    .ai-avatar {
        width: 32px;
        height: 32px;
    }
    
    .ai-avatar i {
        font-size: 16px;
    }
    
    .ai-status strong {
        font-size: 14px;
    }
    
    .ai-status small {
        font-size: 11px;
    }
    
    .ai-avatar-large {
        width: 60px;
        height: 60px;
    }
    
    .ai-avatar-large i {
        font-size: 24px;
    }
    
  /*   .ai-welcome-message {
        padding: 20px;
    } */
    
  /*   .suggestion-buttons .btn {
        font-size: 11px;
        padding: 6px 10px;
    } */
    
    .ai-chat-footer {
        padding: 12px 16px;
    }
    
    .ai-chat-footer .ai-input-container {
        padding: 4px;
    }
    
    .ai-input {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .ai-send-btn {
        width: 32px;
        height: 32px;
    }
    
    .ai-send-btn i {
        font-size: 14px;
    }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .ai-chat-window {
        border-width: 0.5px;
    }
    
    .ai-input {
        border-width: 1px;
    }
    
    .suggestion-buttons .btn {
        border-width: 0.5px;
    }
}

/* Print Support */
@media print {
    .ai-chat-widget,
    .ai-chat-window {
        display: none !important;
    }
}

/* Bootstrap Compatibility */
.ai-chat-window .card-header {
    background: transparent;
    border: none;
    padding: 0;
}

.ai-chat-window .card-body {
    background: transparent;
    border: none;
    padding: 0;
}

.ai-chat-window .card-footer {
    background: transparent;
    border: none;
    padding: 0;
}

.ai-chat-window .btn {
    border-radius: inherit;
}

.ai-chat-window .form-control {
    border-radius: inherit;
}

.ai-chat-window .input-group {
    border-radius: inherit;
}

/* Bootstrap RTL Support */
[dir="rtl"] .ai-chat-window .me-3 {
    margin-right: 0 !important;
    margin-left: 1rem !important;
}

[dir="rtl"] .ai-chat-window .ms-2 {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
}

[dir="rtl"] .ai-chat-window .text-end {
    text-align: left !important;
}

[dir="rtl"] .ai-chat-window .text-start {
    text-align: right !important;
}

[dir="rtl"] .ai-chat-window .d-flex {
    flex-direction: row-reverse;
}

[dir="rtl"] .ai-chat-window .justify-content-between {
    flex-direction: row-reverse;
}

[dir="rtl"] .ai-chat-window .align-items-center {
    align-items: center;
}

/* Bootstrap Responsive Utilities */
@media (max-width: 575.98px) {
    .ai-chat-window .d-sm-none {
        display: none !important;
    }
    
    .ai-chat-window .d-sm-block {
        display: block !important;
    }
}

@media (max-width: 767.98px) {
    .ai-chat-window .d-md-none {
        display: none !important;
    }
    
    .ai-chat-window .d-md-block {
        display: block !important;
    }
}

@media (max-width: 991.98px) {
    .ai-chat-window .d-lg-none {
        display: none !important;
    }
    
    .ai-chat-window .d-lg-block {
        display: block !important;
    }
}

/* RTL Support */
[dir="rtl"] .ai-chat-widget {
    right: auto;
    left: 20px;
}

[dir="rtl"] .ai-chat-window {
    right: auto;
    left: 20px;
}

[dir="rtl"] .ai-message.user {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .ai-message.bot {
    margin-left: auto;
    margin-right: 0;
}

[dir="rtl"] .ai-avatar {
    margin-right: 0;
    margin-left: 12px;
}

[dir="rtl"] .ai-status {
    flex-direction: row-reverse;
}

[dir="rtl"] .ai-status strong {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .suggestion-title {
    text-align: left;
}

[dir="rtl"] .suggestion-buttons {
    justify-content: center;
}

[dir="rtl"] .ai-input {
    text-align: right;
}

[dir="rtl"] .ai-send-btn {
    margin-left: 0;
    margin-right: 8px;
}

/*[dir="rtl"] .ai-chat-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .ai-chat-header .d-flex {
    flex-direction: row-reverse;
}*/

[dir="rtl"] .ai-chat-header .gap-2 {
    gap: 8px;
}

[dir="rtl"] .ai-chat-header .gap-2 > * {
    margin-left: 0;
    margin-right: 8px;
}

[dir="rtl"] .ai-chat-header .gap-2 > *:last-child {
    margin-right: 0;
}

/* LTR Support */
[dir="ltr"] .ai-chat-widget {
    left: auto;
    right: 20px;
}

[dir="ltr"] .ai-chat-window {
    left: auto;
    right: 20px;
}

[dir="ltr"] .ai-message.user {
    margin-right: 0;
    margin-left: auto;
}

[dir="ltr"] .ai-message.bot {
    margin-right: auto;
    margin-left: 0;
}

[dir="ltr"] .ai-avatar {
    margin-left: 0;
    margin-right: 12px;
}

[dir="ltr"] .ai-status {
    flex-direction: row;
}

[dir="ltr"] .ai-status strong {
    margin-left: 0;
    margin-right: 8px;
}

[dir="ltr"] .suggestion-title {
    text-align: left;
}

[dir="ltr"] .ai-input {
    text-align: left;
}

[dir="ltr"] .ai-send-btn {
    margin-right: 0;
    margin-left: 8px;
}

/* Dynamic RTL Support */
.ai-chat-widget[style*="left"] {
    right: auto !important;
}

.ai-chat-window[style*="left"] {
    right: auto !important;
}

.ai-chat-widget[style*="right"] {
    left: auto !important;
}

.ai-chat-window[style*="right"] {
    left: auto !important;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .ai-chat-container {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .ai-chat-sidebar {
        background: #2d2d2d;
        border-right-color: #404040;
    }
    
    .ai-messages-container {
        background: #1a1a1a;
    }
    
    .ai-chat-header {
        background: #2d2d2d;
        border-bottom-color: #404040;
    }
    
    .ai-input-area {
        background: #2d2d2d;
        border-top-color: #404040;
    }
    
    .ai-message-bubble.assistant {
        background: #2d2d2d;
        color: #ffffff;
    }
    
    .ai-suggestion-btn {
        background: #2d2d2d;
        color: #ffffff;
        border-color: #404040;
    }
    
    .ai-conversation-item:hover {
        background: #404040;
    }
    
    /* Widget Dark Mode */
    .ai-chat-window {
        background: #1a1a1a;
        color: #ffffff;
        border-color: #404040;
    }
    
    .ai-chat-body {
        background: #1a1a1a;
    }
    
    .ai-chat-footer {
        background: #2d2d2d;
        border-top-color: #404040;
    }
    
   /*  .ai-welcome-message {
        background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    }
     */
    .ai-avatar-large {
        background: linear-gradient(135deg, #404040 0%, #2d2d2d 100%);
        border-color: #00928f40;
    }
    
    .ai-message.bot {
        background: #2d2d2d;
        color: #ffffff;
        border-color: #404040;
    }
    
    .ai-typing {
        background: #2d2d2d;
        color: #9ca3af;
        border-color: #404040;
    }
    
    .ai-input {
        background: #2d2d2d;
        border-color: #404040;
        color: #ffffff;
    }
    
    .ai-input:focus {
        background: #1a1a1a;
        border-color: #00928f;
    }
    
    .ai-input::placeholder {
        color: #9ca3af;
    }
    
    .suggestion-buttons .btn {
        background: #2d2d2d;
        color: #ffffff;
        border-color: #404040;
    }
    
    .suggestion-buttons .btn:hover {
        background: #404040;
        border-color: #00928f;
    }
    
    .suggestion-title {
        color: #ffffff;
    }
}

/* Scrollbar styling */
.ai-messages-container::-webkit-scrollbar,
.ai-chat-body::-webkit-scrollbar {
    width: 4px;
}

.ai-messages-container::-webkit-scrollbar-track,
.ai-chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.ai-messages-container::-webkit-scrollbar-thumb,
.ai-chat-body::-webkit-scrollbar-thumb {
    background: rgba(0, 146, 143, 0.3);
    border-radius: 2px;
}

.ai-messages-container::-webkit-scrollbar-thumb:hover,
.ai-chat-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 146, 143, 0.5);
}

.ai-conversations-container {
    scroll-behavior: smooth;
}

/* Animation for new messages */
.ai-message-wrapper,
.ai-message {
    animation: message-slide-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes message-slide-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Enhanced hover effects for suggestions */
.suggestion-buttons .btn {
    position: relative;
    overflow: hidden;
}

.suggestion-buttons .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.suggestion-buttons .btn:hover::before {
    left: 100%;
}

/* Smooth scrolling for messages */
.ai-messages-container {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Accessibility Improvements */
.ai-message-input:focus {
    outline: 1px solid #00928f;
    outline-offset: 1px;
}

.ai-send-btn:focus,
.ai-suggestion-btn:focus,
.ai-new-chat-btn:focus {
    outline: 2px solid #00928f;
    outline-offset: 2px;
}

.ai-conversation-item:focus {
    outline: 2px solid #00928f;
    outline-offset: -2px;
}