/* Hodaya Chat Widget Styles */

.hodaya-chat-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Header */
.hodaya-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hodaya-chat-tabs {
    display: flex;
    gap: 10px;
    flex: 1;
}

/* Sidebar Toggle Button */
.hodaya-sidebar-toggle {
    display: none !important;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    width: 40px;
    height: 40px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
}

.hodaya-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.hodaya-sidebar-toggle .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.hodaya-tab {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.hodaya-tab:hover {
    background: rgba(255, 255, 255, 0.3);
}

.hodaya-tab.active {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
}

/* Body */
.hodaya-chat-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.hodaya-sidebar {
    width: 250px;
    background: #f8f9fa;
    border-left: 1px solid #e0e0e0;
    border-radius: 8px;
    margin: 10px;
    overflow-y: auto;
    position: relative;
}

.hodaya-sidebar-close {
    display: none !important;
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    color: #333;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    z-index: 11;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
}

.hodaya-sidebar-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.hodaya-sidebar-close .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.hodaya-conversations-list {
    padding: 10px;
}

.hodaya-conversation-item {
    background: #ffffff;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border: 1px solid #e0e0e0;
}

.hodaya-conversation-item:hover {
    background: #f0f0f0;
    border-color: #667eea;
}

.hodaya-conversation-item.active {
    background: #667eea;
    color: #ffffff;
    border-color: #667eea;
}

.hodaya-conversation-preview {
    font-size: 13px;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hodaya-conversation-time {
    font-size: 11px;
    color: #999;
}

.hodaya-conversation-item.active .hodaya-conversation-time {
    color: rgba(255, 255, 255, 0.8);
}

.hodaya-conversation-delete {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #ff4444;
    border: none;
    color: #ffffff;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.hodaya-conversation-item:hover .hodaya-conversation-delete {
    opacity: 1;
}

/* Main Chat Area */
.hodaya-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hodaya-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
}

/* Welcome Message */
.hodaya-welcome-message {
    text-align: center;
    padding: 40px 20px;
}

.hodaya-welcome-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 15px;
}

.hodaya-welcome-message h3 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 24px;
}

.hodaya-welcome-message p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

/* Messages */
.hodaya-message-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.hodaya-message-wrapper.user {
    flex-direction: row-reverse;
}

.hodaya-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.hodaya-message {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.hodaya-message.user {
    background: #0084ff;
    color: #ffffff;
    border-top-left-radius: 18px;
    border-bottom-left-radius: 18px;
}

.hodaya-message.assistant {
    background: #f0f0f0;
    color: #333333;
    border-top-right-radius: 18px;
    border-bottom-right-radius: 18px;
}

.hodaya-message-content {
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

.hodaya-message-time {
    font-size: 11px;
    margin-top: 6px;
    opacity: 0.7;
}

/* Typing Indicator */
.hodaya-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.hodaya-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: hodaya-typing 1.4s infinite;
}

.hodaya-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.hodaya-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes hodaya-typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Input Area */
.hodaya-input-area {
    border-top: 1px solid #e0e0e0;
    background: #ffffff;
    padding: 15px 20px;
}

.hodaya-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    padding: 8px 12px;
    transition: border-color 0.3s ease;
}

.hodaya-input-wrapper:focus-within {
    border-color: #667eea;
}

.hodaya-upload-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.hodaya-upload-btn:hover {
    color: #667eea;
}

.hodaya-message-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px;
    font-size: 15px;
    resize: none;
    max-height: 120px;
    font-family: inherit;
}

.hodaya-message-input:focus {
    outline: none;
}

.hodaya-send-btn {
    background: #667eea;
    border: none;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: auto;
}

.hodaya-send-btn.icon-only {
    padding: 10px;
    aspect-ratio: 1;
}

.hodaya-send-btn .dashicons,
.hodaya-send-btn svg,
.hodaya-send-btn i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.hodaya-send-btn-text {
    white-space: nowrap;
}

.hodaya-send-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

.hodaya-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* File Preview */
.hodaya-file-preview {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.hodaya-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #ffffff;
    border-radius: 6px;
    margin-bottom: 5px;
}

.hodaya-file-item:last-child {
    margin-bottom: 0;
}

.hodaya-file-icon {
    color: #667eea;
}

.hodaya-file-name {
    flex: 1;
    font-size: 13px;
}

.hodaya-file-remove {
    background: #ff4444;
    border: none;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}

/* Loading */
.hodaya-loading {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

/* Login Message */
.hodaya-login-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* RTL Support */
[dir="rtl"] .hodaya-message.user {
    border-top-right-radius: 18px;
    border-top-left-radius: 4px;
    border-bottom-right-radius: 18px;
    border-bottom-left-radius: 18px;
}

[dir="rtl"] .hodaya-message.assistant {
    border-top-left-radius: 18px;
    border-top-right-radius: 4px;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
}

/* Sidebar Overlay */
.hodaya-sidebar-overlay {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    visibility: hidden;
}

.hodaya-sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Responsive */
@media (max-width: 768px) {
    .hodaya-chat-container {
        height: 100vh;
        border-radius: 0;
        position: relative;
    }
    
    .hodaya-chat-header {
        padding: 12px 15px;
        min-height: 56px;
    }
    
    .hodaya-sidebar-toggle {
        display: flex !important;
        pointer-events: all !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .hodaya-chat-tabs {
        margin-right: 10px;
    }
    
    .hodaya-tab {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .hodaya-chat-body {
        position: relative;
    }
    
    .hodaya-sidebar {
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        margin: 0;
        border-radius: 0;
        border-left: 1px solid #e0e0e0;
        z-index: 1000;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
    }
    
    .hodaya-sidebar.active {
        transform: translateX(0);
    }
    
    .hodaya-sidebar-close {
        display: flex !important;
        pointer-events: all !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .hodaya-conversations-list {
        padding-top: 50px;
    }
    
    .hodaya-sidebar-overlay {
        display: block !important;
        visibility: visible;
    }
    
    .hodaya-chat-main {
        width: 100%;
    }
    
    .hodaya-messages {
        padding: 15px;
    }
    
    .hodaya-message {
        max-width: 85%;
        padding: 10px 14px;
    }
    
    .hodaya-message-content {
        font-size: 14px;
    }
    
    .hodaya-input-area {
        padding: 12px 15px;
    }
    
    .hodaya-input-wrapper {
        padding: 6px 10px;
    }
    
    .hodaya-message-input {
        font-size: 14px;
        padding: 6px;
    }
    
    .hodaya-send-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .hodaya-welcome-message {
        padding: 30px 15px;
    }
    
    .hodaya-welcome-avatar {
        width: 60px;
        height: 60px;
        margin-bottom: 12px;
    }
    
    .hodaya-welcome-message h3 {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .hodaya-welcome-message p {
        font-size: 14px;
    }
    
    .hodaya-conversation-item {
        padding: 10px;
        margin-bottom: 6px;
    }
    
    .hodaya-conversation-preview {
        font-size: 12px;
    }
    
    .hodaya-conversation-time {
        font-size: 10px;
    }
    
    .hodaya-avatar {
        width: 32px;
        height: 32px;
    }
}

/* RTL Responsive Adjustments */
@media (max-width: 768px) {
    [dir="rtl"] .hodaya-sidebar {
        right: auto;
        left: 0;
        transform: translateX(-100%);
        border-left: none;
        border-right: 1px solid #e0e0e0;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    }
    
    [dir="rtl"] .hodaya-sidebar.active {
        transform: translateX(0);
    }
    
    [dir="rtl"] .hodaya-sidebar-close {
        left: auto;
        right: 10px;
    }
    
    [dir="rtl"] .hodaya-chat-tabs {
        margin-right: 0;
        margin-left: 10px;
    }
}

