/* Chatbot Widget Styles */

/* Chat Button */
.chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.4);
    transition: all 0.3s ease;
    z-index: 9999;
    border: none;
    animation: pulse-chat 2s infinite;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 255, 136, 0.6);
}

.chat-button svg {
    width: 28px;
    height: 28px;
    fill: var(--dark);
}

.chat-button.active svg {
    display: none;
}

.chat-button .close-icon {
    display: none;
    width: 28px;
    height: 28px;
    stroke: var(--dark);
}

.chat-button.active .close-icon {
    display: block;
}

@keyframes pulse-chat {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(0, 255, 136, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(0, 255, 136, 0.7);
    }
}

/* Chat Container */
.chat-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 500px;
    background: rgba(10, 14, 39, 0.98);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 20px;
    display: none;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 9998;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.chat-container.active {
    display: flex;
}

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

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 102, 255, 0.1));
    padding: 20px;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--dark);
}

.chat-header-info h3 {
    color: var(--primary);
    font-size: 1.1rem;
    margin: 0;
}

.chat-header-info p {
    color: var(--gray);
    font-size: 0.85rem;
    margin: 0;
}

.chat-status {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

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

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 136, 0.5);
}

/* Message Bubble */
.message {
    display: flex;
    gap: 10px;
    animation: fadeInMessage 0.3s ease-out;
}

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

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--dark);
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
}

.message-content {
    max-width: 70%;
}

.message-bubble {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.2);
    padding: 12px 16px;
    border-radius: 15px;
    color: var(--light);
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 102, 255, 0.2));
    border-color: rgba(0, 102, 255, 0.3);
}

.message-time {
    font-size: 0.75rem;
    color: var(--gray);
    margin-top: 5px;
    opacity: 0.7;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px;
}

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

.typing-dots {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 15px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

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

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

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

/* Chat Input */
.chat-input {
    padding: 15px 20px;
    border-top: 1px solid rgba(0, 255, 136, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

.chat-input-form {
    display: flex;
    gap: 10px;
}

.chat-input-form input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 25px;
    color: var(--light);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input-form input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.chat-input-form input::placeholder {
    color: var(--gray);
    opacity: 0.6;
}

.chat-send-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

.chat-send-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--dark);
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 20px;
    color: var(--gray);
}

.welcome-message h4 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.welcome-message p {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Error Message */
.error-message {
    background: rgba(255, 0, 102, 0.1);
    border: 1px solid rgba(255, 0, 102, 0.3);
    color: #ff6b9d;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin: 10px 20px;
    display: none;
}

.error-message.active {
    display: block;
    animation: fadeInMessage 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 480px) {
    .chat-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
        right: 10px;
        bottom: 80px;
    }

    .chat-button {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
}
