﻿/* Container and main elements */
.sitewide-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.chatbot-icon {
    background-color: #0096d2;
    color: #fff;
    border-radius: 30px;
    width: auto;
    min-width: 200px;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 25px;
    gap: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,.3);
    cursor: pointer;
    margin-bottom: 10px;
    transition: transform 0.2s ease;
    font-size: 16px;
}

    .chatbot-icon i {
        font-size: 20px;
    }

    .chatbot-icon:hover {
        transform: scale(1.1);
    }

/* Chat window */
.sw-chatbot-window {
    height: 550px;
    background-color: white;
    display: flex;
    flex-direction: column;
    border-radius: 15px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 350px;
}

/* Chat header */
.sw-chat-header {
    background-color: #0096d2;
    color: white;
    padding: 15px !important;
    font-weight: bold;
}

/* Chat body */
#sw-chat-body {
    background-color: white;
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Chat input area */
.sw-chat-input {
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    padding: 12px !important;
}

#sw-user-input {
    flex-grow: 1;
    background-color: #f0f0f0;
    border: none;
    height: 40px;
    margin-right: 10px;
    border-radius: 20px;
    padding-left: 10px;
    padding-right: 10px;
}

    #sw-user-input:focus {
        outline: none;
    }

#sw-send-button {
    background-color: #0096d2;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: white;
    border: none;
}

/* Message bubbles */
#sw-chat-body .d-flex.justify-content-end .rounded {
    background-color: #0096d2 !important;
    color: white;
    padding: 10px;
    border-radius: 15px;
    word-wrap: break-word;
    max-width: 70%;
}

#sw-chat-body .d-flex.justify-content-start .rounded {
    background-color: #f0f0f0;
    color: black;
    padding: 10px;
    border-radius: 15px;
    word-wrap: break-word;
    max-width: 70%;
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ccc;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: swSpin 1s linear infinite;
}

@keyframes swSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Voting section */
.sw-vote-section {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.sw-vote-icon {
    font-size: 1.2em;
    color: #0096d2;
    transition: color 0.3s, opacity 0.3s;
    cursor: pointer;
    margin-right: 8px;
}

    .sw-vote-icon:hover {
        color: #0056b3;
    }

.sw-vote-text {
    font-size: 0.8em;
    color: #555;
    transition: color 0.3s;
}

    .sw-vote-text.updated {
        color: #28a745;
    }

.sw-vote-icon.disabled {
    cursor: default;
}

/* Window state classes */
.sitewide-chatbot-container.sw-chatbot-minimized .sw-chatbot-window {
    display: none;
}

.sitewide-chatbot-container.sw-chatbot-open .sw-chatbot-window {
    display: flex;
}

.sitewide-chatbot-container.sw-chatbot-hidden {
    display: none;
}

/* Helper URLs section */
#sw-chat-body ul {
    list-style: none;
    padding-left: 0;
    margin: 10px 0;
}

    #sw-chat-body ul li {
        margin: 5px 0;
    }

        #sw-chat-body ul li a {
            color: #0096d2;
            text-decoration: none;
            word-break: break-all;
        }

            #sw-chat-body ul li a:hover {
                text-decoration: underline;
            }

/* Tips window */
.sw-tips-window {
    position: absolute;
    right: calc(350px + 20px); /* Positioned relative to chatbot's fixed width (350px) plus gap */
    bottom: 0;
    height: 550px; /* Match chatbot height */
    width: 45vw; /* Responsive width based on viewport */
    min-width: 500px; /* Minimum width to ensure readability */
    max-width: 800px; /* Maximum width to prevent excessive line lengths */
    background-color: white;
    display: none;
    flex-direction: column;
    border-radius: 15px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transform: translateX(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

    .sw-tips-window.visible {
        display: flex;
        transform: translateX(0);
        opacity: 1;
    }

.sw-tips-body {
    background-color: white;
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
}

/* Ensure the tips toggle button has proper spacing */
#tips-toggle-button {
    margin-left: 8px;
}

/* Add some basic styling for the tips content */
.sw-tips-body h1,
.sw-tips-body h2,
.sw-tips-body h3 {
    color: #333;
    margin-top: 1em;
    margin-bottom: 0.5em;
}

.sw-tips-body p {
    margin-bottom: 1em;
    line-height: 1.5;
}

.sw-tips-body ul,
.sw-tips-body ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

@media (max-width: 1200px) {
    .sw-tips-window {
        width: 35vw; /* Slightly narrower on smaller screens */
        min-width: 450px;
    }
}

.sw-tips-window.visible {
    display: flex;
    transform: translateX(0);
    opacity: 1;
}

.sw-tips-body {
    background-color: white;
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
}

.sw-chat-header button {
    transition: opacity 0.2s ease;
}

    .sw-chat-header button:hover {
        opacity: 0.8;
    }

.sw-chat-header .btn-link {
    text-decoration: none;
}

    .sw-chat-header .btn-link:focus {
        box-shadow: none;
    }

    .sw-chat-header .btn-link .fa {
        font-size: 1.2em; /* Makes icons 20% larger */
    }

/* Ensure buttons don't change size with larger icons */
.sw-chat-header .btn-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
}