/* XTBAI - Common AI Toolbar Component Styles */

/* AI toolbar row styles */
.ai-toolbar-row {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
}

.ai-toolbar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 6px 6px 0;
    font-size: 16px;
}

/* AI toolbar buttons - transparent background, no border, hover highlight */
.ai-toolbar-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: var(--bs-light, #f8f9fa);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.15s;
    white-space: nowrap;
}

.ai-toolbar-btn:hover {
    background: var(--bs-gray-700, #495057);
}

.ai-toolbar-btn-icon {
    font-size: 14px;
}

.ai-toolbar-separator {
    width: 1px;
    height: 20px;
    background: rgba(108, 117, 125, 0.5);
    margin: 0 4px;
}

/* Fullscreen toggle button - positioned at end */
.ai-toolbar-fullscreen-btn {
    margin-left: auto;
}

/* Submenu trigger with dropdown */
.ai-toolbar-submenu-trigger {
    position: relative;
}

.ai-toolbar-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px 0;
    margin-top: 4px;
    background: var(--bs-dark, #212529);
    border: 1px solid rgba(108, 117, 125, 0.5);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1001;
}

.ai-toolbar-submenu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    color: var(--bs-light, #f8f9fa);
    transition: background-color 0.15s;
}

.ai-toolbar-submenu-item:hover {
    background-color: var(--bs-gray-700, #495057);
}

.ai-toolbar-submenu-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

/* Backdrop for closing submenus */
.ai-submenu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
}

/* AI Toolbar Header - common styling for both XHtml and XRich */
.ai-toolbar-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    background: var(--bs-dark, #212529);
    border: 1px solid rgba(108, 117, 125, 0.5);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    flex: 0 0 auto;
    flex-wrap: wrap;
}

.ai-toolbar-header.no-border-radius {
    border-radius: 0;
}

/* AI Result and Context Preview styles */
.ai-result-preview {
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
    padding: 12px;
    background: var(--bs-body-bg);
    max-height: 320px;
    overflow-y: auto;
}

.ai-context-preview {
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
    padding: 8px;
    background: var(--bs-secondary-bg);
    max-height: 100px;
    overflow-y: auto;
    font-size: 12px;
    color: var(--bs-secondary-color);
}
