/* AI Assistant Styles */

.ai-assistant-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ai-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.ai-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.ai-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.ai-chat-popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-popup.active {
    display: flex;
}

.ai-popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: 600;
}

.ai-popup-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
}

.ai-popup-input {
    padding: 15px;
    border-top: 1px solid #e9ecef;
    background: white;
}

.ai-popup-input-wrapper {
    display: flex;
    gap: 10px;
}

.ai-popup-input input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
}

.ai-popup-input button {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Message Styles */
.ai-message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

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

.ai-message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.ai-message.user .ai-message-avatar {
    background: #007bff;
}

.ai-message.ai .ai-message-avatar {
    background: #28a745;
}

.ai-message-content {
    background: white;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 70%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    line-height: 1.4;
}

.ai-message.user .ai-message-content {
    background: #007bff;
    color: white;
}

/* DocType List Styles */
.ai-doctype-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.ai-doctype-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.ai-doctype-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.ai-doctype-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.ai-doctype-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.ai-doctype-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.ai-doctype-count {
    font-size: 24px;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 5px;
}

.ai-doctype-label {
    font-size: 14px;
    color: #666;
}

/* Query Builder Styles */
.ai-query-builder {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.ai-query-builder h3 {
    margin-bottom: 20px;
    color: #333;
}

.ai-query-form {
    display: grid;
    gap: 15px;
}

.ai-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ai-form-group label {
    font-weight: 600;
    color: #555;
}

.ai-form-group select,
.ai-form-group input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.ai-query-examples {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.ai-query-examples h4 {
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
}

.ai-example-query {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 8px 12px;
    margin: 5px 0;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ai-example-query:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Document Upload Styles */
.ai-upload-zone {
    border: 2px dashed #007bff;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    background: #f8f9ff;
    margin: 20px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-upload-zone:hover,
.ai-upload-zone.dragover {
    background: #e3f2fd;
    border-color: #1976d2;
}

.ai-upload-icon {
    font-size: 48px;
    color: #007bff;
    margin-bottom: 15px;
}

.ai-upload-text {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

.ai-upload-subtext {
    font-size: 14px;
    color: #666;
}

.ai-file-list {
    margin: 15px 0;
}

.ai-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 5px;
    margin: 5px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ai-file-icon {
    color: #007bff;
    font-size: 18px;
}

.ai-file-info {
    flex: 1;
}

.ai-file-name {
    font-weight: 600;
    color: #333;
}

.ai-file-size {
    font-size: 12px;
    color: #666;
}

.ai-file-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.ai-file-status.processing {
    background: #fff3cd;
    color: #856404;
}

.ai-file-status.completed {
    background: #d4edda;
    color: #155724;
}

.ai-file-status.failed {
    background: #f8d7da;
    color: #721c24;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-chat-popup {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .ai-doctype-grid {
        grid-template-columns: 1fr;
    }

    .ai-assistant-container {
        padding: 10px;
    }
}

/* Animation Classes */
.ai-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.ai-slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Loading Spinner */
.ai-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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



