:root {
    --brand-color: #26A69A;
    --brand-gradient: linear-gradient(135deg, #4DB6AC, #26A69A);
    --light-grey: #F1F3F4;
    --medium-grey: #DADCE0;
    --dark-grey: #5F6368;
    --text-color: #3C4043;
    --window-bg: #FFFFFF;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

#lanternbot-root {
    position: fixed;
    bottom: 75px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- Launcher Button --- */
#lanternbot-launcher {
    width: 60px;
    height: 60px;
    background-color: transparent;
    border-radius: 60px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 0;
}

#lanternbot-launcher img {
    width: 100%;
    height: 100%;
    border-radius:60px;
    animation: glow-effect 2s infinite alternate !important;
}

#lanternbot-launcher:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#lanternbot-launcher.open {
    transform: scale(0.9);
}

/* --- Intro Popup --- */
#lanternbot-intro-popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 280px;
    background: var(--window-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    visibility: hidden;
}

#lanternbot-intro-popup.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

#lanternbot-intro-popup::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 20px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--window-bg);
}

.lanternbot-intro-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

.lanternbot-intro-avatar {
    width: 28px;
    height: 28px;
    margin-right: 8px;
}
.lanternbot-intro-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}
.lanternbot-intro-header span {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
}
#lanternbot-intro-close-btn {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
}
.lanternbot-intro-body {
    padding: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--dark-grey);
}

/* --- Chat Window --- */
#lanternbot-chat-window {
    width: 370px;
    height: 70vh;
    max-height: 600px;
    background-color: var(--window-bg);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: none;
    flex-direction: column;
    position: absolute;
    bottom: 80px;
    right: 0;
    transform-origin: bottom right;
}

#lanternbot-chat-window.open {
    display: flex;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Header --- */
.lanternbot-header {
    background: #F0F8FF;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #E0E0E0;
    flex-shrink: 0;
}
.lanternbot-header-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lanternbot-header-icon img {
    width: 100%;
    height: 100%;
    border-radius: 60px;
    animation: glow-effect 2s infinite alternate !important;
}
.lanternbot-title {
    font-weight: 600;
    font-size: 1.1em;
    color: var(--text-color);
    margin-left: 15px;
}
#lanternbot-close-btn {
    background: none; border: none; color: #888;
    font-size: 1.8em; cursor: pointer; margin-left: auto; padding: 0; line-height: 1;
}

/* --- Messages & Buttons --- */
.lanternbot-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.lanternbot-message {
    padding: 12px 16px; border-radius: 18px; max-width: 85%;
    line-height: 1.5; word-wrap: break-word; font-size: 0.95em;
}
.lanternbot-message.user {
    background-color: var(--brand-color); color: #fff;
    align-self: flex-end; border-bottom-right-radius: 4px;
}
.lanternbot-message.bot {
    background-color: var(--light-grey); color: var(--text-color);
    align-self: flex-start; border-bottom-left-radius: 4px;
}
.lanternbot-message.bot a {
    color: var(--brand-color); font-weight: 500; text-decoration: none;
}
.lanternbot-message.bot a:hover { text-decoration: underline; }

.lanternbot-initial-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.lanternbot-fallback-actions { margin-top: 12px; }
.lanternbot-action-btn {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #fff; color: var(--text-color);
    padding: 14px; border-radius: 25px;
    border: 1px solid var(--medium-grey);
    text-decoration: none; transition: background-color 0.2s ease, box-shadow 0.2s ease;
    font-weight: 500; font-size: 0.95em; cursor: pointer;
}
.lanternbot-action-btn:hover { background-color: #F8F9FA; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }

.lanternbot-topic-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-bottom: 8px;}
.lanternbot-topic-chip {
    background-color: var(--light-grey); color: var(--text-color);
    padding: 6px 12px; border-radius: 16px; font-size: 0.85em;
    border: none; cursor: pointer; transition: background-color 0.2s ease;
}
.lanternbot-topic-chip:hover { background-color: #E8EAED; }

/* --- Typing Indicator --- */
.typing-indicator { display: flex; align-items: center; font-size: 0.9em; color: var(--dark-grey); }
.typing-spark { margin-right: 8px; animation: spin 1.5s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.typing-dot { animation: blink 1.4s infinite both; margin: 0 1px; }
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0; } 40% { opacity: 1; } }

/* --- Input Area --- */
.lanternbot-input-area {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 20px; background-color: #fff; border-top: 1px solid #E0E0E0;
    flex-shrink: 0;
}
.lanternbot-input-wrapper { position: relative; flex-grow: 1; }
#lanternbot-input {
    width: 100%; border: 1px solid var(--medium-grey); background-color: var(--light-grey);
    border-radius: 20px; padding: 10px 15px 10px 40px; font-size: 0.95em;
    outline: none; transition: border-color 0.2s, background-color 0.2s;
}
#lanternbot-input:focus { border-color: var(--brand-color); background-color: #fff; }
.lanternbot-input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--dark-grey); }
#lanternbot-send-btn {
    background-color: var(--brand-color); color: #fff; border: none; border-radius: 8px;
    padding: 8px 16px; cursor: pointer; font-size: 0.9em; font-weight: 500;
    transition: background-color 0.2s ease;
}
#lanternbot-send-btn:hover { background-color: #00897B; }

/* --- Mobile Responsiveness --- */
@media (max-width: 480px) {
    #lanternbot-root {
        bottom: 10px;
        right: 10px;
    }
    #lanternbot-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 90px);
        max-height: none;
        bottom: 70px;
        right: -10px;
    }
    .lanternbot-intro-popup {
        width: calc(100vw - 40px);
        bottom: 70px;
        right: -10px;
    }
}

@keyframes glow-effect {
  0% {
    box-shadow: 0 0 10px -10px #cdff5d;
  }
  100% {
    box-shadow: 0 0 10px 10px #cdff5d;
  }
}