/* Import a modern font for the header */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700&display=swap');

/* Reset common parent container constraints to ensure full width */
.entry-content,
.wp-block-post-content,
.container,
.site-content,
section,
.row,
.col,
.x-section,
.x-row,
.x-col,
#section_336822571,
body {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}

/* General container styling */
.oac-chatbot-container {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    width: 100vw;
    min-height: 100vh;
}

/* Sidebar styling */
.oac-chatbot-sidebar {
    width: 25%;
    background: #2d3748;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid #4b5563;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.oac-sidebar-header {
    padding: 16px;
    background: #374151;
    border-bottom: 1px solid #4b5563;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.oac-sidebar-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #d1d5db;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
}

.oac-new-chat-button {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #d5d5d5;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.oac-new-chat-button:hover {
    background: #e5e5e5;
    color: #000;
    transform: scale(1.02);
}

.oac-new-chat-button .dashicons {
    margin-right: 5px;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.oac-thread-list {
    padding: 10px 0;
}

.oac-thread-item {
    padding: 15px 20px;
    margin: 5px 10px;
    background: #4b5563;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #d1d5db;
    pointer-events: auto;
}

.oac-thread-item:hover {
    background: #5a6575;
    transform: translateX(2px);
}

.oac-thread-item.active {
    background: #6b7280;
    font-weight: bold;
}

.oac-thread-date {
    font-size: 12px;
    color: #9ca3af;
}

/* Embedded container styling */
.oac-chatbot-container.embedded {
    width: 100vw;
    background: #f5f5f5;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
}

.oac-chatbot-container.embedded .oac-chatbot-window {
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
    flex: 1;
    min-height: 100vh;
    max-height: 100vh;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    border: none;
    overflow: hidden;
    box-sizing: border-box;
}

/* Floating mode container */
.oac-chatbot-container.floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 100%;
    max-width: 1200px;
    display: flex;
}

/* Floating mode chat window */
.oac-chatbot-container.floating .oac-chatbot-window {
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
    flex: 1;
    min-height: 500px;
    max-height: 80vh;
    margin-left: 0;
    display: flex;
    flex-direction: column;
    border: none;
    overflow: hidden;
}

/* Header styling for "FATTAIL AI" */
.oac-chatbot-container .oac-chatbot-window .oac-chatbot-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    background: #e5e5e5;
    border-bottom: 1px solid #d5d5d5;
}

/* Title styling */
.oac-chatbot-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1;
}

/* Messages area */
.oac-chatbot-messages {
    flex: 1 1 auto;
    min-height: 400px;
    padding: 20px 5%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cccccc #ffffff;
}

/* Custom scrollbar */
.oac-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}
.oac-chatbot-messages::-webkit-scrollbar-track {
    background: #ffffff;
}
.oac-chatbot-messages::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 3px;
}

/* Message styling */
.oac-user-message, .oac-assistant-message, .oac-thinking-message {
    margin: 8px 0;
    max-width: 90%;
    line-height: 1.6;
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    animation: slideIn 0.3s ease-out;
}

/* User message (right-aligned) */
.oac-user-message {
    background: #e5e5e5;
    color: #333;
    align-self: flex-end;
    margin-left: auto;
    border-radius: 12px 0 12px 12px;
    padding: 10px 15px;
}

/* Assistant message (left-aligned) */
.oac-assistant-message {
    background: #ffffff;
    color: #333;
    align-self: flex-start;
    border-radius: 0 12px 12px 12px;
    padding: 10px 15px;
}

/* Thinking message (no bubble) */
.oac-thinking-message {
    align-self: flex-start;
    padding: 10px 15px;
    background: none;
    border-radius: 0;
}

/* Style for the thinking message text with higher specificity */
.oac-message.oac-thinking-message .oac-text-content {
    font-style: italic;
    font-weight: 600;
    font-size: 18px;
    color: #333;
    display: inline-flex !important;
    align-items: center;
}

/* Bouncing balls animation with higher specificity */
.oac-message.oac-thinking-message .oac-text-content .bouncing-balls {
    display: inline-flex !important;
    align-items: center;
    margin-left: 5px;
}

.oac-message.oac-thinking-message .oac-text-content .bouncing-balls span {
    display: inline-block !important;
    width: 8px !important;
    height: 8px !important;
    background: #1976d2 !important;
    border-radius: 50% !important;
    margin: 0 2px !important;
    animation: bounce 0.6s infinite ease-in-out !important;
}

.oac-message.oac-thinking-message .oac-text-content .bouncing-balls span:nth-child(2) {
    animation-delay: 0.2s !important;
}

.oac-message.oac-thinking-message .oac-text-content .bouncing-balls span:nth-child(3) {
    animation-delay: 0.4s !important;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Ensure text content is visible */
.oac-text-content {
    display: block;
}

/* Ensure image content is visible */
.oac-image-content {
    display: block;
    margin-top: 10px;
}

/* Style for charts/images in assistant messages */
.oac-image-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-top: 10px;
}

/* Fallback style for direct images in assistant messages */
.oac-assistant-message img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-top: 10px;
}

/* Style for lists within assistant messages */
.oac-assistant-message ul {
    list-style-type: disc;
    padding-left: 20px;
    margin: 10px 0;
}

.oac-assistant-message li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Style for paragraphs (line breaks) */
.oac-assistant-message br {
    margin-bottom: 8px;
    display: block;
    content: "";
}

/* Style for bold text */
.oac-assistant-message strong {
    font-weight: bold;
}

/* File bubble container (next to input) */
.oac-file-bubble-container {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

/* File bubble styling (mimicking ChatGPT) */
.oac-file-bubble {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border: 1px solid #d5d5d5;
    border-radius: 10px;
    padding: 5px 10px;
    margin: 0;
    max-width: 200px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.oac-file-bubble .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    color: #666;
}

.oac-file-bubble .dashicons-media-text {
    color: #1976d2;
}

.oac-file-bubble .dashicons-media-pdf {
    color: #d32f2f;
}

.oac-file-bubble .oac-file-name {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oac-file-bubble .oac-file-remove {
    background: none;
    border: none;
    padding: 0;
    margin-left: 8px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
}

.oac-file-bubble .oac-file-remove:hover {
    color: #ff5555;
}

.oac-file-bubble .oac-file-remove .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin: 0;
}

/* Microphone button */
.oac-mic-button {
    padding: 0;
    margin: 0 10px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.oac-mic-button:hover {
    color: #000;
}

.oac-mic-button.listening {
    color: #ff5555;
}

.oac-mic-button .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* File upload button */
.oac-file-upload-button {
    padding: 0;
    margin: 0 10px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.oac-file-upload-button:hover {
    color: #000;
}

.oac-file-upload-button .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Sound waves animation */
.sound-waves {
    display: flex;
    align-items: center;
    margin-left: 5px;
}

.sound-waves span {
    display: inline-block;
    width: 3px;
    height: 8px;
    background: #ff5555;
    margin: 0 2px;
    animation: wave 0.5s infinite ease-in-out;
}

.sound-waves span:nth-child(2) {
    animation-delay: 0.2s;
}

.sound-waves span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes wave {
    0%, 100% { height: 8px; }
    50% { height: 16px; }
}

/* Speaker button */
.oac-speak-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
}

.oac-speak-button .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.oac-speak-button:hover {
    color: #000;
}

/* Error message */
.oac-error-message {
    color: #ff5555;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 12px;
    background: rgba(255, 85, 85, 0.1);
    max-width: 70%;
    align-self: center;
    text-align: center;
}

/* Input form - Bubble style like Grok */
.oac-chatbot-form {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: transparent;
}

/* Input container */
.oac-chatbot-input-container {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 50px;
    padding: 10px 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    max-width: none;
    width: 100%;
    flex-wrap: wrap;
}

/* Input field */
.oac-chatbot-input {
    flex: 1;
    padding: 5px 10px;
    border: none;
    border-radius: 24px;
    background: transparent;
    color: #333;
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    outline: none;
    min-width: 200px;
}

.oac-chatbot-input:focus {
    box-shadow: none;
}

/* Send button (Arrow) */
.oac-chatbot-form button[type="submit"] {
    padding: 0;
    margin-left: 10px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.oac-chatbot-form button[type="submit"]:hover {
    color: #000;
}

.oac-chatbot-form button[type="submit"]::before {
    content: '\f142';
    font-family: 'Dashicons';
    font-size: 20px;
    width: 20px;
    height: 20px;
    transform: rotate(45deg);
}

/* Floating toggle button */
.oac-chatbot-toggle {
    background: #666;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
}

/* Animation for messages */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}