/* IntelliChat floating chatbox styles */
#intellichat-container {
    position: fixed;
    top: 50%;
    left: 0px;
    font-family: 'Inter', sans-serif; /* Using Inter font as per instructions */
    z-index: 999999;
}

#intellichat-toggle-button {
    background-color: #fc5c04;
    color: white;
    border: none;
    padding: 15px 5px;
    /* border-radius: 50px; Fully rounded for a bubble look */
    border-radius: 0px 10px 10px 0px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    writing-mode: vertical-lr;
    
}

#intellichat-toggle-button:hover {
    background-color: #04343C;  /* default colour: #005177; */
    transform: translateY(-2px);
}

#intellichat-chatbox {
    display: none; /* Hidden by default */
    background-color: #fff;
    border-radius: 10px; /* Rounded corners */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: 300px; /* Fixed width for chatbox */
    height: 450px; /* Fixed height for chatbox */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: Fixed;
    bottom: 20px;
    left: 20px;
    transform: translateY(100%); /* Start off-screen */
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    }

#intellichat-chatbox.open {
    display: flex;
    transform: translateY(-80px); /* Move into view */
    opacity: 1;
}

#intellichat-header {
    background-color: #fc5c04;
    color: white;
    padding: 15px;
    font-size: 1.2em;
    font-weight: bold;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#intellichat-close-button {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0 5px;
    transition: transform 0.2s ease;
}

#intellichat-close-button:hover {
    transform: rotate(90deg);
}

#intellichat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
    scroll-behavior: smooth;
}

.intellichat-message {
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.user-message {
    background-color: #e6f7ff; /* Light blue for user */
    color: #333;
    align-self: flex-end; /* Align to the right */
    margin-left: auto; /* Push to the right */
    border-bottom-right-radius: 0;
}

.bot-message {
    background-color: #f0f0f0; /* Light grey for bot */
    color: #333;
    align-self: flex-start; /* Align to the left */
    margin-right: auto; /* Push to the left */
    border-bottom-left-radius: 0;
}

#intellichat-input-area {
    display: flex;
    padding: 15px;
    background-color: #fff;
    border-top: 1px solid #eee;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

#intellichat-user-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px; /* Fully rounded input */
    margin-right: 10px;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s ease;
    width: 60%;
}

#intellichat-user-input:focus {
    border-color: #fc5c04;
}

#intellichat-send-button {
    background-color: #fc5c04;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px; /* Fully rounded button */
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#intellichat-send-button:hover {
    background-color: #005177;
    transform: translateY(-1px);
}

#intellichat-loading {
    text-align: center;
    padding: 10px;
    font-style: italic;
    color: #666;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    #intellichat-container {
        bottom: 100px;
        right: 0px;
        width: 10px;
    }

    #intellichat-chatbox {
        width: calc(100vw - 20px); /* Full width minus margin */
        height: calc(80vh - 20px); /* Larger height for mobile */
        max-height: 500px;
        bottom: 20px;
        Left: 10px;
    }

    #intellichat-chatbox.open {
        transform: translateY(-0); /* No translation on smaller screens */
    }

    #intellichat-toggle-button {
        padding: 12px 16px;
        font-size: 1em;
    }
}

/* Ensure the admin panel table looks good (basic WP styles apply, but additional tweaks if needed) */
.wp-list-table th, .wp-list-table td {
    vertical-align: middle;
    padding: 8px 10px;
}
.wp-list-table .column-session_id, .wp-list-table .column-id, .wp-list-table .column-user_ip {
    width: 10%;
}
.wp-list-table .column-timestamp {
    width: 15%;
}
.wp-list-table .column-user_message, .wp-list-table .column-bot_response {
    width: 25%;
}