/* AI Assistant Chat Widget Styles */

.ai-assistant-widget {
    position: fixed;
    z-index: 9999;
}

.ai-assistant-widget.bottom-right {
    bottom: 24px;
    right: 24px;
}

.ai-assistant-widget.bottom-left {
    bottom: 24px;
    left: 24px;
}

/* Chat Toggle Button */
.ai-chat-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ai-chat-toggle::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
    filter: blur(12px);
}

.ai-chat-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
}

.ai-chat-toggle:hover::before {
    opacity: 0.6;
}

.ai-chat-toggle.active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.ai-chat-toggle.disabled {
    background: #ccc;
    cursor: not-allowed;
}

.ai-chat-toggle.disabled:hover {
    transform: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.ai-chat-toggle.disabled::before {
    display: none;
}

/* Chat Window */
.ai-chat-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 400px;
    max-width: calc(100vw - 48px);
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Chat Header */
.ai-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 17px;
    letter-spacing: -0.2px;
}

.ai-chat-title i {
    font-size: 22px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.ai-chat-actions {
    display: flex;
    gap: 8px;
}

.ai-btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
}

.ai-message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ai-message-bot .ai-message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-message-user .ai-message-avatar {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.ai-message-content {
    background: white;
    padding: 14px 18px;
    border-radius: 16px;
    max-width: 75%;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    line-height: 1.6;
    font-size: 14.5px;
    position: relative;
}

.ai-message-bot .ai-message-content {
    border-bottom-left-radius: 4px;
}

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

.ai-message-user .ai-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.ai-message-error .ai-message-content {
    background: #dc3545;
    color: white;
}

/* Typing Indicator */
.ai-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

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

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

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

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

/* Chat Input */
.ai-chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    align-items: flex-end;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.ai-chat-input {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14.5px;
    resize: none;
    max-height: 100px;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8f9fa;
}

.ai-chat-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ai-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ai-chat-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.ai-chat-send:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Scrollbar Styling */
.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Sample Questions */
.ai-sample-questions {
    margin: 20px 0;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    animation: messageSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-sample-questions-title {
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-sample-questions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.ai-sample-question {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #495057;
    text-align: left;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.ai-sample-question::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 0;
}

.ai-sample-question:hover::before {
    opacity: 0.05;
}

.ai-sample-question:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.ai-sample-question:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
}

.ai-sample-question i {
    font-size: 16px;
    color: #667eea;
    flex-shrink: 0;
    z-index: 1;
}

.ai-sample-question span {
    line-height: 1.4;
    z-index: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ai-chat-window {
        width: calc(100vw - 32px);
        height: 500px;
        border-radius: 16px;
    }

    .ai-message-content {
        max-width: 85%;
    }
    
    .ai-chat-toggle {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }

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

    .ai-sample-question {
        font-size: 12.5px;
        padding: 10px;
    }
}
