/**
 * Vubli AI Settings - Styles
 *
 * @package VubliAISettings
 */

.ai-prompt-settings-section {
    display: flex;
    align-items: center;
    max-width: 100%;
    width: 100%;
    /* padding: 16px;
    padding-right: 58px;
    min-height: 89px;
    box-sizing: border-box;
    border-bottom: 1px solid #f5f5f5;
    border-radius: 0px;
    transition: background-color 0.2s ease; */
}

.ai-prompt-settings-section .ai-prompt-settings-section-inner {
    width: 100%;
}

.vubli-ai-captions-text {
    font-size: 15px;
}

.ai-prompt-settings-section:hover {
    background-color: #F9FAFB;
}

h1.main-styled-text.vubli-ai-prompts-page-title {
    margin-bottom: 8px;
    font-size: 20px;
    font-weight: 700 !important;
}

.vubli-ai-prompts-page-subtext {
    margin: 0 0 24px 0;
    font-size: 15px;
    font-weight: 400;
    color: #717680;
    line-height: 1.4;
}

.vubli-ai-prompt-options-btn .splashecons-container{
    pointer-events: none;
}

.vubli-ai-settings-tabs {
    width: 100%;
    background: #ffffff;
}

.vubli-ai-settings-tabs-nav {
    display: flex;
    align-items: center;
    gap: 0;
    border-bottom: 1px solid #E0E6EB;
    margin-bottom: 0;
    padding: 0;
}

.vubli-ai-settings-tab-btn {
    background: transparent;
    border: none;
    padding: 8px 22px;
    cursor: pointer;
    position: relative;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    border-radius: 8px 8px 0 0;
}

.vubli-ai-settings-tab-text {
    font-weight: 700;
    font-size: 16px;
    /* letter-spacing: -1px; */
    color: #0F2F4D;
    transition: color 0.2s ease;
    display: block;
}

.vubli-ai-settings-tab-btn.active .vubli-ai-settings-tab-text {
    color: rgb(124, 200, 84);
}

.vubli-ai-settings-tab-btn:not(.active) .vubli-ai-settings-tab-text {
    color: #0F2F4D;
}

.vubli-ai-settings-tab-btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background-color: rgb(124, 200, 84);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.vubli-ai-settings-tab-btn.active::after {
    transform: scaleX(1);
}

.vubli-ai-settings-tabs-content {
    position: relative;
    min-height: 200px;
}

.vubli-ai-settings-tab-panel {
    display: none;
    padding: 20px 0;
}

.vubli-ai-settings-tab-panel.active {
    display: block;
}

.vubli-ai-settings-tab-content-inner {
    width: 100%;
}

/* Hover and focus effects */
.vubli-ai-settings-tab-btn:hover,
.vubli-ai-settings-tab-btn:focus {
    background-color: #f9fafb;
}

.vubli-ai-settings-tab-btn:hover .vubli-ai-settings-tab-text,
.vubli-ai-settings-tab-btn:focus .vubli-ai-settings-tab-text {
    color: #7cc854;
}

/* Prompts Tab Content */
.vubli-ai-prompts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

html.vubli-embedded-in-iframe .vubli-ai-prompts-tabs-wrap{
    margin-top: 0px;
}

html.vubli-embedded-in-iframe .ai-prompt-settings-section{
    padding-left: 24px;
    width: 395px;
    max-width: 100%;
    margin: 0 auto;
    padding-right: 24px;
    padding-top: 24px;
}

.vubli-ai-prompts-description {
    color: #4b5563;
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
    flex: 1;
    min-width: 200px;
}

.vubli-ai-add-prompt-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #ffffff;
    border: 1px solid rgb(124, 200, 84);
    border-radius: 6px;
    color: rgb(124, 200, 84);
    font-size: 14px;
    font-weight: 600;
    line-height: 14px;
    height: 32px;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.vubli-ai-add-prompt-btn:hover {
    background-color: rgb(124, 200, 84);
    border-color: rgb(124, 200, 84);
    color: #ffffff;
}

.vubli-ai-add-prompt-btn:hover .vubli-ai-plus-icon {
    stroke: #ffffff;
}

.vubli-ai-add-prompt-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 200, 84, 0.1);
}

.vubli-ai-add-prompt-btn:focus:hover {
    background-color: rgb(124, 200, 84);
    color: #ffffff;
}

.vubli-ai-add-prompt-btn:focus:hover .vubli-ai-plus-icon {
    stroke: #ffffff;
}

/* Add Context button (same style as Add Prompt, no shared handler) */
.vubli-ai-add-context-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #ffffff;
    border: 1px solid rgb(124, 200, 84);
    border-radius: 6px;
    color: rgb(124, 200, 84);
    font-size: 14px;
    font-weight: 600;
    line-height: 14px;
    height: 32px;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.vubli-ai-add-context-btn:hover {
    background-color: rgb(124, 200, 84);
    border-color: rgb(124, 200, 84);
    color: #ffffff;
}

.vubli-ai-add-context-btn:hover .vubli-ai-plus-icon {
    stroke: #ffffff;
}

.vubli-ai-add-context-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 200, 84, 0.1);
}

.vubli-ai-add-context-btn .vubli-ai-plus-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    flex-shrink: 0;
}

.vubli-ai-plus-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    flex-shrink: 0;
}

/* Prompt Dropdown */
.vubli-ai-add-prompt-wrapper {
    position: relative;
    display: inline-block;
}

.vubli-ai-prompt-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid #E0E6EB;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    min-width: 280px;
    padding: 8px;
    display: none;
    z-index: 1000;
}

.vubli-ai-prompt-dropdown.active {
    display: block;
}

.vubli-ai-prompt-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    background-color: transparent;
}

.vubli-ai-prompt-option:last-child {
    margin-bottom: 0;
}

.vubli-ai-prompt-option:hover {
    background-color: #F9FAFB;
}

.vubli-ai-prompt-option.active {
    background-color: #F3FAF0;
}

.vubli-ai-prompt-option-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vubli-ai-prompt-option-icon svg {
    transition: all 0.2s ease;
}

.vubli-ai-prompt-option:hover .vubli-ai-prompt-option-icon svg path {
    stroke: rgb(124, 200, 84);
}

.vubli-ai-prompt-option-content {
    flex: 1;
}

.vubli-ai-prompt-option-title {
    font-size: 14px;
    font-weight: 600;
    color: #0F2F4D;
    margin: 0 0 4px 0;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.vubli-ai-prompt-option:hover .vubli-ai-prompt-option-title {
    color: rgb(124, 200, 84);
}

.vubli-ai-prompt-option-description {
    font-size: 12px;
    color: #6B7280;
    margin: 0;
    line-height: 1.5;
}

/* Prompts List */
.vubli-ai-prompts-list {
    margin-top: 24px;
}



/* Match height of main-container-row.upload-entry (89px) */
.vubli-ai-prompt-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #f5f5f5;
    position: relative;
    min-height: 89px;
    box-sizing: border-box;
}

.vubli-ai-prompt-item:last-child {
    border-bottom: none;
}

.vubli-ai-prompt-item:hover {
    background-color: #F9FAFB;
    margin: 0 -16px;
    padding: 16px;
}

/* Selected/checked prompt row */
.vubli-ai-prompt-item:has(.vubli-ai-prompt-toggle:checked) {
    background-color: #F9FAFB;
    margin: 0 -16px;
    padding: 16px;
}

.vubli-ai-prompt-item:has(.vubli-ai-prompt-toggle:checked) .vubli-ai-prompt-item-title {
    color: rgb(124, 200, 84);
}

.vubli-ai-prompt-item:has(.vubli-ai-prompt-toggle:checked) .vubli-ai-prompt-item-icon svg,
.vubli-ai-prompt-item:has(.vubli-ai-prompt-toggle:checked) .vubli-ai-prompt-item-icon svg path {
    stroke: rgb(124, 200, 84);
}

.vubli-embedded-in-iframe .vubli-ai-prompt-item{
    margin: 0 -24px;
    padding-left: 24px;
    padding-right: 24px;
}

.vubli-embedded-in-iframe .vubli-ai-prompt-item:hover{
    margin: 0 -24px;
    padding-left: 24px;
    padding-right: 24px;
}

.vubli-embedded-in-iframe .vubli-ai-prompt-item:has(.vubli-ai-prompt-toggle:checked) {
    margin: 0 -24px;
    padding-left: 24px;
    padding-right: 24px;
}

.vubli-ai-prompt-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.vubli-ai-prompt-item-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vubli-ai-prompt-item-icon svg {
    width: 100%;
    height: 100%;
}

.vubli-ai-prompt-item-info {
    flex: 1;
}

.vubli-ai-prompt-item-title {
    font-size: 14px;
    font-weight: 600;
    color: rgb(51, 51, 51);
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.vubli-ai-prompt-item-description {
    font-size: 12px;
    color: #4b5563;
    margin: 0;
    line-height: 1.5;
}

.vubli-ai-prompt-item-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    position: relative;
}

/* Prompt list: radio button (Tailwind-style – rounded-full, ring-2, checked:bg) */
.vubli-ai-prompt-radio-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.vubli-ai-prompt-radio-wrap .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.vubli-ai-prompt-radio-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    border-radius: 9999px;
    border: 2px solid #d1d5db;
    background-color: #fff;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.vubli-ai-prompt-radio-dot::after {
    content: "";
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 9999px;
    background-color: #fff;
    transform: scale(0);
    transition: transform 0.15s ease;
}

.vubli-ai-prompt-radio-wrap:hover .vubli-ai-prompt-radio-dot {
    border-color: #9ca3af;
}

.vubli-ai-prompt-radio-wrap input:checked + .vubli-ai-prompt-radio-dot {
    border-color: rgb(124, 200, 84);
    background-color: rgb(124, 200, 84);
}

.vubli-ai-prompt-radio-wrap input:checked + .vubli-ai-prompt-radio-dot::after {
    transform: scale(1);
}

.vubli-ai-prompt-radio-wrap input:focus-visible + .vubli-ai-prompt-radio-dot {
    outline: 2px solid rgb(124, 200, 84);
    outline-offset: 2px;
}

/* Toggle Switch – matches .toggle-email-notifications (track h-6 w-11, thumb h-5 w-5) */
.vubli-ai-toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.vubli-ai-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* track: inline-flex h-6 w-11 items-center rounded-full transition-colors bg-gray-300 */
.vubli-ai-toggle-slider {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 2.75rem;   /* w-11 */
    height: 1.5rem;  /* h-6 */
    flex-shrink: 0;
    border-radius: 9999px;
    background-color: #D1D5DB; /* bg-gray-300 */
    transition: background-color 0.2s ease, transform 0.2s ease;
}

/* thumb: ml-0.5 h-5 w-5 rounded-full bg-white shadow transition-transform */
.vubli-ai-toggle-slider:before {
    position: absolute;
    content: "";
    left: 0.125rem;  /* ml-0.5 */
    width: 1.25rem;  /* w-5 */
    height: 1.25rem; /* h-5 */
    border-radius: 9999px;
    background-color: #fff;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    transition: transform 0.2s ease;
}

.vubli-ai-toggle-switch input:checked + .vubli-ai-toggle-slider {
    background-color: rgb(124, 200, 84); /* vubli green */
}

/* translate-x-5 = 1.25rem = 20px */
.vubli-ai-toggle-switch input:checked + .vubli-ai-toggle-slider:before {
    transform: translateX(1.25rem);
}

/* Options Button – match .order-hover summary (color, hover, size) */
.vubli-ai-prompt-options-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 9999px;
    color: #374151;
}

.vubli-ai-prompt-options-btn:hover {
    background-color: #ffffff;
}

.vubli-ai-prompt-options-btn:hover svg,
.vubli-ai-prompt-options-btn:hover svg path {
    color: #7cc854;
    stroke: #7cc854;
}

body button.vubli-ai-prompt-options-btn:focus {
    background-color: transparent;
}

.vubli-ai-prompt-options-btn svg {
    width: 1.75rem;
    height: 1.75rem;
    color: #374151;
}

.vubli-ai-prompt-options-btn svg path {
    stroke: #374151;
}

/* Dropdown Menu */
.vubli-ai-prompt-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid #E0E6EB;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    min-width: 140px;
    padding: 4px;
    display: none;
    z-index: 1000;
}

.vubli-ai-prompt-dropdown-menu.active {
    display: block;
}

.vubli-ai-prompt-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    color: #0F2F4D;
    transition: all 0.2s ease;
}

.vubli-ai-prompt-menu-item:hover {
    background-color: #F9FAFB;
    color: rgb(124, 200, 84);
}

.vubli-ai-prompt-menu-item:hover .vubli-ai-prompt-menu-icon svg path {
    stroke: rgb(124, 200, 84);
}

.vubli-ai-prompt-menu-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vubli-ai-prompt-menu-icon svg {
    width: 100%;
    height: 100%;
}

.vubli-ai-prompt-menu-icon svg path {
    transition: stroke 0.2s ease;
}

/* Context list and drawer (same style as prompts) */
.vubli-ai-context-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #f5f5f5;
    position: relative;
    min-height: 89px;
    box-sizing: border-box;
    cursor: pointer;
}

.vubli-ai-context-item:last-child {
    border-bottom: none;
}

.vubli-ai-context-item:hover {
    background-color: #F9FAFB;
    margin: 0 -16px;
    padding: 16px;
}

/* Selected/checked context row */
.vubli-ai-context-item:has(.vubli-ai-context-toggle:checked) {
    background-color: #F9FAFB;
    margin: 0 -16px;
    padding: 16px;
}

.vubli-ai-context-item:has(.vubli-ai-context-toggle:checked) .vubli-ai-context-item-title {
    color: rgb(124, 200, 84);
}

.vubli-ai-context-item:has(.vubli-ai-context-toggle:checked) .vubli-ai-context-item-icon svg,
.vubli-ai-context-item:has(.vubli-ai-context-toggle:checked) .vubli-ai-context-item-icon svg path {
    stroke: rgb(124, 200, 84);
}

.vubli-ai-context-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.vubli-ai-context-item-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vubli-ai-context-item-icon svg {
    width: 100%;
    height: 100%;
}

.vubli-ai-context-item-info {
    flex: 1;
}

.vubli-ai-context-item-title {
    font-size: 14px;
    font-weight: 600;
    color: rgb(51, 51, 51);
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.vubli-ai-context-item-description {
    font-size: 12px;
    color: #4b5563;
    margin: 0;
    line-height: 1.5;
}

.vubli-ai-context-item-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    position: relative;
}

/* Context list: checkbox with circle-check icon (grey unchecked, green checked) */
.vubli-ai-context-checkbox-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.vubli-ai-context-checkbox-wrap .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.vubli-ai-context-checkbox-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #9ca3af;
    transition: color 0.15s ease;
}

.vubli-ai-context-checkbox-icon svg {
    width: 100%;
    height: 100%;
}

.vubli-ai-context-checkbox-wrap .vubli-ai-context-checkbox-circle {
    fill: none;
    stroke: #d1d5db;
    stroke-width: 1.5;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.vubli-ai-context-checkbox-wrap .vubli-ai-context-checkbox-check {
    stroke: #d1d5db;
    stroke-width: 1.5;
    transition: stroke 0.2s ease;
}

.vubli-ai-context-checkbox-wrap:hover .vubli-ai-context-checkbox-icon .vubli-ai-context-checkbox-circle {
    stroke: #d1d5db;
}

.vubli-ai-context-checkbox-wrap:hover .vubli-ai-context-checkbox-icon .vubli-ai-context-checkbox-check {
    stroke: #d1d5db;
}

.vubli-ai-context-checkbox-wrap input:checked + .vubli-ai-context-checkbox-icon .vubli-ai-context-checkbox-circle {
    fill: rgb(124, 200, 84);
    stroke: rgb(124, 200, 84);
}

.vubli-ai-context-checkbox-wrap input:checked + .vubli-ai-context-checkbox-icon .vubli-ai-context-checkbox-check {
    stroke: white;
}

.vubli-ai-context-checkbox-wrap input:focus-visible + .vubli-ai-context-checkbox-icon {
    outline: 2px solid rgb(124, 200, 84);
    outline-offset: 2px;
    border-radius: 4px;
}

.vubli-ai-context-options-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 9999px;
    color: #374151;
}

.vubli-ai-context-options-btn:hover {
    background-color: #ffffff;
}

.vubli-ai-context-options-btn:hover svg,
.vubli-ai-context-options-btn:hover svg path {
    color: #7cc854;
    stroke: #7cc854;
}

body button.vubli-ai-context-options-btn:focus {
    background-color: transparent;
}

.vubli-ai-context-options-btn svg {
    width: 1.75rem;
    height: 1.75rem;
    color: #374151;
}

.vubli-ai-context-options-btn svg path {
    stroke: #374151;
}

.vubli-ai-context-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid #E0E6EB;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    min-width: 140px;
    padding: 4px;
    display: none;
    z-index: 1000;
}

.vubli-ai-context-dropdown-menu.active {
    display: block;
}

.vubli-ai-context-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    color: #0F2F4D;
    transition: all 0.2s ease;
}

.vubli-ai-context-menu-item:hover {
    background-color: #F9FAFB;
    color: rgb(124, 200, 84);
}

.vubli-ai-context-menu-item:hover .vubli-ai-context-menu-icon svg path {
    stroke: rgb(124, 200, 84);
}

.vubli-ai-context-menu-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vubli-ai-context-menu-icon svg {
    width: 100%;
    height: 100%;
}

.vubli-ai-context-menu-icon svg path {
    transition: stroke 0.2s ease;
}

#vubli-ai-context-drawer.vubli-ai-prompt-drawer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    max-width: none;
    max-height: none;
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

#vubli-ai-context-drawer[open] {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
}

/* Context drawer: panel slide-in and backdrop (same as prompt drawer) */
#vubli-ai-context-drawer.vubli-ai-prompt-drawer--panel-open .vubli-ai-prompt-drawer-backdrop {
    opacity: 1;
}

#vubli-ai-context-drawer.vubli-ai-prompt-drawer--panel-open .vubli-ai-prompt-drawer-panel {
    transform: translateX(0);
}

#vubli-ai-context-drawer.vubli-ai-prompt-drawer--panel-open .vubli-ai-prompt-drawer-close-wrap {
    opacity: 1;
}

#vubli-ai-context-drawer .vubli-ai-context-drawer-body {
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    #vubli-ai-context-drawer .vubli-ai-context-drawer-body {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

body #vubli-ai-context-drawer .vubli-ai-context-drawer-body .vubli-ai-prompt-drawer-prompt-input,
#vubli-ai-context-drawer-textarea {
    box-sizing: border-box;
    height: 56px !important;
    min-height: 56px !important;
    resize: none;
    overflow-y: hidden;
    padding: 1rem;
}

#vubli-ai-context-drawer-textarea:hover {
    background-color: #F9FAFB !important;
}

#vubli-ai-context-drawer .vubli-ai-context-drawer-body .vubli-ai-context-char-limit {
    margin-top: 0.25rem;
}

#vubli-ai-context-drawer .vubli-ai-context-drawer-body #vubli-ai-context-drawer-textarea-limit-error {
    margin-top: 0.25rem;
}

#vubli-ai-context-drawer .vubli-ai-context-drawer-body .vubli-ai-prompt-drawer-prompt-error {
    padding: 0;
}

/* Loading and Sentinel */
.vubli-ai-prompts-sentinel {
    height: 1px;
    width: 100%;
}

.vubli-ai-prompts-loading {
    text-align: center;
    padding: 20px;
    color: #6B7280;
    font-size: 14px;
}

/* Prompt item drawer (plain CSS, same look as Tailwind-style) */
.vubli-ai-settings-wrapper {
    position: relative;
}

#vubli-ai-prompt-drawer.vubli-ai-prompt-drawer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    max-width: none;
    max-height: none;
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    overflow: hidden;
}

#vubli-ai-prompt-drawer[open] {
    display: block;
}

#vubli-ai-prompt-drawer::backdrop {
    background: transparent;
}

.vubli-ai-prompt-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(107, 114, 128, 0.75);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

#vubli-ai-prompt-drawer.vubli-ai-prompt-drawer--panel-open .vubli-ai-prompt-drawer-backdrop {
    opacity: 1;
}

.vubli-ai-prompt-drawer-focus-wrap {
    position: absolute;
    inset: 0;
    padding-left: 2.5rem;
    outline: none;
}

@media (min-width: 640px) {
    .vubli-ai-prompt-drawer-focus-wrap {
        padding-left: 4rem;
    }
}

.vubli-ai-prompt-drawer-panel {
    position: relative;
    margin-left: auto;
    display: block;
    width: 100%;
    max-width: 28rem;
    height: 100%;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    will-change: transform;
}

/* Panel slide-in: driven by class (added next frame after showModal) so transition runs */
#vubli-ai-prompt-drawer.vubli-ai-prompt-drawer--panel-open .vubli-ai-prompt-drawer-panel,
#vubli-ai-settings-drawer.vubli-ai-prompt-drawer--panel-open .vubli-ai-prompt-drawer-panel {
    transform: translateX(0);
    will-change: auto;
}

/* Caption settings drawer (same layout as prompt drawer) */
#vubli-ai-settings-drawer.vubli-ai-prompt-drawer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    max-width: none;
    max-height: none;
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    overflow: hidden;
}

#vubli-ai-settings-drawer[open] {
    display: block;
}

#vubli-ai-settings-drawer.vubli-ai-prompt-drawer--panel-open .vubli-ai-prompt-drawer-backdrop {
    opacity: 1;
}

#vubli-ai-settings-drawer.vubli-ai-prompt-drawer--panel-open .vubli-ai-prompt-drawer-close-wrap {
    opacity: 1;
}

#vubli-ai-settings-drawer .vubli-ai-prompt-drawer-content {
    padding: 0;
}

#vubli-ai-settings-drawer .vubli-ai-settings-drawer-body,
#vubli-ai-settings-drawer .vubli-ai-prompt-drawer-body {
    margin-top: 0;
}

#vubli-ai-settings-drawer .vubli-ai-settings-drawer-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}

#vubli-ai-settings-drawer .vubli-ai-settings-drawer-iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
}

.vubli-ai-prompt-drawer-close-wrap {
    position: absolute;
    left: 0;
    top: 0;
    margin-left: -2rem;
    padding-right: 0.5rem;
    padding-top: 1rem;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

#vubli-ai-prompt-drawer.vubli-ai-prompt-drawer--panel-open .vubli-ai-prompt-drawer-close-wrap {
    opacity: 1;
}

@media (min-width: 640px) {
    .vubli-ai-prompt-drawer-close-wrap {
        margin-left: -2.5rem;
        padding-right: 1rem;
    }
}

/* Match closeSlider: rounded-md w-7 h-7 text-gray-300 hover:bg-transparent hover-white */
.vubli-ai-prompt-drawer-close {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    min-width: 1.75rem;
    min-height: 1.75rem;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #d1d5db;
    border-radius: 0.375rem;
    outline: none;
}

.vubli-ai-prompt-drawer-close:hover {
    background: transparent;
    color: #fff;
}

.vubli-ai-prompt-drawer-close:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.vubli-ai-prompt-drawer-close-hitarea {
    position: absolute;
    inset: -0.625rem;
}

/* size-6 = 24px, matches reference SVG */
.vubli-ai-prompt-drawer-close-icon {
    width: 1.75rem;
    height: 1.75rem;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.vubli-ai-prompt-drawer-content {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: #fff;
    padding: 1.5rem 0 0 0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Add bottom padding only when autosave bar is visible (editing non-default prompt) */
.vubli-ai-prompt-drawer-content.has-autosave-bar {
    padding-bottom: 0px;
}

.vubli-ai-prompt-drawer-content::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 1px;
    background: rgba(0, 0, 0, 0.06);
}

.vubli-ai-prompt-drawer-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
}

/* Back chevron: only visible when drawer is shown inside iframe (iframe mode); height matches title input */
.vubli-ai-prompt-drawer-back-chevron {
    display: none;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    padding: 0.282rem 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #374151;
    border-radius: 0.375rem;
    transition: color 0.15s ease, background-color 0.15s ease;
    box-sizing: border-box;
}

.vubli-ai-prompt-drawer-back-chevron:hover {
    color: #111827;
    background-color: #F3F4F6;
}

.vubli-ai-prompt-drawer-back-chevron svg {
    width: 1.75rem;
    height: 1.75rem;
}

html.vubli-embedded-in-iframe .vubli-ai-prompt-drawer-back-chevron {
    display: inline-flex;
}

@media (min-width: 640px) {
    .vubli-ai-prompt-drawer-header {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

body .vubli-ai-prompt-drawer-title-input {
    flex: 1;
    min-width: 0;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1.5;
    padding: 0.5rem 1rem;
    border: none !important;
    border-radius: 0.5rem;
    background-color: transparent !important;
    outline: none;
    transition: background-color 0.15s ease;
}

.vubli-ai-prompt-drawer-title-input:hover,
.vubli-ai-prompt-drawer-title-input:focus {
    background-color: #F9FAFB !important;
}

.vubli-ai-prompt-drawer-title-input[readonly],
.vubli-ai-prompt-drawer-prompt-input[readonly] {
    cursor: default;
}

.vubli-ai-prompt-drawer-title-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Error messages: hidden by default via class (no inline display:none so JS can show them) */
.vubli-ai-drawer-error-hidden {
    display: none !important;
}

.vubli-ai-prompt-drawer-title-error {
    font-size: 0.8125rem;
    color: #ef476f;
    margin: 0;
    padding: 0;
}

.vubli-ai-prompt-drawer-title-error[aria-hidden="false"],
.vubli-ai-prompt-drawer-title-error.vubli-ai-drawer-error-visible {
    display: block !important;
    visibility: visible !important;
}


.vubli-ai-prompt-drawer-prompt-error,
.vubli-ai-prompt-drawer-accordion-textarea-error {
    font-size: 0.8125rem;
    color: #ef476f;
    margin: 0.25rem 0 0 0;
    padding: 0;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.vubli-ai-prompt-drawer-prompt-error[aria-hidden="false"],
.vubli-ai-prompt-drawer-prompt-error.vubli-ai-drawer-error-visible,
.vubli-ai-prompt-drawer-accordion-textarea-error[aria-hidden="false"],
.vubli-ai-prompt-drawer-accordion-textarea-error.vubli-ai-drawer-error-visible {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 1.25em;
}


.vubli-ai-prompt-drawer-create-actions {
    flex-shrink: 0;
    border-top: 1px solid #e5e7eb;
    background-color: #fff;
    padding: 1rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
}

/* Autosave indicator: only visible when editing a non-create (existing) prompt, not when in create flow */
.vubli-ai-prompt-drawer-autosave-bar {
    flex-shrink: 0;
    border-top: 1px solid #e5e7eb;
    background-color: #fff;
    padding: 1.65rem 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.vubli-ai-prompt-drawer-autosave-bar .autosave-container {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: #9ca3af;
    transition: color 0.2s ease;
}

.vubli-ai-prompt-drawer-autosave-bar .autosave-container.autosave-just-saved {
    color: #84cc67;
}

.vubli-ai-prompt-drawer-create-btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background-color: #84cc67;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.vubli-ai-prompt-drawer-create-btn:hover {
    background-color: #6bb34d;
}

.vubli-ai-prompt-drawer-create-btn:focus {
    outline: 2px solid #84cc67;
    outline-offset: 2px;
}

.vubli-ai-prompt-drawer-body {
    position: relative;
    margin-top: 1.5rem;
    flex: 1;
    /* padding: 0 1rem; */
    min-height: 0;
    overflow-y: auto;
}

html.vubli-embedded-in-iframe .vubli-ai-prompt-drawer-accordion-toggle-wrap{
    padding-right: 5px;
}

/* When chevron is visible (iframe mode), align body with title (title starts at header + chevron + gap + input padding) */
/* html.vubli-embedded-in-iframe .vubli-ai-prompt-drawer-body {
    padding-left: 3.5rem;
} */

@media (min-width: 640px) {
    /* .vubli-ai-prompt-drawer-body {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    } */
    html.vubli-embedded-in-iframe .vubli-ai-prompt-drawer-body {
        padding-left: 4.5rem;
    }
}

/* Single prompt type: instructions (gray) + editable textarea (black) */
.vubli-ai-prompt-drawer-single {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
}

.vubli-ai-prompt-drawer-single .vubli-ai-prompt-drawer-instruction {
    padding-left: 1rem;
    padding-right: 1rem;
}

.vubli-ai-prompt-drawer-multiple .vubli-ai-prompt-drawer-sep {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* .vubli-ai-prompt-drawer-multiple .vubli-ai-prompt-drawer-accordion-inner .vubli-ai-prompt-drawer-instruction{
    padding-left: 1rem;
    padding-right: 1rem;
} */

.vubli-ai-prompt-drawer-single .vubli-ai-prompt-drawer-sep {
    padding-left: 1rem;
    padding-right: 1rem;
}

.vubli-ai-prompt-drawer-multiple .vubli-ai-prompt-drawer-accordion-inner{
    padding: 1rem 1.5rem 1.25rem;
}

.vubli-ai-prompt-drawer-single .vubli-ai-prompt-drawer-prompt-input {
    padding: 1rem;
    overflow: hidden;
    resize: none;
    field-sizing: content;
}

.vubli-ai-prompt-drawer-single .vubli-ai-prompt-drawer-char-limit-warning {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.vubli-ai-prompt-drawer-single .vubli-ai-prompt-drawer-prompt-error {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

body textarea.vubli-ai-prompt-drawer-prompt-input:focus{
    border: 0px;
}

.vubli-ai-prompt-drawer-instruction {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #9ca3af;
    user-select: none;
    pointer-events: none;
}

.vubli-ai-prompt-drawer-instruction--top,
.vubli-ai-prompt-drawer-instruction--bottom {
    color: #9ca3af;
}

.vubli-ai-prompt-drawer-sep {
    margin: 0;
    font-size: 0.9375rem;
    color: #9ca3af;
    user-select: none;
    pointer-events: none;
}

.vubli-ai-prompt-drawer-prompt-input {
    width: 100%;
    min-height: 10rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #111827;
    border-radius: 0.375rem;
    outline: none;
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    background-color: transparent !important;
}

.vubli-ai-prompt-drawer-prompt-input:hover {
    background-color: #F9FAFB !important;
}


.vubli-ai-prompt-drawer-prompt-input::placeholder {
    color: #6b7280;
}

/* Expand all / Collapse all toggle above accordion */
.vubli-ai-prompt-drawer-accordion-toggle-wrap {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
    padding-right: 14px;
}

.vubli-ai-prompt-drawer-accordion-expand-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    color: #84cc67;
    text-decoration: none;
    border-radius: 0.375rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.vubli-ai-prompt-drawer-accordion-expand-toggle:hover {
    background-color: #f9fafb;
    color: #6bb34d;
}

.vubli-ai-prompt-drawer-accordion-expand-toggle .vubli-ai-prompt-drawer-accordion-expand-label {
    color: #374151;
}

.vubli-ai-prompt-drawer-accordion-expand-toggle:hover .vubli-ai-prompt-drawer-accordion-expand-label {
    color: #84cc67;
}

.vubli-ai-prompt-drawer-accordion-expand-toggle .vubli-ai-prompt-drawer-accordion-expand-icon-down,
.vubli-ai-prompt-drawer-accordion-expand-toggle .vubli-ai-prompt-drawer-accordion-expand-icon-up {
    flex-shrink: 0;
    color: #9ca3af;
}

.vubli-ai-prompt-drawer-accordion-expand-toggle .hidden {
    display: none !important;
}

.vubli-ai-prompt-drawer-accordion {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.vubli-ai-prompt-drawer-accordion-item {
    overflow: hidden;
    background: #fff;
}

.vubli-ai-prompt-drawer-accordion-item + .vubli-ai-prompt-drawer-accordion-item {
    border-top: 1px solid #f5f5f5;
}

.vubli-ai-prompt-drawer-content .vubli-ai-prompt-drawer-body{
    margin-top: 0.75rem;
}

.vubli-ai-prompt-drawer-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 1.5rem 1rem;
    margin: 0;
    border: none;
    background-color: #fff;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    text-align: left;
    cursor: pointer;
    outline: none;
    transition: background-color 0.15s ease;
    list-style: none;
}

@media (min-width: 640px) {
    .vubli-ai-prompt-drawer-accordion-header {
        padding-left: 2.5rem;
        padding-right: 1.5rem;
    }
}

.vubli-ai-prompt-drawer-accordion-header:focus {
    background-color: #fff;
    color: #111827;
}

.vubli-ai-prompt-drawer-accordion-header:hover {
    background-color: #f9fafb;
    color: #111827;
}

.vubli-ai-prompt-drawer-accordion-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
}

.vubli-ai-prompt-drawer-accordion-icon .splashecons-container,
.vubli-ai-prompt-drawer-accordion-icon-svg {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.vubli-ai-prompt-drawer-accordion-icon .splashecons-container svg,
.vubli-ai-prompt-drawer-accordion-icon-svg svg {
    width: 2rem;
    height: 2rem;
}

/* Fallback when getWidgetSplashCons not available */
.vubli-ai-prompt-drawer-accordion-icon-fallback {
    width: 2rem;
    height: 2rem;
    border-radius: 0.25rem;
}

.vubli-ai-prompt-drawer-accordion-icon--youtube.vubli-ai-prompt-drawer-accordion-icon-fallback { background: #ff0000; }
.vubli-ai-prompt-drawer-accordion-icon--instagram.vubli-ai-prompt-drawer-accordion-icon-fallback { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.vubli-ai-prompt-drawer-accordion-icon--facebook_reels.vubli-ai-prompt-drawer-accordion-icon-fallback { background: #0866ff; }
.vubli-ai-prompt-drawer-accordion-icon--tiktok.vubli-ai-prompt-drawer-accordion-icon-fallback { background: #000000; }
.vubli-ai-prompt-drawer-accordion-icon--linkedin.vubli-ai-prompt-drawer-accordion-icon-fallback { background: #0a66c2; }
.vubli-ai-prompt-drawer-accordion-icon--x.vubli-ai-prompt-drawer-accordion-icon-fallback { background: #000000; }

.vubli-ai-prompt-drawer-accordion-label {
    flex: 1;
    font-size: 0.9375rem;
}

.vubli-ai-prompt-drawer-accordion-chevron {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    color: #9ca3af;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.vubli-ai-prompt-drawer-accordion-chevron svg {
    width: 100%;
    height: 100%;
}

/* Chevron up when closed, down when open */
.vubli-ai-prompt-drawer-accordion-header[aria-expanded="false"] .vubli-ai-prompt-drawer-accordion-chevron {
    transform: rotate(180deg);
}

.vubli-ai-prompt-drawer-accordion-header[aria-expanded="true"] .vubli-ai-prompt-drawer-accordion-chevron {
    transform: rotate(0deg);
}

.vubli-ai-prompt-drawer-accordion-content {
    display: none;
}

.vubli-ai-prompt-drawer-accordion-content.is-open {
    display: block;
}

/* Ensure accordion error message is visible when shown (override any parent/accordion rules) */
.vubli-ai-prompt-drawer-accordion-inner .vubli-ai-prompt-drawer-accordion-textarea-error.vubli-ai-drawer-error-visible,
.vubli-ai-prompt-drawer-accordion-inner .vubli-ai-prompt-drawer-accordion-textarea-error[aria-hidden="false"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 1.25em;
}

.vubli-ai-prompt-drawer-accordion-inner {
    padding: 1rem 1rem 1.25rem;
    /* background-color: #f9fafb; */
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .vubli-ai-prompt-drawer-accordion-inner {
        padding: 1.25rem 0rem 1.25rem;
    }
}

.vubli-ai-prompt-drawer-accordion-inner .vubli-ai-prompt-drawer-prompt-input {
    min-height: 6rem;
    overflow: hidden;
    resize: none;
    field-sizing: content;
    padding: 1rem;
}

.vubli-ai-prompt-drawer-accordion-inner .vubli-ai-prompt-drawer-instruction {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* .vubli-ai-prompt-drawer-accordion-inner .vubli-ai-prompt-drawer-sep {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
} */

.vubli-ai-prompt-drawer-accordion-inner .vubli-ai-prompt-drawer-char-limit-warning {
    padding-left: 1rem;
    padding-right: 1rem;
}

.vubli-ai-prompt-drawer-char-limit-warning {
    margin: 0;
    font-size: 0.8125rem;
    color: #6b7280;
    text-align: right;
}

.vubli-ai-prompt-drawer-char-limit-warning.is-at-limit {
    color: #dc2626;
}

/* Edit Caption settings link shortcode (hidden by default, shown after 100ms via JS) */
.vubli-ai-edit-settings-link.hidden {
    display: none !important;
}
.vubli-ai-edit-settings-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #63B336;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}
.vubli-ai-edit-settings-link:hover {
    color: #52a02b;
}
.vubli-ai-edit-settings-link .vubli-ai-edit-settings-icon {
    flex-shrink: 0;
    color: #63B336;
}
.vubli-ai-edit-settings-link:hover .vubli-ai-edit-settings-icon {
    color: #52a02b;
}
