/* ==========================================================================
   Assistant UI Interface Styles — Work Less AI Edition
   ========================================================================== */

:root {
    --aui-bg-overlay: #0f0f12;
    --aui-bg-card: #0f0f12;
    --aui-bg-sidebar: #121215;
    --aui-bg-input: #1c1c20;
    --aui-bg-chip: #1c1c20;
    --aui-bg-hover: #26262b;
    --aui-border: #242429;
    --aui-border-focus: #3f3f46;
    --aui-text-main: #ffffff;
    --aui-text-muted: #9e9ea7;
    --aui-text-placeholder: #686873;
    --aui-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Modal Overlay */
.assistant-ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--aui-bg-card);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 0 !important;
    box-sizing: border-box;
    font-family: var(--aui-font-family);
}

.assistant-ui-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Exit Close Button (Top Right Header Position) */
.aui-exit-btn {
    position: absolute;
    top: 12px;
    right: 18px;
    background: transparent;
    border: none;
    color: var(--aui-text-muted);
    font-size: 24px;
    cursor: pointer;
    z-index: 100002;
    transition: color 0.2s ease;
    line-height: 1;
}

.aui-exit-btn:hover {
    color: #ffffff;
}

/* Main Inner Frame Card — 100% Full Width & Height */
.assistant-ui-app {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    background: var(--aui-bg-card);
    border: none !important;
    border-radius: 0 !important;
    display: flex;
    overflow: hidden;
    box-shadow: none !important;
    position: relative;
}

/* Sidebar Styles */
.aui-sidebar {
    width: 240px;
    background: var(--aui-bg-sidebar);
    border-right: 1px solid var(--aui-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 16px;
    user-select: none;
    transition: all 0.25s ease;
}

.aui-sidebar.collapsed {
    width: 0;
    padding: 0;
    opacity: 0;
    overflow: hidden;
    border-right: none;
}

.aui-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    color: var(--aui-text-main);
    margin-bottom: 16px;
}

.aui-new-thread-btn {
    width: 100%;
    padding: 9px 12px;
    background: #26262b;
    color: var(--aui-text-main);
    border: 1px solid var(--aui-border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    margin-bottom: 24px;
}

.aui-new-thread-btn:hover {
    background: #323238;
}

.aui-history-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.aui-history-label {
    font-size: 12px;
    color: var(--aui-text-muted);
    font-weight: 500;
    margin-bottom: 6px;
    padding-left: 4px;
}

.aui-history-item {
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--aui-text-muted);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s ease;
}

.aui-history-item:hover, .aui-history-item.active {
    background: var(--aui-bg-hover);
    color: var(--aui-text-main);
}

/* Main Chat Canvas */
.aui-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--aui-bg-card);
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Top Header Bar */
.aui-header {
    height: 52px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid transparent;
}

.aui-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.aui-icon-btn {
    background: transparent;
    border: none;
    color: var(--aui-text-muted);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.aui-icon-btn:hover {
    background: var(--aui-bg-hover);
    color: var(--aui-text-main);
}

.aui-chat-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--aui-text-main);
}

.aui-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 36px;
}

/* Thread & Messages Container */
.aui-messages-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
}

/* Welcome Center View */
.aui-welcome-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
    width: 100%;
    max-width: 820px;
    text-align: center;
}

.aui-welcome-heading {
    font-size: 28px;
    font-weight: 600;
    color: var(--aui-text-main);
    margin-bottom: 28px;
    letter-spacing: -0.4px;
}

/* Floating Input Box Pill — NO BORDER */
.aui-input-box {
    width: 100%;
    background: var(--aui-bg-input);
    border: none !important;
    outline: none !important;
    border-radius: 20px;
    padding: 16px 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: none !important;
}

.aui-input-box:focus-within {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.aui-composer-input {
    width: 100%;
    background: transparent;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: var(--aui-text-main);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 24px;
    max-height: 140px;
    line-height: 1.5;
}

.aui-composer-input::placeholder {
    color: var(--aui-text-placeholder);
}

.aui-input-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.aui-input-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aui-tool-btn {
    background: transparent;
    border: none;
    color: var(--aui-text-muted);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: color 0.15s ease;
}

.aui-tool-btn:hover {
    color: #ffffff;
}

/* Plus Dropdown Menu */
.aui-plus-dropdown-wrap {
    position: relative;
}

.aui-plus-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #1c1c20;
    border: 1px solid var(--aui-border);
    border-radius: 12px;
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    width: 210px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.aui-plus-dropdown-menu.show {
    display: flex;
}

.aui-plus-item {
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--aui-text-main);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s ease;
}

.aui-plus-item:hover {
    background: #28282e;
}

/* Model Selector Dropdown Wrap — Opens Downwards */
.aui-model-dropdown-wrap {
    position: relative;
}

.aui-model-btn {
    background: transparent;
    border: none;
    color: var(--aui-text-main);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 12px;
    transition: background 0.15s ease;
}

.aui-model-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

.aui-model-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    bottom: auto;
    left: 0;
    background: #1c1c20;
    border: 1px solid var(--aui-border);
    border-radius: 12px;
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    width: 180px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.aui-model-dropdown-menu.show {
    display: flex;
}

.aui-model-item {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--aui-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.aui-model-item:hover, .aui-model-item.selected {
    background: #28282e;
    color: #ffffff;
}

.aui-input-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aui-mic-btn {
    background: transparent;
    border: none;
    color: var(--aui-text-muted);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: color 0.15s ease;
}

.aui-mic-btn:hover {
    color: #ffffff;
}

.aui-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2b2b30;
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 12px;
}

.aui-send-btn:hover {
    background: #e4e4e7;
    color: #000000;
}

/* Quick Action Chips Row — SINGLE LINE NO WRAP */
.aui-chips-row {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-top: 20px !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 820px !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    scrollbar-width: none !important;
}

.aui-chips-row::-webkit-scrollbar {
    display: none !important;
}

.aui-chip {
    background: var(--aui-bg-chip);
    border: 1px solid var(--aui-border);
    border-radius: 20px;
    padding: 6px 12px !important;
    color: var(--aui-text-main);
    font-size: 12px !important;
    font-weight: 400;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    gap: 6px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    transition: all 0.15s ease;
}

.aui-chip:hover {
    background: var(--aui-bg-hover);
    border-color: var(--aui-border-focus);
}

/* Bottom Disclaimer Styling */
.aui-footer-disclaimer {
    font-size: 11px;
    color: #686873;
    margin-top: 24px;
    text-align: center;
    max-width: 640px;
    line-height: 1.5;
}

.aui-footer-disclaimer a {
    color: #a1a1aa;
    text-decoration: underline;
    transition: color 0.15s ease;
}

.aui-footer-disclaimer a:hover {
    color: #ffffff;
}

/* Message items for active chat session */
.aui-msg {
    display: flex;
    gap: 14px;
    max-width: 760px;
    width: 100%;
    margin: 0 auto 16px;
}

.aui-msg.user {
    flex-direction: row-reverse;
}

.aui-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #26262b;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.aui-msg.user .aui-msg-avatar {
    background: #ffffff;
    color: #000000;
}

.aui-msg-bubble {
    background: #1c1c20;
    border: none !important;
    border-radius: 16px;
    padding: 12px 16px;
    color: var(--aui-text-main);
    font-size: 14px;
    line-height: 1.6;
}

.aui-msg.user .aui-msg-bubble {
    background: #26262b;
}

/* Code snippet formatting */
.aui-code-block {
    background: #141417;
    border: 1px solid var(--aui-border);
    border-radius: 10px;
    margin: 10px 0;
    overflow: hidden;
}

.aui-code-header {
    background: #1c1c20;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--aui-text-muted);
}

.aui-code-block pre {
    margin: 0;
    padding: 12px;
    font-family: monospace;
    font-size: 13px;
    color: #d1d5db;
    overflow-x: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .aui-chips-row {
        justify-content: flex-start !important;
    }
}

/* ==========================================
   Light Theme Override Classes
   ========================================== */
.assistant-ui-overlay.light-theme {
    --aui-bg-overlay: #ffffff !important;
    --aui-bg-card: #ffffff !important;
    --aui-bg-sidebar: #f8fafc !important;
    --aui-bg-input: #f1f5f9 !important;
    --aui-bg-chip: #e2e8f0 !important;
    --aui-bg-hover: #e2e8f0 !important;
    --aui-border: #cbd5e1 !important;
    --aui-border-focus: #94a3b8 !important;
    --aui-text-main: #0f172a !important;
    --aui-text-muted: #475569 !important;
    --aui-text-placeholder: #64748b !important;
    background: #ffffff !important;
    color: #0f172a !important;
}

.assistant-ui-overlay.light-theme .assistant-ui-app,
.assistant-ui-overlay.light-theme .aui-main,
.assistant-ui-overlay.light-theme .aui-header,
.assistant-ui-overlay.light-theme .aui-sidebar,
.assistant-ui-overlay.light-theme .aui-messages-container,
.assistant-ui-overlay.light-theme .aui-welcome-state {
    background: #ffffff !important;
    color: #0f172a !important;
}

.assistant-ui-overlay.light-theme .aui-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.assistant-ui-overlay.light-theme .aui-header img,
.assistant-ui-overlay.light-theme .aui-sidebar-brand img {
    filter: brightness(0) !important;
}

.assistant-ui-overlay.light-theme .aui-welcome-heading,
.assistant-ui-overlay.light-theme h1,
.assistant-ui-overlay.light-theme h2,
.assistant-ui-overlay.light-theme h3 {
    color: #0f172a !important;
}

.assistant-ui-overlay.light-theme .aui-input-box {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

.assistant-ui-overlay.light-theme .aui-composer-input {
    background: transparent !important;
    color: #0f172a !important;
}

.assistant-ui-overlay.light-theme .aui-composer-input::placeholder {
    color: #64748b !important;
}

.assistant-ui-overlay.light-theme .aui-chip-item {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

/* Light Theme Master Overrides */
#assistant-ui-overlay.light-theme,
#assistant-ui-overlay.light-theme .assistant-ui-app,
#assistant-ui-overlay.light-theme .aui-main,
#assistant-ui-overlay.light-theme .aui-messages-container,
#assistant-ui-overlay.light-theme .aui-welcome-state {
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: #0f172a !important;
}

#assistant-ui-overlay.light-theme .aui-header {
    background-color: #f8fafc !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

#assistant-ui-overlay.light-theme .aui-sidebar {
    background-color: #f1f5f9 !important;
    background: #f1f5f9 !important;
    border-right: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

#assistant-ui-overlay.light-theme .aui-header img,
#assistant-ui-overlay.light-theme .aui-sidebar-brand img {
    filter: brightness(0) !important;
}

#assistant-ui-overlay.light-theme .aui-welcome-heading,
#assistant-ui-overlay.light-theme h1,
#assistant-ui-overlay.light-theme h2,
#assistant-ui-overlay.light-theme h3,
#assistant-ui-overlay.light-theme span {
    color: #0f172a !important;
}

#assistant-ui-overlay.light-theme .aui-input-box {
    background-color: #f8fafc !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06) !important;
}

#assistant-ui-overlay.light-theme .aui-composer-input {
    background-color: transparent !important;
    background: transparent !important;
    color: #0f172a !important;
}

#assistant-ui-overlay.light-theme .aui-composer-input::placeholder {
    color: #64748b !important;
}

#assistant-ui-overlay.light-theme .aui-chip-item {
    background-color: #f1f5f9 !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
