/**
 * CSS Utility
 * File: /my-chatbot/public/css/public-style.css
 * @package My-Chatbot
 * @version 1.0.0
 */
#chatbot-cta-text {
    position: fixed;
    bottom: 25px;       /* Adjust to match your icon's vertical center */
    right: 90px;        /* 20px (right margin) + 60px (icon width) + 10px (gap) */
    background-color: #ffffff;
    color: #333;
    padding: 8px 15px;
    margin-bottom: 50px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-family: sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    z-index: 9999;      /* Ensure it sits on top of other content */
    white-space: nowrap; /* Prevent text wrapping */
    transition: transform 0.2s ease;
}

/* Optional: Add a tiny arrow pointing to the icon */
#chatbot-cta-text::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid #ffffff;
}

/* Hover effect */
#chatbot-cta-text:hover {
    transform: scale(1.05);
}


/* ========================================
   CHATBOT PLUGIN STYLES
======================================== */
.thinking-bubble {
    font-style: italic;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dots span {
    display: inline-block;
    animation: blink 1.4s infinite both;
    font-weight: bold;
    font-size: 16px;
}

.dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0% { opacity: 0.2; }
    20% { opacity: 1; }
    100% { opacity: 0.2; }
}


.bot-msg, .user-msg {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 90%;
    line-height: 1.4em;
    word-wrap: break-word;
}

.bot-msg {
    background: #eef3ff;
    color: #222;
}

.user-msg {
    background: #d1ffe2;
    color: #222;
    margin-left: auto;
}


#chatbot-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    background: #fafafa;
    min-height: 250px;
    max-height: 300px;
}
#chatbot-messages {
    height: 350px; /* adjust to your design */
    overflow-y: auto;
    padding: 10px;
    scroll-behavior: smooth;
}

.thinking-bubble {
  opacity: 0.6;
  font-style: italic;
}

.chatbot-thinking {
    background: #f3f3f3;
    color: #666;
    padding: 8px 12px;
    margin: 6px 0;
    border-radius: 8px;
    font-style: italic;
    font-size: 14px;
    display: inline-block;
    animation: blink 1.4s infinite ease-in-out;
}

@keyframes blink {
    0% { opacity: 0.2; }
    50% { opacity: 1; }
    100% { opacity: 0.2; }
}

/* Main wrapper */
#chatbot-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    margin-bottom: 50px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* Floating chat icon */
#chatbot-icon {
    width: 60px;
    height: 60px;
    background: #0073aa; /* FIXED: Was ba/ckground */
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#chatbot-icon img {
    border-radius: 50%;
    width: 60px;  /* Adjust size as needed */
    height: 60px; /* Keep width and height equal for perfect circle */
    object-fit: cover; /* Ensures image fills the circle properly */
}
#chatbot-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* Chatbox container */
#chatbot-box {
    display:none;
    width: 340px;
    max-height: 500px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    flex-direction: column;
}

#chatbot-box.active {
    display: flex;
}

#chatbot-box.open {
  display: flex !important; /* Force show when open */
}

/* Header/Title */
#chatbot-title {
    background: #0073aa;
    color: #fff;
    padding: 12px;
    font-weight: bold;
    text-align: center;
    font-size: 16px;
}

/* Scrollable top menu */
#chatbot-menu {
    display: flex;
    overflow-x: auto;
    background: #f1f1f1;
    border-bottom: 1px solid #ddd;
    padding: 8px 5px;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: #0073aa #f1f1f1;
}

/* Webkit scrollbar for menu */
#chatbot-menu::-webkit-scrollbar {
    height: 6px;
}

#chatbot-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#chatbot-menu::-webkit-scrollbar-thumb {
    background: #0073aa;
    border-radius: 3px;
}

.chatbot-menu-item {
    flex: 0 0 auto;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    user-select: none;
}

.chatbot-menu-item:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.chatbot-menu-item.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Messages container */


/* Custom scrollbar for messages */
#chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

#chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#chatbot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

#chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* User message */
.user-msg {
    background: #0073aa;
    color: #fff;
    padding: 8px 12px;
    border-radius: 18px 18px 4px 18px;
    margin: 8px 0 8px auto;
    max-width: 75%;
    display: inline-block;
    word-wrap: break-word;
    text-align: left;
}

/* Bot message */
.bot-msg {
    background: #f1f1f1;
    color: #333;
    padding: 8px 12px;
    border-radius: 18px 18px 18px 4px;
    margin: 8px 0;
    max-width: 75%;
    display: inline-block;
    word-wrap: break-word;
    text-align: left;
}

/* Input area */
#chatbot-input-row {
    display: flex;
    align-items: center;
    border-top: 1px solid #ddd;
    padding: 8px;
    background: #fff;
}

#chatbot-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    font-family: inherit;
}

#chatbot-input:focus {
    border-color: #0073aa;
}

#chatbot-send {
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

#chatbot-send:hover {
    background: #005a87;
}

/* Bottom icon row */
#chatbot-icons {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #f9f9f9;
    border-top: 1px solid #ddd;
    padding: 10px 0;
}

.chat-icon {
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.7;
}

.chat-icon:hover {
    transform: scale(1.15);
    opacity: 1;
}

.chat-icon img {
    width: 24px;
    height: 24px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    #chatbot-wrapper {
        bottom: 10px;
        right: 10px;
    }
    
    #chatbot-box {
        width: calc(100vw - 20px);
        max-width: 340px;
    }
}

/* Loading animation */
.typing-indicator {
    display: inline-block;
    padding: 8px 12px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #999;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}
/* ========================================
   CHATBOT FULLSCREEN MODE
======================================== */

#chatbot-box.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    z-index: 10000 !important;
    box-shadow: none !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column;
}

#chatbot-box.fullscreen #chatbot-messages {
    flex: 1;
    max-height: none;
    min-height: 0;
    height: auto;
    padding: 20px;
    font-size: 15px;
    line-height: 1.5;
}

#chatbot-box.fullscreen #chatbot-input-row {
    padding: 15px;
    border-top: 2px solid #ddd;
}

#chatbot-box.fullscreen #chatbot-input {
    font-size: 16px;
    padding: 12px 14px;
}

#chatbot-box.fullscreen #chatbot-send {
    width: 50px;
    height: 50px;
    font-size: 18px;
}

#chatbot-box.fullscreen .bot-msg,
#chatbot-box.fullscreen .user-msg {
    max-width: 80%;
    font-size: 15px;
}

#chatbot-box.fullscreen #chatbot-title {
    background: #005a87;
    font-size: 18px;
    padding: 15px;
}

/* Fullscreen toggle button */
#chatbot-fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: none;
    color: #000;
    font-size: 20px;
    cursor: pointer;
    z-index: 10001;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

#chatbot-fullscreen-btn:hover {
    transform: scale(1.2);
    opacity: 0.9;
}

/* Add a subtle zoom transition when toggling fullscreen */
#chatbot-box {
    transition: all 0.3s ease;
}

