/* Chat widget - shared stylesheet.
 *
 * Extracted from the per-page copies that lived inline in
 * src/views/home/landing.php (lines 2496-2740), src/views/home/about.php,
 * src/views/auth/login.php and src/views/auth/register.php.
 *
 * Markup: src/views/partials/chat_widget.php
 * Script: /static/js/chat_widget.js
 *
 * The inline copies used `body .x { ... !important }` on every declaration.
 * Those pages still carry their own copies; new pages should link this file
 * instead. The !important hammer is unnecessary here because nothing else
 * competes for these selectors, so it has been dropped.
 */

body .chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
    transition: transform 0.3s ease;
}

/* The widget ships with class="chat-widget hidden" so it starts collapsed. */
body .chat-widget.hidden {
    display: none;
}

body .chat-header {
    padding: 15px 20px;
    background: var(--primary, #0c4b33);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body .chat-header h2 {
    font-weight: 600;
    font-size: 18px;
    margin: 0;
}

body .chat-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background: #f5f5f5;
}

body .tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    cursor: pointer;
    font-weight: 500;
    color: #65676b;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

body .tab.active {
    color: var(--primary, #0c4b33);
    border-bottom: 3px solid var(--primary, #0c4b33);
    background: white;
}

body .ai-tab {
    color: var(--secondary, #6db33f);
}

body .ai-tab.active {
    color: var(--secondary, #6db33f);
    border-bottom: 3px solid var(--secondary, #6db33f);
}

body .chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body .tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: none;
}

body .tab-content.active {
    display: flex;
    flex-direction: column;
}

body .no-chat {
    text-align: center;
    color: #65676b;
    margin: auto;
    padding: 20px;
}

body .no-chat i {
    font-size: 50px;
    margin-bottom: 15px;
    color: #bec3c9;
}

body .no-chat h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #050505;
}

body .no-chat p {
    font-size: 14px;
    line-height: 1.5;
}

body .ai-welcome {
    background: #f0f7ff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

body .ai-welcome h4 {
    color: var(--primary, #0c4b33);
    margin-bottom: 10px;
}

body .ai-capabilities {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

body .capability {
    background: #e8f4ff;
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 13px;
    color: var(--primary, #0c4b33);
}

body .chat-input {
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
}

body .chat-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

body .chat-input button {
    background: var(--primary, #0c4b33);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

body .chat-input button:hover {
    background: #0a3a26;
}

body .minimize-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
}

body .chat-closed {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--primary, #0c4b33);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 1000;
    font-size: 24px;
    border: 2px solid white;
}

body .chat-closed i {
    font-size: 24px;
}

/* AI conversation bubbles */
body .message-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

body .message-sender {
    font-size: 12px;
    margin-bottom: 5px;
    color: #65676b;
}

body .message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

body .ai-message {
    background: #e8f4ff;
    color: #050505;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

body .user-message {
    background: var(--primary, #0c4b33);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Matches the variant login.php carried; landing.php had no mobile rule. */
@media (max-width: 768px) {
    body .chat-widget {
        width: 300px;
        height: 460px;
    }
}