:root {
    --primary-color: #6366f1;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --bg-color: #f3f4f6;
    --chat-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --message-user-bg: #6366f1;
    --message-user-text: #ffffff;
    --message-bot-bg: #f9fafb;
    --message-bot-text: #374151;
    --border-color: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
}

/* Floating Trigger Button */
.chat-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.chat-trigger:hover {
    transform: scale(1.1);
}

/* Chat Widget Container */
.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background-color: var(--chat-bg);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-widget.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chat-header {
    background: var(--primary-gradient);
    padding: 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.2);
}

.chat-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.1rem;
}

.close-chat {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    width: auto;
    height: auto;
    padding: 5px;
}

.close-chat:hover {
    opacity: 1;
    transform: none;
    box-shadow: none;
}

/* Pre-Chat Form */
.pre-chat-form {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.pre-chat-form h3 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.pre-chat-form p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.pre-chat-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.pre-chat-form input {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.pre-chat-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.start-chat-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
    height: auto;
}

/* Chat Interface */
.chat-interface {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 0.9rem;
    line-height: 1.5;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    align-self: flex-start;
    background-color: var(--message-bot-bg);
    color: var(--message-bot-text);
    border-bottom-left-radius: 5px;
    border: 1px solid var(--border-color);
}

.message.user {
    align-self: flex-end;
    background: var(--primary-gradient);
    color: var(--message-user-text);
    border-bottom-right-radius: 5px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

.message-time {
    font-size: 0.7rem;
    margin-top: 5px;
    opacity: 0.7;
    text-align: right;
}

.message.bot .message-time {
    text-align: left;
}

.chat-input-area {
    padding: 20px;
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    align-items: center;
}

#user-input {
    flex: 1;
    padding: 12px 15px;
    border-radius: 25px;
    border: 1px solid var(--border-color);
    background-color: #f9fafb;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

#user-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.chat-input-area button {
    background: var(--primary-gradient);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: scale(1.05);
}

button:active {
    transform: scale(0.95);
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

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