﻿/* =======================================
   JohnnyLM Chatbot CSS
   Handles chatbot widget, overlay, messages, input, and mobile responsiveness
   Author: JohnnyLM
======================================= */

/* =======================
   Root Variables
======================= */
:root {
    --chatbot-bg: #111; /* Background color of chat window */
    --chatbot-header-bg: #000; /* Header background */
    --chatbot-user-color: #fff; /* User message color */
    --chatbot-bot-color: #4da3ff; /* Bot message color */
    --chatbot-input-bg: #222; /* Input background */
    --chatbot-input-color: #fff; /* Input text color */
    --chatbot-button-bg: #4da3ff; /* Send button color */
}

/* =======================
   Chatbot Overlay
   Semi-transparent fullscreen overlay for blur effect
======================= */
#chatbot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: none; /* hidden by default */
}

/* Fallback for browsers without blur support */
.no-blur #chatbot-overlay {
    background: rgba(0,0,0,0.6);
}

/* =======================
   Chatbot Widget Container
======================= */
#chatbot-widget {
    position: fixed;
    bottom: 60px;
    right: 20px;
    z-index: 10001;
    font-family: Arial, sans-serif;
}

/* Chat toggle button (bottom right) */
#chatbot-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1e1e1e;
    color: #fff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    z-index: 10002;
}

/* =======================
   Chat Window
======================= */
#chatbot-window {
    width: 320px;
    max-height: 85vh;
    height: 450px;
    background: var(--chatbot-bg);
    border: 1px solid #333;
    display: none; /* hidden by default */
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    border-radius: 8px;
    overflow: hidden;
    z-index: 10002;
    position: fixed;
    bottom: 90px; /* <-- from 60px to 90px */
    right: 20px;
}

/* Chat header */
#chatbot-header {
    background: var(--chatbot-header-bg);
    color: #fff;
    padding: 10px;
    font-weight: bold;
    text-align: center;
}

/* Messages container */
#chatbot-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    font-size: 14px;
}

/* User messages */
.chatbot-user {
    color: var(--chatbot-user-color);
    margin-bottom: 6px;
}

/* Bot messages */
.chatbot-bot {
    color: var(--chatbot-bot-color);
    margin-bottom: 10px;
    line-height: 1.4;
}

    .chatbot-bot a {
        color: var(--chatbot-bot-color);
        text-decoration: none;
        transition: color 0.2s;
    }

        .chatbot-bot a:hover {
            color: #fff;
        }

/* =======================
   Input Area
======================= */
#chatbot-input {
    display: flex;
    border-top: 1px solid #333;
}

    #chatbot-input input {
        flex: 1;
        padding: 8px;
        border: none;
        outline: none;
        background: var(--chatbot-input-bg);
        color: var(--chatbot-input-color);
    }

    #chatbot-input button {
        padding: 8px 12px;
        background: var(--chatbot-button-bg);
        border: none;
        cursor: pointer;
        color: #fff;
    }

/* =======================
   Mobile Adjustments
======================= */
@media (max-width: 768px) {
    #chatbot-widget {
        bottom: 33px;
        right: 13px;
    }

    #chatbot-window {
        width: 75vw;
        height: calc(100vh - 150px);
        bottom: 0;
        right: 0;
        border-radius: 12px 0 0 0;
    }

    #chatbot-header {
        position: sticky;
        top: 0;
        z-index: 2;
    }
}

/* =======================
   Smooth scrolling for messages
======================= */
#chatbot-messages {
    scroll-behavior: smooth;
}

    /* =======================
   Optional: hide scrollbar
======================= */
    #chatbot-messages::-webkit-scrollbar {
        width: 6px;
    }

    #chatbot-messages::-webkit-scrollbar-thumb {
        background: rgba(77,163,255,0.6);
        border-radius: 3px;
    }

    #chatbot-messages::-webkit-scrollbar-track {
        background: transparent;
    }

@media (max-width: 768px) {
    #chatbot-button {
        bottom: 45px;
    }
}