/* ===== Chatbot Styles (Tawk.to Style) ===== */
.chatbot-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    font-family: var(--font-primary);
}

/* Toggle Button */
.chat-toggle-btn {
    height: 50px;
    padding: 0 1.5rem;
    background: #0ea5e9;
    /* Bright Blue */
    border-radius: 25px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(14, 165, 233, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    border: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
}

.chat-toggle-btn::after {
    content: 'Chat with AI';
}

.chat-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.5);
}

.chat-notification-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    height: 550px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.chat-window.active {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Views */
.chat-view {
    display: none;
    flex-direction: column;
    height: 100%;
    background: #f8fafc;
}

.chat-view.active {
    display: flex;
}

/* Welcome View Header */
.chat-header-large {
    background: #0ea5e9;
    /* Bright Blue */
    padding: 2.5rem 1.5rem;
    color: white;
    text-align: center;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.header-avatars {
    margin-bottom: 1rem;
}

.avatar-group {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.avatar-circle {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(5px);
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.header-title i {
    color: #4ade80;
    /* Green check */
}

.header-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* Welcome Input Card */
.chat-body-welcome {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.welcome-input-card {
    background: white;
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #e2e8f0;
}

.welcome-input-card input {
    flex: 1;
    border: none;
    padding: 1rem;
    font-size: 0.95rem;
    outline: none;
    color: #334155;
}

.welcome-send-btn {
    background: transparent;
    border: none;
    color: #0ea5e9;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.2s;
}

.welcome-send-btn:hover {
    transform: translateX(3px);
}

/* Conversation View Header */
.chat-header-small {
    background: #0ea5e9;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-avatar-small {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-back-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #f1f5f9;
}

.message {
    max-width: 80%;
    animation: slideIn 0.3s ease;
}

.message-content {
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.bot-message {
    align-self: flex-start;
}

.bot-message .message-content {
    background: white;
    color: #334155;
    border-bottom-left-radius: 2px;
}

.user-message {
    align-self: flex-end;
}

.user-message .message-content {
    background: #0ea5e9;
    color: white;
    border-bottom-right-radius: 2px;
}

.message-time {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 4px;
    margin-left: 4px;
}

.user-message .message-time {
    text-align: right;
    margin-right: 4px;
}

/* Chat Input Area */
.chat-input-area {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e2e8f0;
}

#chat-form {
    display: flex;
    gap: 0.5rem;
    background: #f8fafc;
    padding: 0.5rem;
    border-radius: 2rem;
    border: 1px solid #e2e8f0;
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    outline: none;
    color: #334155;
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    background: #0ea5e9;
    border-radius: 50%;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Bottom Nav */
.chat-bottom-nav {
    display: flex;
    background: white;
    border-top: 1px solid #e2e8f0;
    height: 50px;
}

.nav-btn {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.nav-btn.active {
    color: #0ea5e9;
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 3px;
    background: #0ea5e9;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    width: fit-content;
    border-bottom-left-radius: 2px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media screen and (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 2rem);
        right: 1rem;
        bottom: 80px;
        height: 60vh;
    }
}