.chat-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 380px;
    height: 550px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transform: translateY(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.chat-container.active {
    display: flex;
    transform: translateY(0);
}

.chat-header {
    background: linear-gradient(135deg, #2193b0, #6dd5ed);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.3s ease;
}

.close-chat:hover {
    opacity: 0.8;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

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

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

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

.message {
    margin-bottom: 16px;
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    line-height: 1.6;
    font-size: 15px;
    animation: messageAppear 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

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

.message.bot {
    background: #ffffff;
    margin-right: auto;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    color: #2d3748;
    text-align: left;
    text-align-last: left;
    text-justify: inter-word;
}

.message.user {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #000000;
    margin-left: auto;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-input {
    padding: 16px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.chat-input input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
    background: white;
}

.chat-input button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.2);
}

.chat-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 56px;
    height: 56px;
    background: #003049;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.chat-toggle i {
    font-size: 24px;
}

.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .chat-container {
        width: 320px;
        height: 450px;
        bottom: 10px;
        left: 10px;
    }
    
    .chat-toggle {
        bottom: 10px;
        left: 10px;
        width: 48px;
        height: 48px;
    }
    
    .chat-toggle i {
        font-size: 20px;
    }

    .message {
        max-width: 90%;
        font-size: 13px;
    }
} 