/* Βασικό στυλ για το chat container */
.dia-aichat-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 800px;
    margin: 20px auto;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #ffffff;
}

/* Header */
.dia-aichat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dia-aichat-header h3 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
}

.dia-aichat-status {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Περιοχή μηνυμάτων */
.dia-aichat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.dia-aichat-message {
    display: flex;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dia-aichat-message.dia-aichat-bot {
    flex-direction: row;
}

.dia-aichat-message.dia-aichat-user {
    flex-direction: row-reverse;
}

.dia-aichat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    margin: 0 12px;
    flex-shrink: 0;
}

.dia-aichat-bot .dia-aichat-avatar {
    background: #667eea;
    color: white;
}

.dia-aichat-user .dia-aichat-avatar {
    background: #10b981;
    color: white;
}

.dia-aichat-content {
    max-width: 70%;
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
}

.dia-aichat-bot .dia-aichat-content {
    background: white;
    border: 1px solid #e5e7eb;
    color: #374151;
    border-top-left-radius: 4px;
}

.dia-aichat-user .dia-aichat-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-top-right-radius: 4px;
}

/* Περιοχή εισαγωγής */
.dia-aichat-input-area {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.dia-aichat-input-area textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 1em;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.dia-aichat-input-area textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dia-aichat-controls {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.dia-aichat-send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    flex: 1;
}

.dia-aichat-send-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.dia-aichat-send-btn:active {
    transform: translateY(0);
}

.dia-aichat-clear-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.dia-aichat-clear-btn:hover {
    background: #e5e7eb;
}

/* Loading indicator */
.dia-aichat-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    color: #6b7280;
    font-size: 0.95em;
}

.dia-aichat-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Disclaimer */
.dia-aichat-disclaimer {
    padding: 12px 20px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.85em;
    text-align: center;
    border-top: 1px solid #fde68a;
}

/* Responsive design */
@media (max-width: 768px) {
    .dia-aichat-container {
        margin: 10px;
    }
    
    .dia-aichat-messages {
        height: 300px;
    }
    
    .dia-aichat-content {
        max-width: 85%;
    }
    
    .dia-aichat-controls {
        flex-direction: column;
    }
}
/* Ειδικά για το RAG plugin */
.dia-aichat-refresh-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2em;
}

.dia-aichat-refresh-btn:hover {
    background: #e5e7eb;
    transform: rotate(45deg);
}

.dia-aichat-notice {
    margin-top: 10px;
    padding: 10px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    color: #0369a1;
    font-size: 0.85em;
    text-align: center;
}

.dia-aichat-source {
    font-size: 0.8em;
    color: #6b7280;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #d1d5db;
}

.dia-aichat-source a {
    color: #667eea;
    text-decoration: none;
}

.dia-aichat-source a:hover {
    text-decoration: underline;
}

/* Βελτίωση για μηνύματα */
.dia-aichat-message.dia-aichat-bot .dia-aichat-content {
    background: #f8fafc;
    border-left: 4px solid #667eea;
}

.dia-aichat-message.dia-aichat-user .dia-aichat-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Κατάσταση φόρτωσης */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.dia-aichat-loading span {
    animation: pulse 1.5s infinite;
}