/**
 * Agent Builder Styles
 * Theme-aware slide-out panel with tabbed interface
 */

/* ===== THEME VARIABLES ===== */
:root {
    /* Dark Mode (Default) */
    --ab-bg: #000000;
    --ab-bg-secondary: rgba(255, 255, 255, 0.02);
    --ab-bg-tertiary: rgba(255, 255, 255, 0.04);
    --ab-bg-hover: rgba(255, 255, 255, 0.06);
    --ab-border: rgba(255, 255, 255, 0.08);
    --ab-border-hover: rgba(255, 255, 255, 0.15);
    --ab-text-primary: #ffffff;
    --ab-text-secondary: rgba(255, 255, 255, 0.7);
    --ab-text-muted: rgba(255, 255, 255, 0.4);
    --ab-text-hint: rgba(255, 255, 255, 0.25);
    --ab-input-bg: rgba(255, 255, 255, 0.04);
    --ab-input-border: rgba(255, 255, 255, 0.1);
    --ab-accent: #8b5cf6;
    --ab-accent-hover: #7c3aed;
    --ab-accent-bg: rgba(139, 92, 246, 0.15);
    --ab-shadow: rgba(0, 0, 0, 0.5);
    --ab-overlay: rgba(0, 0, 0, 0.7);
}

/* Light Mode Overrides */
:root[data-theme="light"],
.light-mode {
    --ab-bg: #ffffff;
    --ab-bg-secondary: #f9fafb;
    --ab-bg-tertiary: #f3f4f6;
    --ab-bg-hover: #e5e7eb;
    --ab-border: #e5e7eb;
    --ab-border-hover: #d1d5db;
    --ab-text-primary: #111827;
    --ab-text-secondary: #374151;
    --ab-text-muted: #6b7280;
    --ab-text-hint: #9ca3af;
    --ab-input-bg: #ffffff;
    --ab-input-border: #d1d5db;
    --ab-accent: #7c3aed;
    --ab-accent-hover: #6d28d9;
    --ab-accent-bg: rgba(124, 58, 237, 0.1);
    --ab-shadow: rgba(0, 0, 0, 0.15);
    --ab-overlay: rgba(0, 0, 0, 0.4);
}

/* ===== OVERLAY ===== */
.agent-builder-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.agent-builder-overlay.open {
    opacity: 1;
    pointer-events: none; /* Allow clicking through to preview */
}

/* ===== PANEL ===== */
.agent-builder-panel {
    position: fixed;
    top: 0;
    right: -480px;
    width: 440px;
    min-width: 450px;
    max-width: 580px; /* Only allow ~30% stretch from default 440px */
    height: 100vh;
    background: var(--ab-bg);
    border-left: 1px solid var(--ab-border);
    z-index: 1001;
    transition: right 0.3s ease, width 0.15s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px var(--ab-shadow);
}

.agent-builder-panel.open {
    right: 0;
}

/* Disable transitions while resizing for smooth performance */
.agent-builder-panel.resizing {
    transition: none !important;
    box-shadow: -4px 0 16px var(--ab-shadow) !important;
}

/* ===== RESIZE HANDLE ===== */
.ab-resize-handle {
    position: absolute;
    top: 60px;
    bottom: 60px;
    left: 0;
    width: 20px;
    cursor: ew-resize;
    z-index: 100;
    transform: translateX(-50%);
    background: transparent;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Visual indicator line */
.ab-resize-handle::before {
    content: '';
    width: 4px;
    height: 40px;
    background: var(--ab-border);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.ab-resize-handle:hover::before,
.agent-builder-panel.resizing .ab-resize-handle::before {
    opacity: 1;
    background: var(--ab-accent);
}

/* Cursor hint on body while resizing */
body.ab-resizing {
    cursor: ew-resize !important;
    user-select: none !important;
}

body.ab-resizing * {
    cursor: ew-resize !important;
}

/* ===== HEADER ===== */
.ab-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--ab-border);
    flex-shrink: 0;
    background: var(--ab-bg);
}

.ab-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ab-text-primary);
}

.ab-title-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.ab-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--ab-bg-tertiary);
    border: 1px solid var(--ab-border);
    color: var(--ab-text-muted);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ab-close:hover {
    background: var(--ab-bg-hover);
    color: var(--ab-text-primary);
    border-color: var(--ab-border-hover);
}

/* ===== TABS BAR ===== */
.ab-tabs {
    display: flex;
    padding: 0 16px;
    border-bottom: 1px solid var(--ab-border);
    flex-shrink: 0;
    background: var(--ab-bg);
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.ab-tabs::-webkit-scrollbar {
    display: none;
}

.ab-tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    background: none;
    border: none;
    color: var(--ab-text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
    position: relative;
    white-space: nowrap;
}

.ab-tab-btn:hover {
    color: var(--ab-text-secondary);
}

.ab-tab-btn.active {
    color: var(--ab-accent);
    border-bottom-color: var(--ab-accent);
}

.ab-tab-btn i {
    font-size: 15px;
    opacity: 0.7;
}

.ab-tab-btn.active i {
    opacity: 1;
}

/* ===== TAB CONTENT ===== */
.ab-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--ab-bg);
}

.ab-content::-webkit-scrollbar {
    width: 4px;
}

.ab-content::-webkit-scrollbar-track {
    background: transparent;
}

.ab-content::-webkit-scrollbar-thumb {
    background: var(--ab-border);
    border-radius: 2px;
}

.ab-tab-pane {
    display: none;
}

.ab-tab-pane.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== FORM ELEMENTS ===== */
.ab-form-group {
    margin-bottom: 20px;
}

.ab-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ab-text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ab-label i {
    font-size: 14px;
    color: #818cf8;
}

.ab-hint {
    font-size: 11px;
    font-weight: 400;
    color: var(--ab-text-hint);
    text-transform: none;
    letter-spacing: 0;
}

.ab-input,
.ab-textarea,
.ab-select {
    width: 100%;
    padding: 12px 14px;
    background: var(--ab-input-bg);
    border: 1px solid var(--ab-input-border);
    border-radius: 10px;
    color: var(--ab-text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
    outline: none;
}

.ab-select option {
    color: #000; /* dropdown items will be black */
    background: #fff; /* dropdown background */
}

.ab-input:focus,
.ab-textarea:focus,
.ab-select:focus {
    border-color: var(--ab-accent);
    box-shadow: 0 0 0 3px var(--ab-accent-bg);
}

.ab-input::placeholder,
.ab-textarea::placeholder {
    color: var(--ab-text-hint);
}

.ab-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.ab-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Section divider */
.ab-divider {
    height: 1px;
    background: var(--ab-border);
    margin: 24px 0;
}

.ab-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ab-text-muted);
    margin-bottom: 14px;
}

/* ===== AVATAR GALLERY ===== */
.ab-avatar-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: var(--ab-bg-tertiary);
    border-radius: 10px;
    padding: 3px;
    border: 1px solid var(--ab-border);
}

.ab-avatar-tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--ab-text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.ab-avatar-tab:hover {
    color: var(--ab-text-secondary);
}

.ab-avatar-tab.active {
    background: #ffffff;
    color: #000000;
}

/* Light mode: active tab is black */
:root[data-theme="light"] .ab-avatar-tab.active,
.light-mode .ab-avatar-tab.active {
    background: #000000;
    color: #ffffff;
}

.ab-avatar-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.ab-avatar-item {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    position: relative;
}

.ab-avatar-item:hover {
    transform: scale(1.05);
}

.ab-avatar-item.selected {
    border-color: var(--ab-accent);
    box-shadow: 0 0 12px var(--ab-accent-bg);
}

.ab-avatar-item i {
    font-size: 20px;
    color: #fff;
}

.ab-avatar-item .ab-check {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: var(--ab-accent);
    border-radius: 50%;
    font-size: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}

.ab-avatar-item.selected .ab-check {
    display: flex;
}

/* Avatar upload area */
.ab-avatar-upload {
    display: none;
}

.ab-avatar-upload.active {
    display: block;
}

.ab-upload-zone {
    border: 2px dashed var(--ab-border);
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--ab-bg-secondary);
}

.ab-upload-zone:hover {
    border-color: var(--ab-accent);
    background: var(--ab-accent-bg);
}

.ab-upload-zone i {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--ab-text-muted);
    display: block;
}

.ab-upload-text {
    font-size: 13px;
    color: var(--ab-text-secondary);
}

.ab-upload-hint {
    font-size: 11px;
    color: var(--ab-text-hint);
    margin-top: 4px;
}

/* ===== LAYOUT CARDS ===== */
.ab-layout-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.ab-layout-card {
    padding: 16px 10px;
    border: 1px solid var(--ab-border);
    border-radius: 12px;
    background: var(--ab-bg-secondary);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.ab-layout-card:hover {
    border-color: var(--ab-border-hover);
    background: var(--ab-bg-tertiary);
}

.ab-layout-card.selected {
    border-color: #ffffff;
    background: #ffffff;
}

.ab-layout-card.selected .ab-layout-icon,
.ab-layout-card.selected .ab-layout-label {
    color: #000000;
}

/* Light mode: selected layout card is black */
:root[data-theme="light"] .ab-layout-card.selected,
.light-mode .ab-layout-card.selected {
    border-color: #000000;
    background: #000000;
}

:root[data-theme="light"] .ab-layout-card.selected .ab-layout-icon,
:root[data-theme="light"] .ab-layout-card.selected .ab-layout-label,
.light-mode .ab-layout-card.selected .ab-layout-icon,
.light-mode .ab-layout-card.selected .ab-layout-label {
    color: #ffffff;
}

.ab-layout-card input {
    display: none;
}

.ab-layout-icon {
    font-size: 26px;
    margin-bottom: 8px;
    color: var(--ab-text-muted);
    display: block;
}

.ab-layout-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--ab-text-muted);
}

/* ===== TEMPERATURE SLIDER ===== */
.ab-temp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ab-temp-value {
    font-size: 13px;
    color: var(--ab-accent);
    font-weight: 600;
    background: var(--ab-accent-bg);
    padding: 2px 10px;
    border-radius: 6px;
}

.ab-temp-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, rgba(59, 130, 246, 0.5), rgba(139, 92, 246, 0.5), rgba(239, 68, 68, 0.5));
    outline: none;
}

.ab-temp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ab-bg);
    cursor: pointer;
    border: 3px solid var(--ab-accent);
    box-shadow: 0 2px 8px var(--ab-shadow);
}

.ab-temp-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ab-bg);
    cursor: pointer;
    border: 3px solid var(--ab-accent);
    box-shadow: 0 2px 8px var(--ab-shadow);
}

.ab-temp-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 10px;
    color: var(--ab-text-hint);
}

/* ===== CONVERSATION STARTERS ===== */
.ab-starters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ab-starter-input {
    padding: 10px 12px;
    background: var(--ab-input-bg);
    border: 1px solid var(--ab-input-border);
    border-radius: 8px;
    color: var(--ab-text-primary);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.ab-starter-input:focus {
    border-color: var(--ab-accent);
}

.ab-starter-input::placeholder {
    color: var(--ab-text-hint);
}

/* ===== TOOL TOGGLES ===== */
.ab-tool-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--ab-bg-secondary);
    border: 1px solid var(--ab-border);
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.ab-tool-item:hover {
    background: var(--ab-bg-tertiary);
    border-color: var(--ab-border-hover);
}

.ab-tool-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ab-tool-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.ab-tool-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--ab-text-primary);
}

.ab-tool-desc {
    font-size: 11px;
    color: var(--ab-text-muted);
    margin-top: 2px;
}

/* Toggle switch */
.ab-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.ab-toggle input {
    display: none;
}

.ab-toggle-track {
    position: absolute;
    inset: 0;
    background: var(--ab-border);
    border-radius: 12px;
    transition: 0.3s;
}

.ab-toggle-track::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: var(--ab-text-muted);
    border-radius: 50%;
    transition: 0.3s;
}

.ab-toggle input:checked + .ab-toggle-track {
    background: var(--ab-accent);
}

.ab-toggle input:checked + .ab-toggle-track::before {
    transform: translateX(20px);
    background: #fff;
}

/* Coming soon badge */
.ab-coming-soon {
    font-size: 10px;
    padding: 3px 8px;
    background: var(--ab-bg-tertiary);
    color: var(--ab-text-hint);
    border-radius: 10px;
    font-weight: 500;
}

/* ===== RESPONSE RULES ===== */
.ab-rule-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--ab-border);
}

.ab-rule-item:last-child {
    border-bottom: none;
}

.ab-rule-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1px solid var(--ab-input-border);
    background: var(--ab-input-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.ab-rule-checkbox.checked {
    background: var(--ab-accent);
    border-color: var(--ab-accent);
}

.ab-rule-checkbox i {
    font-size: 11px;
    color: #fff;
    display: none;
}

.ab-rule-checkbox.checked i {
    display: block;
}

.ab-rule-label {
    font-size: 13px;
    color: var(--ab-text-secondary);
    cursor: pointer;
}

/* ===== SYSTEM PROMPT PREVIEW ===== */
.ab-prompt-preview {
    background: var(--ab-bg-secondary);
    border: 1px solid var(--ab-border);
    border-radius: 10px;
    padding: 14px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--ab-text-muted);
    font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
    max-height: 160px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ===== KNOWLEDGE FILES ===== */
.ab-files-list {
    margin-top: 12px;
}

.ab-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--ab-bg-secondary);
    border: 1px solid var(--ab-border);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.ab-file-item:hover {
    background: var(--ab-bg-tertiary);
    border-color: var(--ab-border-hover);
}

.ab-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.ab-file-icon {
    width: 36px;
    height: 36px;
    background: var(--ab-accent-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ab-accent);
    font-size: 18px;
    flex-shrink: 0;
}

.ab-file-details {
    flex: 1;
    min-width: 0;
}

.ab-file-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--ab-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ab-file-meta {
    font-size: 11px;
    color: var(--ab-text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ab-file-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.ab-file-status i {
    font-size: 11px;
}

.ab-file-actions {
    display: flex;
    gap: 6px;
}

.ab-file-delete,
.ab-file-retry,
.ab-file-remove {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: var(--ab-bg-tertiary);
    color: var(--ab-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ab-file-delete:hover,
.ab-file-remove:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.ab-file-retry:hover {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

/* ===== DESIGN TAB ===== */

/* Theme Grid */
.ab-theme-grid,
.ab-theme-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.ab-theme-card,
.ab-theme-card-new {
    border-radius: 12px;
    border: 1px solid var(--ab-border);
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    position: relative;
    background: var(--ab-bg-secondary);
}

.ab-theme-card:hover,
.ab-theme-card-new:hover {
    border-color: var(--ab-border-hover);
}

.ab-theme-card.selected,
.ab-theme-card-new.selected {
    border-color: var(--ab-accent);
    box-shadow: 0 0 16px var(--ab-accent-bg);
}

.ab-theme-card input,
.ab-theme-card-new input {
    display: none;
}

.ab-theme-preview-mini {
    width: 100%;
    height: 60px;
    position: relative;
    overflow: hidden;
}

.ab-theme-mini-header {
    height: 14px;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 0 8px;
}

.ab-theme-mini-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
}

.ab-theme-mini-msgs {
    padding: 4px 8px;
}

.ab-theme-mini-msg {
    height: 6px;
    border-radius: 3px;
    margin-bottom: 4px;
}

.ab-theme-mini-msg-user {
    width: 55%;
    margin-left: auto;
}

.ab-theme-mini-msg-agent {
    width: 70%;
}

.ab-theme-name,
.ab-theme-name-new {
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    background: var(--ab-bg-tertiary);
    color: var(--ab-text-secondary);
}

.ab-theme-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: var(--ab-accent);
    border-radius: 50%;
    font-size: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}

.ab-theme-card.selected .ab-theme-check,
.ab-theme-card-new.selected .ab-theme-check {
    display: flex;
}

/* Color Swatches */
.ab-color-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ab-color-swatch,
.ab-color-option {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.ab-color-swatch:hover,
.ab-color-option:hover {
    transform: scale(1.1);
}

.ab-color-swatch.selected,
.ab-color-option.selected {
    border-color: var(--ab-text-primary);
    box-shadow: 0 0 12px currentColor;
    transform: scale(1.1);
}

.ab-color-swatch.selected::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Custom color input */
.ab-custom-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.ab-custom-color-input {
    flex: 1;
    font-family: 'SF Mono', 'Fira Code', monospace !important;
}

.ab-custom-color-preview {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--ab-border);
    flex-shrink: 0;
}

/* Font Grid */
.ab-font-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.ab-font-card {
    padding: 14px 12px;
    border: 1px solid var(--ab-border);
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    background: var(--ab-bg-secondary);
}

.ab-font-card:hover {
    border-color: var(--ab-border-hover);
}

.ab-font-card.selected {
    border-color: var(--ab-accent);
    background: var(--ab-accent-bg);
}

.ab-font-sample {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--ab-text-primary);
}

.ab-font-name {
    font-size: 10px;
    color: var(--ab-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Bubble Style Grid */
.ab-bubble-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.ab-bubble-card {
    padding: 14px 10px;
    border: 1px solid var(--ab-border);
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    background: var(--ab-bg-secondary);
}

.ab-bubble-card:hover {
    border-color: var(--ab-border-hover);
}

.ab-bubble-card.selected {
    border-color: var(--ab-accent);
    background: var(--ab-accent-bg);
}

.ab-bubble-demo {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.ab-bubble-demo-msg {
    width: 60%;
    height: 8px;
}

.ab-bubble-demo-user {
    background: var(--ab-accent);
    align-self: flex-end;
    margin-right: 8px;
}

.ab-bubble-demo-agent {
    background: var(--ab-border);
    align-self: flex-start;
    margin-left: 8px;
}

.ab-bubble-label {
    font-size: 11px;
    color: var(--ab-text-muted);
    font-weight: 500;
}

/* Position Grid */
.ab-position-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.ab-position-card {
    padding: 14px;
    border: 1px solid var(--ab-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--ab-bg-secondary);
    position: relative;
    height: 60px;
}

.ab-position-card:hover {
    border-color: var(--ab-border-hover);
}

.ab-position-card.selected {
    border-color: var(--ab-accent);
    background: var(--ab-accent-bg);
}

.ab-position-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ab-accent);
    position: absolute;
}

.ab-position-label {
    font-size: 10px;
    color: var(--ab-text-muted);
    position: absolute;
    top: 10px;
    left: 10px;
}

/* Size Inputs */
.ab-size-row {
    display: flex;
    gap: 12px;
}

.ab-size-field {
    flex: 1;
}

.ab-size-label {
    font-size: 11px;
    color: var(--ab-text-muted);
    margin-bottom: 6px;
}

.ab-size-input {
    text-align: center;
    font-family: 'SF Mono', 'Fira Code', monospace !important;
}

/* Section hint */
.ab-section-hint {
    font-size: 10px;
    color: var(--ab-text-hint);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

/* Branding Toggles */
.ab-branding-toggles {
    display: flex;
    flex-direction: column;
}

.ab-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--ab-border);
}

.ab-toggle-row:last-child {
    border-bottom: none;
}

.ab-toggle-info {
    flex: 1;
}

.ab-toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ab-text-primary);
}

.ab-toggle-desc {
    font-size: 11px;
    color: var(--ab-text-muted);
    margin-top: 2px;
}

/* MCP Placeholder */
.ab-placeholder {
    padding: 20px;
    background: var(--ab-bg-secondary);
    border: 1px dashed var(--ab-border);
    border-radius: 12px;
    text-align: center;
}

.ab-placeholder-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--ab-text-secondary);
    margin-bottom: 4px;
}

.ab-placeholder-desc {
    font-size: 12px;
    color: var(--ab-text-hint);
}

/* Integrations grid */
.ab-integrations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 16px;
}

.ab-integration-item {
    padding: 14px 8px;
    background: var(--ab-bg-secondary);
    border: 1px solid var(--ab-border);
    border-radius: 10px;
    text-align: center;
    opacity: 0.5;
    position: relative;
}

.ab-integration-item i {
    font-size: 22px;
    margin-bottom: 6px;
    display: block;
    color: var(--ab-text-muted);
}

.ab-integration-item span {
    font-size: 11px;
    color: var(--ab-text-muted);
}

/* ===== FOOTER ===== */
.ab-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--ab-border);
    flex-shrink: 0;
    background: var(--ab-bg);
    display: flex;
    gap: 12px;
    align-items: center;
}

.ab-create-btn {
    flex: 1;
    padding: 14px;
    background: #ffffff;
    border: none;
    border-radius: 12px;
    color: #000000;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.ab-create-btn:hover:not(:disabled) {
    background: #f0f0f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}

.ab-create-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Light mode: black button */
:root[data-theme="light"] .ab-create-btn,
.light-mode .ab-create-btn {
    background: #000000;
    color: #ffffff;
}

:root[data-theme="light"] .ab-create-btn:hover:not(:disabled),
.light-mode .ab-create-btn:hover:not(:disabled) {
    background: #1a1a1a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.ab-delete-btn {
    padding: 14px 18px;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 12px;
    color: #ef4444;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.ab-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.6);
}

.ab-delete-btn i {
    margin-right: 6px;
}

.ab-duplicate-btn {
    padding: 14px 18px;
    background: transparent;
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 12px;
    color: #818cf8;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.ab-duplicate-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.6);
}

.ab-duplicate-btn i {
    margin-right: 6px;
}

/* ===== CUSTOM AGENT CARDS IN SIDEBAR ===== */
#myAgentsSection {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--sidebar-border, rgba(255,255,255,0.1));
}

.my-agents-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #a1a1aa);
    padding: 0 8px 12px;
}

#myAgentsGrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0 8px;
}

.custom-agent-card {
    position: relative;
}

.custom-agent-avatar {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 4px;
}

.custom-agent-avatar .gallery-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.custom-agent-avatar .gallery-avatar i {
    font-size: 22px;
    color: white;
}

.custom-agent-avatar .custom-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.custom-agent-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.custom-agent-card:hover .custom-agent-actions {
    opacity: 1;
}

.custom-agent-edit,
.custom-agent-delete {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ab-bg);
    border: 1px solid var(--ab-border);
    border-radius: 6px;
    color: var(--ab-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.custom-agent-edit:hover {
    background: var(--ab-accent-bg);
    border-color: var(--ab-accent);
    color: var(--ab-accent);
}

.custom-agent-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

/* ===== BUILD AGENT BUTTON ===== */
#buildAgentBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 16px 8px 8px;
    padding: 12px 16px;
    background: transparent;
    border: 1px dashed var(--ab-border);
    border-radius: 10px;
    color: var(--ab-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

#buildAgentBtn:hover {
    background: var(--ab-accent-bg);
    border-color: var(--ab-accent);
    color: var(--ab-accent);
}

.build-agent-icon {
    font-size: 1.125rem;
    font-weight: 600;
}

/* ===== AGENT AVATARS ===== */
.custom-agent-join-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-agent-join-avatar .gallery-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-agent-join-avatar .gallery-avatar i {
    font-size: 18px;
    color: white;
}

.agent-avatar.custom-agent-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agent-avatar.custom-agent-avatar .gallery-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agent-avatar.custom-agent-avatar .gallery-avatar i {
    font-size: 18px;
    color: white;
}

/* ===== CONVERSATION STARTERS IN CHAT ===== */
.conversation-starters-container {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.conversation-starter-btn {
    font-family: inherit;
    animation: fadeInUp 0.3s ease backwards;
}

.conversation-starter-btn:nth-child(1) { animation-delay: 0.05s; }
.conversation-starter-btn:nth-child(2) { animation-delay: 0.1s; }
.conversation-starter-btn:nth-child(3) { animation-delay: 0.15s; }
.conversation-starter-btn:nth-child(4) { animation-delay: 0.2s; }

.agent-welcome-message {
    animation: fadeInUp 0.3s ease;
}

.agent-welcome-message .agent-message-bubble {
    max-width: 600px;
}

/* ===== SPINNER ===== */
.ph-spin,
i.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== DEPLOY TAB ===== */
.ab-deploy-header {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.ab-deploy-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 20px;
    color: #ef4444;
    font-size: 13px;
    font-weight: 500;
}

.ab-deploy-status.published {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.ab-deploy-status i {
    font-size: 16px;
}

.ab-publish-toggle {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--ab-bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--ab-border);
}

.ab-toggle-large {
    position: relative;
    display: inline-block;
    cursor: pointer;
    flex-shrink: 0;
}

.ab-toggle-large input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.ab-toggle-track-large {
    width: 48px;
    height: 26px;
    background: var(--ab-border);
    border-radius: 13px;
    transition: all 0.3s ease;
    position: relative;
}

.ab-toggle-track-large::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--ab-bg);
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--ab-shadow);
}

.ab-toggle-large input:checked + .ab-toggle-track-large {
    background: #10b981;
}

.ab-toggle-large input:checked + .ab-toggle-track-large::after {
    transform: translateX(22px);
}

.ab-publish-info {
    flex: 1;
}

.ab-publish-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ab-text-primary);
    margin-bottom: 2px;
}

.ab-publish-desc {
    font-size: 12px;
    color: var(--ab-text-muted);
}

.ab-deploy-section {
    transition: opacity 0.3s ease;
}

.ab-deploy-section.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.ab-copy-field {
    display: flex;
    gap: 8px;
}

.ab-copy-field .ab-input {
    flex: 1;
    font-family: 'Fira Code', 'SF Mono', monospace;
    font-size: 12px;
}

.ab-copy-btn,
.ab-regenerate-btn,
.ab-preview-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ab-bg-tertiary);
    border: 1px solid var(--ab-border);
    border-radius: 8px;
    color: var(--ab-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    text-decoration: none;
}

.ab-copy-btn:hover,
.ab-regenerate-btn:hover,
.ab-preview-btn:hover {
    background: var(--ab-accent-bg);
    border-color: var(--ab-accent);
    color: var(--ab-accent);
}

.ab-code-block {
    position: relative;
    background: var(--ab-bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--ab-border);
    overflow: hidden;
}

.ab-code-block pre {
    padding: 14px;
    margin: 0;
    font-family: 'Fira Code', 'SF Mono', monospace;
    font-size: 11px;
    line-height: 1.6;
    color: var(--ab-accent);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.ab-code-block .ab-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: var(--ab-bg-tertiary);
    border: none;
}

.ab-api-code pre {
    color: var(--ab-text-primary);
    font-size: 11px;
    line-height: 1.5;
}

.ab-upload-zone.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.ab-upload-zone.drag-over {
    background: var(--ab-accent-bg);
    border-color: var(--ab-accent);
}

.ab-info-box {
    display: flex;
    align-items: flex-start;
}

.ab-info-box i {
    flex-shrink: 0;
    margin-top: 1px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 520px) {
    .agent-builder-panel {
        width: 100vw !important;
        /* right: -100vw; */
        min-width: 100vw;
    }

    .ab-avatar-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .ab-layout-cards {
        grid-template-columns: 1fr;
    }

    .ab-starters-grid {
        grid-template-columns: 1fr;
    }

    .ab-theme-grid,
    .ab-theme-grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    .ab-integrations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== CUSTOM MODAL DIALOG ===== */
.torki-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--ab-overlay, rgba(0, 0, 0, 0.7));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.torki-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.torki-modal {
    background: var(--ab-bg, #000000);
    border: 1px solid var(--ab-border, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-width: 420px;
    width: 90%;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s ease;
    overflow: hidden;
}

.torki-modal-overlay.open .torki-modal {
    transform: scale(1) translateY(0);
}

.torki-modal-header {
    padding: 20px 24px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.torki-modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.torki-modal-icon.warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.torki-modal-icon.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.torki-modal-icon.info {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.torki-modal-icon.success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.torki-modal-icon.question {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.torki-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--ab-text-primary, #ffffff);
    margin: 0;
}

.torki-modal-body {
    padding: 16px 24px 24px;
}

.torki-modal-message {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ab-text-secondary, rgba(255, 255, 255, 0.7));
    margin: 0;
}

.torki-modal-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.torki-modal-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.torki-modal-btn-secondary {
    background: var(--ab-bg-tertiary, rgba(255, 255, 255, 0.04));
    color: var(--ab-text-secondary, rgba(255, 255, 255, 0.7));
    border: 1px solid var(--ab-border, rgba(255, 255, 255, 0.08));
}

.torki-modal-btn-secondary:hover {
    background: var(--ab-bg-hover, rgba(255, 255, 255, 0.06));
    border-color: var(--ab-border-hover, rgba(255, 255, 255, 0.15));
}

.torki-modal-btn-primary {
    background: #ffffff;
    color: #000000;
}

:root[data-theme="light"] .torki-modal-btn-primary {
    background: #000000;
    color: #ffffff;
}

.torki-modal-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.torki-modal-btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.torki-modal-btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* ===== AGENT PREVIEW CONTAINER ===== */
.agent-preview-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 480px; /* Leave space for the builder panel */
    bottom: 0;
    background: #0a0a0f;
    z-index: 100;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 60px;
}

:root[data-theme="light"] .agent-preview-container {
    background: #f0f0f4;
}

.agent-preview-container.active {
    display: flex;
}

/* Preview Toolbar */
.ap-toolbar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    background: var(--ab-bg-secondary, rgba(255, 255, 255, 0.02));
    border: 1px solid var(--ab-border, rgba(255, 255, 255, 0.06));
    border-radius: 10px;
    padding: 4px;
}

.ap-device-btn {
    padding: 8px 14px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--ab-text-muted, rgba(255, 255, 255, 0.35));
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.ap-device-btn i {
    font-size: 14px;
}

.ap-device-btn:hover {
    color: var(--ab-text-secondary, rgba(255, 255, 255, 0.6));
    background: var(--ab-bg-hover, rgba(255, 255, 255, 0.04));
}

.ap-device-btn.active {
    background: var(--ab-bg-tertiary, rgba(255, 255, 255, 0.06));
    color: var(--ab-text-primary, rgba(255, 255, 255, 0.85));
}

/* State Toggle */
.ap-state-toggle {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    background: var(--ab-bg-secondary, rgba(255, 255, 255, 0.02));
    border: 1px solid var(--ab-border, rgba(255, 255, 255, 0.06));
    border-radius: 8px;
    padding: 3px;
}

.ap-state-btn {
    padding: 6px 12px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--ab-text-muted, rgba(255, 255, 255, 0.3));
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}

.ap-state-btn:hover {
    color: var(--ab-text-secondary, rgba(255, 255, 255, 0.5));
}

.ap-state-btn.active {
    background: var(--ab-bg-tertiary, rgba(255, 255, 255, 0.06));
    color: var(--ab-text-primary, rgba(255, 255, 255, 0.75));
}

/* Phone Frame */
.ap-phone-frame {
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid var(--ab-border, rgba(255, 255, 255, 0.08));
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #0c0c18;
    position: relative;
}

/* Device Sizes */
.ap-phone-frame.ap-mobile {
    width: 375px;
    height: 700px;
    border-radius: 40px;
}

.ap-phone-frame.ap-desktop {
    width: 720px;
    height: 520px;
    border-radius: 16px;
}

.ap-phone-frame.ap-widget {
    width: 380px;
    height: 580px;
    border-radius: 20px;
}

/* Preview Label */
.ap-label {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--ab-text-hint, rgba(255, 255, 255, 0.1));
    text-transform: uppercase;
    font-weight: 600;
}

/* Preview Content Styles */
.ap-preview-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(12, 12, 24, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.ap-preview-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.ap-preview-info {
    flex: 1;
    min-width: 0;
}

.ap-preview-name {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ap-preview-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 4px;
}

.ap-preview-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
}

.ap-preview-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Welcome State */
.ap-preview-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    gap: 16px;
}

.ap-welcome-avatar {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 8px;
}

.ap-welcome-name {
    font-size: 22px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
}

.ap-welcome-message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    max-width: 280px;
    line-height: 1.5;
}

.ap-welcome-starters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
    max-width: 320px;
}

.ap-starter-pill {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.15s ease;
}

/* Chat State */
.ap-preview-messages {
    flex: 1;
    padding: 20px;
    display: none;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.ap-preview-messages.active {
    display: flex;
}

.ap-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
}

.ap-message-user {
    align-self: flex-end;
    background: rgba(139, 92, 246, 0.2);
    color: rgba(255, 255, 255, 0.9);
    border-bottom-right-radius: 4px;
}

.ap-message-agent {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    border-bottom-left-radius: 4px;
}

/* Input Area */
.ap-preview-input {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(12, 12, 24, 0.8);
}

.ap-input-mock {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
}

.ap-input-placeholder {
    flex: 1;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
}

.ap-input-send {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.06);
}

/* Theme Variations for Preview */
.ap-phone-frame[data-theme="light"] {
    background: #f5f5f8;
}

.ap-phone-frame[data-theme="light"] .ap-preview-header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

.ap-phone-frame[data-theme="light"] .ap-preview-name,
.ap-phone-frame[data-theme="light"] .ap-welcome-name {
    color: rgba(0, 0, 0, 0.87);
}

.ap-phone-frame[data-theme="light"] .ap-preview-status,
.ap-phone-frame[data-theme="light"] .ap-welcome-message {
    color: rgba(0, 0, 0, 0.5);
}

.ap-phone-frame[data-theme="light"] .ap-starter-pill {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.6);
}

.ap-phone-frame[data-theme="light"] .ap-message-agent {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.85);
}

.ap-phone-frame[data-theme="light"] .ap-preview-input {
    background: rgba(255, 255, 255, 0.9);
    border-top-color: rgba(0, 0, 0, 0.06);
}

.ap-phone-frame[data-theme="light"] .ap-input-mock {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

.ap-phone-frame[data-theme="light"] .ap-input-placeholder {
    color: rgba(0, 0, 0, 0.35);
}

.ap-phone-frame[data-theme="light"] .ap-input-send {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.5);
}

/* Cosmos Theme */
.ap-phone-frame[data-theme="cosmos"] {
    background: linear-gradient(180deg, #0f0c29 0%, #1a1a3e 100%);
}

/* Ocean Theme */
.ap-phone-frame[data-theme="ocean"] {
    background: linear-gradient(180deg, #0a1628 0%, #0d2137 100%);
}

/* Sunset Theme */
.ap-phone-frame[data-theme="sunset"] {
    background: linear-gradient(180deg, #1a0a1e 0%, #2d1a32 100%);
}

/* Emerald Theme */
.ap-phone-frame[data-theme="emerald"] {
    background: linear-gradient(180deg, #0a1a14 0%, #0f2920 100%);
}

/* Responsive */
@media (max-width: 900px) {
    .ap-phone-frame.ap-desktop {
        width: 90%;
        max-width: 600px;
        height: 450px;
    }
}

@media (max-width: 900px) {
    .agent-preview-container {
        display: none !important; /* Hide preview on mobile/tablet - not enough space */
    }
}

@media (max-width: 480px) {
    .ap-phone-frame.ap-mobile {
        width: 95%;
        max-width: 340px;
        height: 600px;
    }

    .ap-phone-frame.ap-widget {
        width: 95%;
        max-width: 340px;
    }

    .ap-toolbar {
        flex-wrap: wrap;
        max-width: 90%;
    }
}

/* ============================================
   CUSTOM API ENDPOINTS STYLES
   ============================================ */

/* Endpoints List Container */
.ab-endpoints-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.ab-endpoints-empty {
    text-align: center;
    padding: 16px;
    color: #64748b;
    font-size: 13px;
    background: rgba(30, 41, 59, 0.3);
    border-radius: 8px;
    border: 1px dashed rgba(71, 85, 105, 0.4);
}

/* Endpoint Item */
.ab-endpoint-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.ab-endpoint-item:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(99, 102, 241, 0.3);
}

.ab-endpoint-method {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    flex-shrink: 0;
}

.ab-endpoint-method.get {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.ab-endpoint-method.post {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.ab-endpoint-method.put {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.ab-endpoint-method.delete {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.ab-endpoint-info {
    flex: 1;
    min-width: 0;
}

.ab-endpoint-name {
    font-size: 13px;
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ab-endpoint-url {
    font-size: 11px;
    color: #64748b;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ab-endpoint-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.ab-endpoint-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ab-endpoint-actions button:hover {
    background: rgba(71, 85, 105, 0.3);
    color: #e2e8f0;
}

.ab-endpoint-actions button.delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Add Endpoint Button */
.ab-add-endpoint-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: 1px dashed rgba(99, 102, 241, 0.4);
    border-radius: 10px;
    color: #818cf8;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ab-add-endpoint-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.6);
    color: #a5b4fc;
}

.ab-add-endpoint-btn i {
    font-size: 16px;
}

/* Endpoint Form (Inline Modal) */
.ab-endpoint-form {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ab-endpoint-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.ab-endpoint-form-header span {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
}

.ab-endpoint-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ab-endpoint-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Form Row (side by side) */
.ab-form-row {
    display: flex;
    gap: 12px;
}

.ab-form-row .ab-form-group {
    margin-bottom: 12px;
}

/* Endpoint Form Actions */
.ab-endpoint-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(71, 85, 105, 0.3);
}

.ab-endpoint-form-actions .ab-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: rgba(71, 85, 105, 0.3);
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 10px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ab-endpoint-form-actions .ab-btn-secondary:hover {
    background: rgba(71, 85, 105, 0.5);
    border-color: rgba(71, 85, 105, 0.6);
    color: #e2e8f0;
}

.ab-endpoint-form-actions .ab-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.ab-endpoint-form-actions .ab-btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.ab-endpoint-form-actions .ab-btn-primary i {
    font-size: 14px;
}

/* Textarea styling */
.ab-textarea {
    min-height: 60px;
    resize: vertical;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 12px;
}

/* ============================================
   SHARE BUTTONS
   ============================================ */

.ab-share-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.ab-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 20px;
}

.ab-share-btn:hover {
    transform: translateY(-2px);
}

.ab-share-btn.twitter {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.ab-share-btn.twitter:hover {
    background: #000;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ab-share-btn.facebook {
    background: rgba(24, 119, 242, 0.12);
    border-color: rgba(24, 119, 242, 0.25);
    color: #1877f2;
}

.ab-share-btn.facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
    color: #fff;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.ab-share-btn.linkedin {
    background: rgba(10, 102, 194, 0.12);
    border-color: rgba(10, 102, 194, 0.25);
    color: #0a66c2;
}

.ab-share-btn.linkedin:hover {
    background: #0a66c2;
    border-color: #0a66c2;
    color: #fff;
    box-shadow: 0 4px 12px rgba(10, 102, 194, 0.3);
}

.ab-share-btn.whatsapp {
    background: rgba(37, 211, 102, 0.12);
    border-color: rgba(37, 211, 102, 0.25);
    color: #25d366;
}

.ab-share-btn.whatsapp:hover {
    background: #25d366;
    border-color: #25d366;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.ab-share-btn.email {
    background: rgba(234, 67, 53, 0.12);
    border-color: rgba(234, 67, 53, 0.25);
    color: #ea4335;
}

.ab-share-btn.email:hover {
    background: #ea4335;
    border-color: #ea4335;
    color: #fff;
    box-shadow: 0 4px 12px rgba(234, 67, 53, 0.3);
}

/* ============================================
   QR CODE
   ============================================ */

.ab-qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.5) 100%);
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 14px;
}

.ab-qr-code {
    width: 160px;
    height: 160px;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.ab-qr-code canvas,
.ab-qr-code img,
.ab-qr-code svg {
    width: 100% !important;
    height: 100% !important;
}

.ab-qr-hint {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
}

.ab-download-qr {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.ab-download-qr:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.ab-download-qr i {
    font-size: 16px;
}

/* ============================================
   ANALYTICS
   ============================================ */

.ab-analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.ab-analytics-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.5) 100%);
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 14px;
    text-align: center;
    min-height: 90px;
}

.ab-analytics-value {
    font-size: 28px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.ab-analytics-label {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

/* ============================================
   ENDPOINT FORM REFINEMENTS
   ============================================ */

.ab-endpoint-form .ab-label {
    text-transform: none;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    letter-spacing: 0;
}

.ab-endpoint-form .ab-label span {
    font-weight: 400;
    color: #64748b;
}

.ab-endpoint-form .ab-input {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(71, 85, 105, 0.4);
}

.ab-endpoint-form .ab-input:focus {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(15, 23, 42, 0.8);
}

/* ============================================
   CONNECTORS SECTION
   ============================================ */

.ab-connectors-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.ab-connector-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(71, 85, 105, 0.25);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.ab-connector-card:hover {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(99, 102, 241, 0.3);
}

.ab-connector-card.coming-soon {
    opacity: 0.6;
}

.ab-connector-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ab-connector-card-icon i {
    font-size: 18px;
}

.ab-connector-card-info {
    flex: 1;
    min-width: 0;
}

.ab-connector-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ab-connector-card-desc {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ab-connector-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #64748b;
}

.ab-connector-dot.connected {
    background: #22c55e;
}

.ab-soon-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: 600;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Connector Detail Panel */
.ab-connector-detail {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(71, 85, 105, 0.25);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.ab-connector-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(71, 85, 105, 0.2);
}

.ab-back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 12px;
    color: #94a3b8;
    background: rgba(71, 85, 105, 0.2);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ab-back-btn:hover {
    background: rgba(71, 85, 105, 0.3);
    color: #e2e8f0;
}

.ab-connector-detail-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #e2e8f0;
}

.ab-connector-detail-title i {
    font-size: 18px;
    color: #818cf8;
}

.ab-connector-detail-body {
    padding: 16px;
}

.ab-connector-detail-desc {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 12px;
}

/* Scopes List */
.ab-scopes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.ab-scope-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.2);
    border-radius: 8px;
}

.ab-scope-row.disabled {
    opacity: 0.5;
}

.ab-scope-info {
    flex: 1;
}

.ab-scope-name {
    font-size: 13px;
    font-weight: 500;
    color: #e2e8f0;
}

.ab-scope-desc {
    font-size: 11px;
    color: #64748b;
}

/* Connect Button */
.ab-connect-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ab-connect-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.5);
}

.ab-connect-btn.connected {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.ab-connect-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: #94a3b8;
    background: rgba(71, 85, 105, 0.2);
    border-color: rgba(71, 85, 105, 0.3);
}

/* Google OAuth connect button */
.ab-connect-btn.google {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.2), rgba(219, 68, 55, 0.2));
    border-color: rgba(66, 133, 244, 0.4);
    color: #fff;
}

.ab-connect-btn.google:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.3), rgba(219, 68, 55, 0.3));
    border-color: rgba(66, 133, 244, 0.6);
}

.ab-connect-btn.google i {
    color: #4285f4;
}

/* Disconnect button */
.ab-disconnect-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ab-disconnect-btn:hover {
    background: rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.4);
}

/* Toggle disabled state for connectors */
.ab-toggle.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Spin animation for loading */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}
