/**
 * AI Integration Styles
 * Styles for AI-powered features and components
 */

/* =============================================================================
   AI CHATBOT WIDGET
   ============================================================================= */

.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    max-height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
    border: 2px solid var(--main-color);
}

.chatbot-widget.collapsed {
    height: 60px;
    overflow: hidden;
}

.chatbot-widget.collapsed .chatbot-body {
    display: none;
}

.chatbot-header {
    background: var(--main-color);
    color: white;
    padding: 15px 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.chatbot-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.chatbot-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chatbot-body {
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 300px;
}

.bot-message,
.user-message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
}

.bot-message {
    background: #f0f0f0;
    margin-right: auto;
}

.user-message {
    background: var(--main-color);
    color: white;
    margin-left: auto;
}

.chatbot-input {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.chatbot-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 0.9rem;
    outline: none;
}

.chatbot-input input:focus {
    border-color: var(--main-color);
}

.chatbot-input button {
    background: var(--main-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.chatbot-input button:hover {
    background: var(--main-dark);
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.suggestion-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-btn:hover {
    background: var(--main-color);
    color: white;
    border-color: var(--main-color);
}

/* =============================================================================
   AI ANALYSIS MODAL
   ============================================================================= */

.ai-analysis-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: var(--main-color);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
}

.analysis-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid var(--main-color);
}

.analysis-section h4 {
    margin: 0 0 10px 0;
    color: var(--main-color);
    font-size: 1.1rem;
}

.analysis-section ul {
    margin: 10px 0;
    padding-left: 20px;
}

.analysis-section li {
    margin-bottom: 5px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

/* =============================================================================
   AI RECOMMENDATIONS
   ============================================================================= */

.ai-recommendations {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px;
    margin: 30px 0;
    border-radius: 15px;
    border: 2px solid var(--main-color);
}

.ai-recommendations h4 {
    color: var(--main-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recommendations-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.recommendation-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.recommendation-item:hover {
    transform: translateY(-2px);
}

.recommendation-item h5 {
    color: var(--main-color);
    margin: 0 0 10px 0;
    font-size: 1.1rem;
}

.recommendation-item p {
    margin: 0 0 15px 0;
    color: #666;
    line-height: 1.5;
}

/* =============================================================================
   AI FORM INSIGHTS
   ============================================================================= */

.ai-form-insights {
    background: #e8f5e8;
    border: 2px solid #28a745;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.insights-content h4 {
    color: #28a745;
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.insights-content p {
    margin: 5px 0;
    font-weight: 500;
}

.next-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #c3e6c3;
}

.next-actions h5 {
    color: #28a745;
    margin: 0 0 10px 0;
    font-size: 1rem;
}

.next-actions ul {
    margin: 0;
    padding-left: 20px;
}

.next-actions li {
    margin-bottom: 5px;
    color: #333;
}

/* =============================================================================
   AI ERROR MESSAGES
   ============================================================================= */

.ai-error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 10px;
    z-index: 1500;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.error-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-icon {
    font-size: 1.2rem;
}

.error-text {
    flex: 1;
    font-weight: 500;
}

.error-close {
    background: none;
    border: none;
    color: #721c24;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.error-close:hover {
    background-color: rgba(114, 28, 36, 0.1);
}

/* =============================================================================
   AI BUTTONS AND INTERACTIONS
   ============================================================================= */

.ai-analysis-btn {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-dark) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px auto;
    box-shadow: 0 4px 15px rgba(147, 60, 116, 0.3);
}

.ai-analysis-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(147, 60, 116, 0.4);
}

.ai-analysis-btn:active {
    transform: translateY(0);
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 768px) {
    .chatbot-widget {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        bottom: 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .recommendations-list {
        grid-template-columns: 1fr;
    }
    
    .ai-recommendations {
        padding: 20px;
        margin: 20px 0;
    }
}

@media (max-width: 480px) {
    .chatbot-widget {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
        bottom: 10px;
    }
    
    .chatbot-header {
        padding: 12px 15px;
    }
    
    .chatbot-header h4 {
        font-size: 1rem;
    }
    
    .chatbot-messages {
        padding: 15px;
    }
    
    .chatbot-input {
        padding: 12px 15px;
    }
}

/* =============================================================================
   ANIMATIONS
   ============================================================================= */

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

.ai-analysis-modal .modal-content {
    animation: fadeInUp 0.3s ease;
}

.chatbot-widget {
    animation: fadeInUp 0.5s ease;
}

.ai-recommendations {
    animation: fadeInUp 0.6s ease;
}

/* =============================================================================
   ACCESSIBILITY
   ============================================================================= */

.chatbot-widget:focus-within {
    outline: 2px solid var(--main-color);
    outline-offset: 2px;
}

.suggestion-btn:focus,
.ai-analysis-btn:focus {
    outline: 2px solid var(--main-color);
    outline-offset: 2px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
