/**
 * Lisa Chatbot Widget Styles
 * Brand colors: Navy #1B2A4A, Gold #D4A843, Cream #FBF7ED
 */

/* ===== TOGGLE BUTTON ===== */
.bfu-lisa-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #1B2A4A;
    border: 3px solid #D4A843;
    cursor: pointer;
    z-index: 99999;
    box-shadow: 0 4px 20px rgba(27, 42, 74, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bfu-lisa-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(27, 42, 74, 0.5);
}

.bfu-lisa-toggle-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
}

.bfu-lisa-toggle-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bfu-lisa-toggle-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #D4A843;
    color: #1B2A4A;
    font-size: 24px;
    font-weight: 700;
    font-family: Georgia, serif;
    border-radius: 50%;
}

/* Pulse animation — draws attention on first load */
.bfu-lisa-toggle-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #D4A843;
    animation: bfu-pulse 2s ease-out infinite;
    pointer-events: none;
}

@keyframes bfu-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ===== CHAT WINDOW ===== */
.bfu-lisa-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-height: 540px;
    background: #FBF7ED;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(27, 42, 74, 0.25);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: Arial, sans-serif;
    animation: bfu-slide-up 0.3s ease-out;
}

@keyframes bfu-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== HEADER ===== */
.bfu-lisa-header {
    background: #1B2A4A;
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bfu-lisa-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bfu-lisa-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #D4A843;
    object-fit: cover;
}

.bfu-lisa-header-name {
    font-family: Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    color: #D4A843;
}

.bfu-lisa-header-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.bfu-lisa-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.bfu-lisa-close:hover {
    opacity: 1;
}

/* ===== MESSAGES AREA ===== */
.bfu-lisa-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 360px;
    min-height: 200px;
}

/* Lisa's messages */
.bfu-lisa-msg-lisa {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    max-width: 90%;
}

.bfu-lisa-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.bfu-lisa-msg-bubble-lisa {
    background: white;
    border: 1px solid #e8e0d4;
    border-radius: 0 16px 16px 16px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #1B2A4A;
}

/* User's messages */
.bfu-lisa-msg-user {
    display: flex;
    justify-content: flex-end;
    max-width: 90%;
    align-self: flex-end;
}

.bfu-lisa-msg-bubble-user {
    background: #1B2A4A;
    color: white;
    border-radius: 16px 0 16px 16px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
}

/* Typing indicator */
.bfu-lisa-typing {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.bfu-lisa-typing span {
    width: 8px;
    height: 8px;
    background: #D4A843;
    border-radius: 50%;
    animation: bfu-typing-dot 1.2s infinite;
}

.bfu-lisa-typing span:nth-child(2) { animation-delay: 0.2s; }
.bfu-lisa-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bfu-typing-dot {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

.bfu-lisa-loading {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

/* ===== INPUT AREA ===== */
.bfu-lisa-input-area {
    border-top: 1px solid #e8e0d4;
    padding: 12px 16px;
    background: white;
}

#bfu-lisa-form {
    display: flex;
    gap: 8px;
    margin: 0;
}

#bfu-lisa-input {
    flex: 1;
    border: 1px solid #d4cfc6;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    background: #FBF7ED;
    color: #1B2A4A;
    font-family: Arial, sans-serif;
}

#bfu-lisa-input:focus {
    border-color: #D4A843;
    box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.2);
}

#bfu-lisa-input::placeholder {
    color: #999;
}

#bfu-lisa-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #D4A843;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1B2A4A;
    transition: background 0.2s;
    flex-shrink: 0;
}

#bfu-lisa-send:hover {
    background: #c89a35;
}

#bfu-lisa-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .bfu-lisa-window {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 90px;
        max-height: calc(100vh - 120px);
    }

    /* v1.0.15 FIX: Moved left ~24px so Lisa isn't cut off on mobile screens */
    .bfu-lisa-toggle {
        right: 40px;
        bottom: 16px;
    }
}
