/* Kevin Chatbot - Frontend Styles */

/* Widget Container */
.kevin-chatbot-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.kevin-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.kevin-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Chat Button (Minimized) */
.kevin-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: hidden;
}

.kevin-chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
}

.kevin-chat-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Chat Window (Expanded) */
.kevin-chat-window {
    position: fixed;
    bottom: 90px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 140px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.kevin-position-bottom-right .kevin-chat-window {
    right: 20px;
}

.kevin-position-bottom-left .kevin-chat-window {
    left: 20px;
}

.kevin-chat-window.kevin-open {
    display: flex;
}

/* Header */
.kevin-chat-header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.kevin-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kevin-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid white;
}

.kevin-chat-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}

.kevin-chat-status {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1;
}

.kevin-reset-btn,
.kevin-close-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kevin-reset-btn:hover,
.kevin-close-btn:hover {
    background: rgba(255,255,255,0.25);
}

.kevin-close-btn {
    font-size: 20px;
}

/* Messages Area */
.kevin-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f9fafb;
}

.kevin-message {
    margin-bottom: 12px;
    display: flex;
    animation: kevinSlideIn 0.2s ease;
}

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

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

.kevin-message-content {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.5;
}

.kevin-message.kevin-user .kevin-message-content {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.kevin-message.kevin-assistant .kevin-message-content {
    background: white;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-bottom-left-radius: 4px;
}

/* Input Area */
.kevin-chat-input-area {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    align-items: center;
}

.kevin-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.kevin-chat-input:focus {
    border-color: #6366f1;
}

.kevin-chat-input::placeholder {
    color: #9ca3af;
}

.kevin-send-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}

.kevin-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.kevin-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Empty State */
.kevin-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    text-align: center;
    padding: 20px;
}

.kevin-empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.kevin-empty-state-text {
    font-size: 14px;
}

/* Typing Indicator */
.kevin-typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
}

.kevin-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: kevinTyping 1.4s infinite;
    opacity: 0.4;
}

.kevin-typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes kevinTyping {
    0%, 60%, 100% { opacity: 0.4; }
    30% { opacity: 1; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .kevin-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
        bottom: 90px;
        left: 10px !important;
        right: 10px !important;
    }
    
    .kevin-chat-button {
        width: 60px;
        height: 60px;
    }
}
