﻿/* Chat Widget Styles */
.chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

.chat-widget-open {
    display: flex;
    animation: slideIn 0.3s ease;
}

.chat-widget-minimized {
    height: 60px;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #667eea;
    font-size: 18px;
}

.chat-header-info {
    flex: 1;
}

    .chat-header-info h3 {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
    }

    .chat-header-info p {
        margin: 4px 0 0;
        font-size: 13px;
        opacity: 0.9;
    }

.chat-header-actions {
    display: flex;
    gap: 8px;
}

.chat-minimize, .chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Form Container */
.chat-form-container {
    padding: 24px;
    display: none;
}

    .chat-form-container.active {
        display: block;
    }

.chat-form h4 {
    margin: 0 0 20px;
    color: #333;
    font-size: 18px;
}

.form-group {
    margin-bottom: 16px;
}

    .form-group label {
        display: block;
        margin-bottom: 6px;
        color: #555;
        font-size: 14px;
        font-weight: 500;
    }

    .form-group input {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #ddd;
        border-radius: 6px;
        font-size: 14px;
        transition: border 0.3s;
    }

        .form-group input:focus {
            outline: none;
            border-color: #667eea;
        }

        .form-group input.required {
            border-left: 3px solid #667eea;
        }

        .form-group input.optional {
            border-left: 3px solid #ccc;
        }

.start-chat-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

    .start-chat-btn:hover {
        transform: translateY(-1px);
    }

/* Messages Container */
.chat-messages-container {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

    .chat-messages-container.active {
        display: flex;
    }

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    margin-bottom: 16px;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-incoming {
    align-self: flex-start;
}

.message-outgoing {
    align-self: flex-end;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.message-incoming .message-bubble {
    background: white;
    border: 1px solid #e1e8ed;
    border-top-left-radius: 4px;
}

.message-outgoing .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-sender {
    font-size: 12px;
    margin-bottom: 4px;
    color: #666;
    font-weight: 500;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}

/* Input Container */
.chat-input-container {
    padding: 16px;
    border-top: 1px solid #e1e8ed;
    background: white;
    display: none;
}

    .chat-input-container.active {
        display: flex;
        gap: 10px;
    }

.chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border 0.3s;
}

    .chat-input:focus {
        border-color: #667eea;
    }

.send-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toggle Button */
.chat-toggle-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    z-index: 9999;
    transition: transform 0.3s;
}

    .chat-toggle-button:hover {
        transform: scale(1.1);
    }

/* Typing Indicator */
.typing-indicator {
    display: none;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 18px;
    border-top-left-radius: 4px;
    margin-bottom: 16px;
    align-self: flex-start;
    width: 60px;
}

    .typing-indicator.active {
        display: flex;
    }

.typing-dot {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

    .typing-dot:nth-child(2) {
        animation-delay: 0.2s;
    }

    .typing-dot:nth-child(3) {
        animation-delay: 0.4s;
    }

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-8px);
    }
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
}
