/**
 * Modern AI Chat Widget Styles
 * Beautiful, clean, and responsive design
 */

/* Chat Button */
.ai-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1FA2E0 0%, #0d7db8 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(31, 162, 224, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 9998;
    font-size: 24px;
}

.ai-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(31, 162, 224, 0.6);
}

.ai-chat-button.chat-open {
    background: linear-gradient(135deg, #1FA2E0 0%, #0d7db8 100%);
}

/* Notification Badge */
.ai-chat-button .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid white;
}

/* Chat Container */
.ai-chat-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.ai-chat-container.open {
    display: flex;
}

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

/* Chat Header */
.ai-chat-header {
    background: linear-gradient(135deg, #1FA2E0 0%, #0d7db8 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
}

.ai-chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.ai-chat-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai-chat-header-text p {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

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

.ai-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

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

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

/* Message Bubbles */
.ai-message, .user-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
    animation: messageSlide 0.3s ease-out;
}

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

.user-message {
    align-self: flex-end;
    background: linear-gradient(135deg, #1FA2E0 0%, #0d7db8 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message {
    align-self: flex-start;
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Timestamp */
.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    display: block;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-self: flex-start;
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.typing-indicator.active {
    display: block;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1FA2E0;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

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

.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;
    }
}

/* Welcome Message */
.ai-welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.ai-welcome-message .welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.ai-welcome-message h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 18px;
}

.ai-welcome-message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* Suggestions */
.ai-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.ai-suggestion-button {
    background: white;
    border: 1px solid #e0e0e0;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    transition: all 0.2s;
}

.ai-suggestion-button:hover {
    background: #1FA2E0;
    color: white;
    border-color: #1FA2E0;
}

/* Chat Input */
.ai-chat-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.ai-chat-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 12px 16px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    overflow-y: auto;
    font-family: inherit;
    transition: border-color 0.2s;
}

.ai-chat-input:focus {
    outline: none;
    border-color: #1FA2E0;
}

.ai-chat-input::-webkit-scrollbar {
    width: 4px;
}

.ai-chat-input::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 2px;
}

.ai-chat-send {
    background: linear-gradient(135deg, #1FA2E0 0%, #0d7db8 100%);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ai-chat-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(31, 162, 224, 0.4);
}

.ai-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Error Message */
.ai-error-message {
    background: #fee;
    color: #c33;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin: 0 20px;
    border-left: 3px solid #c33;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ai-chat-container {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .ai-chat-button {
        bottom: 15px;
        right: 15px;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .ai-chat-container {
        background: #1a1a1a;
    }
    
    .ai-chat-messages {
        background: #2a2a2a;
    }
    
    .ai-message {
        background: #333;
        color: #fff;
    }
    
    .ai-chat-input-container {
        background: #1a1a1a;
        border-top-color: #444;
    }
    
    .ai-chat-input {
        background: #2a2a2a;
        color: #fff;
        border-color: #444;
    }
}

