/* AI Advisor Chatbot Styles */

.ai-advisor-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    z-index: 9999;
}

/* Toggle Button */
.ai-advisor-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-advisor-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #45a049, #3d8b40);
}

.ai-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff6b6b;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Chat Window */
.ai-advisor-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s, visibility 0.3s;
}

.ai-advisor-window.hidden {
    display: none;
    opacity: 0;
    visibility: hidden;
}

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

/* Header */
.ai-advisor-header {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 16px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-advisor-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.ai-advisor-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Messages Area */
.ai-advisor-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
}

.ai-message,
.user-message {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.ai-message {
    justify-content: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.ai-message-content,
.user-message-content {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 12px;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.5;
}

.ai-message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
}

.ai-message-content strong {
    font-weight: 600;
    color: #2c5f2d;
}

.ai-message-content em {
    font-style: italic;
    color: #666;
}

.ai-message-content br {
    margin: 4px 0;
}

.user-message-content {
    background: #4CAF50;
    color: white;
}

.ai-typing {
    display: flex;
    align-items: center;
    gap: 4px;
}

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

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

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

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* Input Area */
.ai-advisor-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.ai-advisor-input {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.ai-advisor-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.ai-advisor-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-advisor-send:hover {
    background: #45a049;
}

.ai-advisor-send:active {
    transform: scale(0.95);
}

.ai-advisor-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Suggestions */
.ai-advisor-suggestions {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    overflow-x: auto;
}

.ai-suggestion-btn {
    white-space: nowrap;
    padding: 6px 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-suggestion-btn:hover {
    background: #f0f0f0;
    border-color: #4CAF50;
}

/* Responsive */
@media (max-width: 480px) {
    .ai-advisor-window {
        width: 90vw;
        max-width: 100%;
        height: 60vh;
        max-height: 500px;
    }

    .ai-advisor-container {
        bottom: 10px;
        right: 10px;
    }

    .ai-advisor-toggle {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .ai-advisor-suggestions {
        flex-direction: column;
    }

    .ai-suggestion-btn {
        width: 100%;
    }
}

/* Loading Animation */
.ai-loading {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
