:root {
    --primary-color: #007bff;
    --text-color: #fff;
}

body { font-family: 'Segoe UI', sans-serif; margin: 0; background: #f4f4f9; }

/* Hero Section */
.hero { text-align: center; padding: 50px 20px; display: none; }
.hero.active { display: block; }

/* Chat Toggle Button */
.chat-toggle {
    position: fixed; bottom: 20px; right: 20px;
    background: var(--primary-color); color: var(--text-color);
    border: none;
    /* Default Round dimensions set by JS or fallback */
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    transition: transform 0.2s, background-color 0.2s;
    z-index: 9999;
}
.chat-toggle:hover { transform: scale(1.05); }

/* Chat Window */
.chat-window {
    width: 350px; height: 500px; background: #fff;
    border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex; flex-direction: column; overflow: hidden;
    position: fixed; bottom: 80px; right: 20px;
}

/* Hero Mode Overrides */
.hero .chat-window {
    position: static; margin: 20px auto; height: 400px;
}

.chat-window.hidden { display: none; }

/* Header */
.chat-header {
    background: var(--primary-color); color: var(--text-color);
    padding: 15px; display: flex; justify-content: space-between; align-items: center;
}
.header-info { display: flex; align-items: center; gap: 10px; }
.header-info img { width: 30px; height: 30px; border-radius: 50%; background: #fff; }
#close-chat { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }

/* Messages Area */
.chat-messages { flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }

.message {
    max-width: 80%; padding: 10px 15px; border-radius: 15px; font-size: 14px; line-height: 1.4;
    /* Box shadow removed to allow Tailwind classes like shadow-md to work */
}
.bot-msg { background: #f1f0f0; align-self: flex-start; border-bottom-left-radius: 2px; color: #333; }
.user-msg { background: var(--primary-color); color: var(--text-color); align-self: flex-end; border-bottom-right-radius: 2px; }

/* Animated Dots (Typing Indicator) */
.typing-indicator { align-self: flex-start; background: #f1f0f0; padding: 10px 15px; border-radius: 15px; display: flex; gap: 5px; }
.typing-indicator.hidden { display: none; }
.typing-indicator span {
    width: 8px; height: 8px; background: #999; border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Action Link */
.action-link { display: inline-block; margin-top: 10px; padding: 8px 15px; background: #28a745; color: white; text-decoration: none; border-radius: 5px; font-weight: bold; }

/* Input Area */
.chat-input-area { padding: 10px; border-top: 1px solid #ddd; display: flex; gap: 10px; }
.chat-input-area input { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 20px; outline: none; }
.chat-input-area button { background: var(--primary-color); color: #fff; border: none; padding: 10px 15px; border-radius: 20px; cursor: pointer; }

/* Logic Helpers */
.bg-dynamic {
    background: var(--primary-bg, var(--primary-color));
}

.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.chat-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
}
.chat-scroll::-webkit-scrollbar { width: 6px; }
.chat-scroll::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,0.2); border-radius: 3px; }