/* ========================================
   Picmkr AI Assistant - Widget Styles
   ======================================== */

:root {
    --chat-z-index: 9999;
    --chat-width: 400px;
    --chat-height: 600px;
    --chat-bg: #15151e;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --secondary-color: #2a2a35;
    --text-color: #ffffff;
    --text-secondary: #a1a1aa;
    --accent: #8b5cf6;
    --bot-msg-bg: #22222e;
    --user-msg-bg: #6366f1;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --font-family: 'Outfit', sans-serif;
}

/* --- Floating Action Button (FAB) --- */
.chatbot-toggler {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
    z-index: var(--chat-z-index);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chatbot-toggler:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.7);
}

.chatbot-toggler span {
    position: absolute;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.chatbot-toggler span:last-child {
    opacity: 0;
    transform: rotate(90deg);
}

body.show-chatbot .chatbot-toggler span:first-child {
    opacity: 0;
    transform: rotate(90deg);
}

body.show-chatbot .chatbot-toggler span:last-child {
    opacity: 1;
    transform: rotate(0);
}

/* --- Chat Widget Window --- */
.chatbot-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: var(--chat-width);
    height: var(--chat-height);
    background: var(--chat-bg);
    border-radius: 20px;
    border: var(--glass-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: var(--chat-z-index);
    font-family: var(--font-family);
}

body.show-chatbot .chatbot-widget {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .chatbot-widget {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chatbot-toggler {
        bottom: 20px;
        right: 20px;
    }
}

/* --- Header --- */
.chat-header {
    padding: 16px 20px;
    background: rgba(21, 21, 30, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Avatar Icon Wrapper */
.header-info i {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
    font-size: 18px;
    color: white;
    /* Ensure Icon is White */
}

/* Title Text */
.header-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff !important;
    /* Force White Text */
    margin: 0;
}

/* Subtitle Text */
.header-info span {
    font-size: 0.75rem;
    color: #e2e8f0;
    /* Light Gray Subtitle */
    display: block;
}

.close-chat-btn {
    background: transparent;
    border: none;
    color: white;
    /* Ensure close button is visible */
    font-size: 1.2rem;
    cursor: pointer;
}

/* --- Chat Content --- */
.chat-window {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
    background: var(--chat-bg);
}

.chat-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 20px;
}

/* Scrollbar */
.chat-window::-webkit-scrollbar {
    width: 5px;
}

.chat-window::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

/* Messages */
.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    animation: fadeIn 0.3s ease-up;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    align-self: flex-start;
    background-color: var(--bot-msg-bg);
    border-bottom-left-radius: 4px;
    color: #e2e2e2;
    border: var(--glass-border);
}

.user-message {
    align-self: flex-end;
    background: var(--user-msg-bg);
    border-bottom-right-radius: 4px;
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* Input Area */
.input-area {
    padding: 15px;
    background: rgba(21, 21, 30, 0.95);
    border-top: var(--glass-border);
}

.input-wrapper {
    display: flex;
    gap: 8px;
    background-color: var(--secondary-color);
    padding: 6px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 15px;
    color: white;
    font-family: var(--font-family);
    outline: none;
    width: 100%;
}

.send-btn {
    background: var(--primary-gradient);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s;
}

.send-btn:hover {
    transform: scale(1.05);
}

/* Quick Replies */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.chip {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--accent);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
}

.chip:hover {
    background: var(--accent);
}

/* Typing Indicator */
.typing-indicator {
    padding: 12px 16px;
    background: var(--bot-msg-bg);
    border-radius: 16px;
    width: fit-content;
    display: flex;
    gap: 4px;
    border: var(--glass-border);
    margin-bottom: 10px;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: bounce 1.4s infinite;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}