/**
 * Shois Chat Button — Template Editor & Library CSS
 *
 * Styles for the template grid, template cards, 3-column editor,
 * live preview, and all editor form controls.
 *
 * @package ShoisChatButton
 */

/* ═══════════════════════════════════════════════════════
   TEMPLATES LIBRARY
   ═══════════════════════════════════════════════════════ */
.shcb-tpl-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 24px;
}

@media (max-width: 1200px) {
    .shcb-tpl-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .shcb-tpl-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .shcb-tpl-grid { grid-template-columns: 1fr; }
}

.shcb-tpl-card {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.shcb-tpl-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Preview Area */
.shcb-tpl-card-preview {
    position: relative;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Soft backgrounds based on template */
.shcb-tpl-card[data-slug="classic-green"] .shcb-tpl-card-preview { background: #f0fdf4; }
.shcb-tpl-card[data-slug="dark-elegance"] .shcb-tpl-card-preview { background: #0f172a; }
.shcb-tpl-card[data-slug="gradient-sunset"] .shcb-tpl-card-preview { background: linear-gradient(135deg, #f97316, #ef4444); }
.shcb-tpl-card[data-slug="minimal-white"] .shcb-tpl-card-preview { background: #f8fafc; }

.shcb-tpl-preview-mock {
    width: 140px;
    height: 100px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    padding: 16px;
    box-sizing: border-box;
}

/* Dark mode mock for dark-elegance */
.shcb-tpl-card[data-slug="dark-elegance"] .shcb-tpl-preview-mock { background: #1e293b; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }

.shcb-tpl-mock-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--tpl-color);
    position: absolute;
    top: 16px; left: 16px;
}

.shcb-tpl-mock-line-1 {
    height: 6px; width: 60px; background: #e2e8f0; border-radius: 4px;
    position: absolute; top: 23px; left: 44px;
}
.shcb-tpl-card[data-slug="dark-elegance"] .shcb-tpl-mock-line-1 { background: #334155; }

.shcb-tpl-mock-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tpl-color);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Info + actions */
.shcb-tpl-card-info {
    padding: 20px 20px 16px;
    flex: 1;
}

.shcb-tpl-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--scb-text, #1e293b);
    margin: 0;
}

.shcb-tpl-card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 20px;
}

/* Buttons inside card */
.shcb-tpl-btn-customize {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.shcb-tpl-btn-customize:hover { background: #f8fafc; border-color: #94a3b8; color: #0f172a; }

.shcb-tpl-btn-activate {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: var(--scb-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.shcb-tpl-btn-activate:hover { background: var(--scb-primary-hover); }

.shcb-tpl-active-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--scb-primary);
}
.shcb-tpl-active-status svg {
    width: 16px; height: 16px;
    background: var(--scb-primary);
    color: white;
    border-radius: 50%;
    padding: 2px;
}

.shcb-tpl-count {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

/* ═══════════════════════════════════════════════════════
   3-COLUMN EDITOR
   ═══════════════════════════════════════════════════════ */
.shcb-template-editor {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
}

.shcb-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: var(--scb-card-bg, #fff);
    border-bottom: 1px solid var(--scb-border, #e5e7eb);
    flex-shrink: 0;
}

.shcb-editor-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.shcb-editor-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shcb-saved-indicator {
    font-size: 13px;
    color: var(--scb-primary);
    font-weight: 500;
}

.shcb-editor-layout {
    display: grid;
    grid-template-columns: 180px 1fr 360px;
    flex: 1;
    overflow: hidden;
}

/* Left sidebar */
.shcb-editor-sidebar {
    border-right: 1px solid var(--scb-border, #e5e7eb);
    padding: 12px 0;
    background: var(--scb-card-bg, #fff);
    overflow-y: auto;
}

.shcb-editor-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--scb-text-light, #64748b);
    transition: all 0.15s;
    text-align: left;
}

.shcb-editor-tab:hover {
    background: #f8fafc;
    color: var(--scb-text, #1e293b);
}

.shcb-editor-tab-active {
    color: var(--scb-primary);
    background: var(--scb-primary-light);
    border-right: 3px solid var(--scb-primary);
    font-weight: 600;
}

.shcb-editor-tab-icon {
    font-size: 16px;
}

/* Center: Controls */
/* Editor Content Layout */
.shcb-editor-controls {
    overflow-y: auto;
    padding: 24px;
    background: #f9fafb;
}

.shcb-section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--scb-text-light, #64748b);
    margin: 24px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.shcb-section-title:first-child {
    margin-top: 0;
}

/* Form controls */
.shcb-field-group {
    margin-bottom: 16px;
}

.shcb-field-indent {
    margin-left: 20px;
    padding-left: 16px;
    border-left: 2px solid #e5e7eb;
}

.shcb-field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--scb-text, #1e293b);
    margin-bottom: 6px;
}

.shcb-field-value {
    margin-left: auto;
    font-size: 12px;
    color: var(--scb-text-light, #64748b);
    font-weight: 400;
}

.shcb-field-help {
    font-size: 12px;
    color: var(--scb-text-light, #64748b);
    margin: 4px 0 0;
}

/* .shcb-input styles removed here - now inherited from app.css */
.shcb-textarea {
    resize: vertical;
    min-height: 70px;
}

/* Color input */
.shcb-color-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.shcb-color-input {
    width: 40px;
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 2px;
    cursor: pointer;
}

.shcb-color-hex {
    width: 100px;
    font-family: monospace;
}

.shcb-gradient-preview {
    width: 40px;
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    flex-shrink: 0;
}

/* Gradient builder */
.shcb-gradient-builder {
    margin-top: 8px;
}

.shcb-gradient-preview-bar {
    height: 32px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    margin-bottom: 10px;
}

.shcb-gradient-stops {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.shcb-gradient-stop {
    display: flex;
    align-items: center;
    gap: 4px;
}

.shcb-gradient-stop input[type="color"] {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
}

.shcb-gradient-stop-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

/* Color mode toggle (Solid / Gradient) */
.shcb-color-mode-toggle {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.shcb-mode-btn {
    padding: 4px 10px;
    font-size: 11px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    color: #64748b;
}

.shcb-mode-btn:hover {
    border-color: var(--scb-primary, #6366f1);
}

.shcb-mode-btn-active {
    background: var(--scb-primary, #6366f1);
    color: #fff;
    border-color: var(--scb-primary, #6366f1);
}

/* Gradient presets */
.shcb-gradient-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.shcb-gradient-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    padding: 0;
}

.shcb-gradient-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.shcb-gradient-swatch-active {
    border-color: var(--scb-primary, #6366f1);
    box-shadow: 0 0 0 2px var(--scb-primary, #6366f1);
}

/* Icon selector grid */
.shcb-icon-group {
    margin-bottom: 12px;
}

.shcb-icon-group-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.shcb-icon-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.shcb-icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
}

.shcb-icon-option:hover {
    border-color: var(--scb-primary, #6366f1);
    background: rgba(99, 102, 241, 0.03);
}

.shcb-icon-option-active {
    border-color: var(--scb-primary, #6366f1);
    background: rgba(99, 102, 241, 0.06);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.shcb-icon-svg {
    width: 22px;
    height: 22px;
    color: #475569;
}

.shcb-icon-option-active .shcb-icon-svg {
    color: var(--scb-primary, #6366f1);
}

.shcb-icon-svg svg {
    width: 100%;
    height: 100%;
}

.shcb-icon-label {
    font-size: 8px;
    color: #64748b;
    text-align: center;
    line-height: 1.2;
}

/* Section header row */
.shcb-section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.shcb-section-header-row .shcb-section-title {
    margin: 0;
}

.shcb-btn-danger {
    color: #ef4444;
    border-color: #fecaca;
    background: #fef2f2;
}

.shcb-btn-danger:hover {
    background: #fee2e2;
    border-color: #f87171;
}

/* Range input */
.shcb-range-input {
    width: 100%;
    accent-color: var(--scb-primary, #6366f1);
}

/* Position grid */
.shcb-position-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.shcb-position-btn {
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
}

.shcb-position-btn:hover {
    border-color: var(--scb-primary, #6366f1);
}

.shcb-position-btn-active {
    border-color: var(--scb-primary);
    background: var(--scb-primary-light);
    color: var(--scb-primary);
    font-weight: 600;
}

/* Toggle */
.shcb-field-toggle .shcb-toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
}

.shcb-toggle-text {
    flex: 1;
}

/* Variables */
.shcb-variables-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.shcb-variable-tag {
    font-size: 11px;
    padding: 3px 8px;
    background: #f1f5f9;
    border-radius: 4px;
    color: var(--scb-primary, #6366f1);
    font-family: monospace;
}

/* ═══════════════════════════════════════════════════════
   LIVE PREVIEW
   ═══════════════════════════════════════════════════════ */
.shcb-editor-preview {
    border-left: 1px solid var(--scb-border, #e5e7eb);
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.shcb-preview-header {
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.shcb-preview-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--scb-text-light, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shcb-preview-frame {
    flex: 1;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shcb-preview-mocksite {
    position: relative;
    width: 280px;
    height: 400px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.shcb-mocksite-nav {
    height: 32px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.shcb-mocksite-content {
    padding: 16px;
}

.shcb-mocksite-block {
    height: 16px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 10px;
}

.shcb-mocksite-block-sm {
    width: 60%;
}

/* Widget preview in mocksite - handled entirely by real widget classes now */

/* ═══════════════════════════════════════════════════════
   ANIMATION PICKER
   ═══════════════════════════════════════════════════════ */
.shcb-animation-picker {
    margin-top: 16px;
}

.shcb-anim-group {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.shcb-anim-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: #f9fafb;
    cursor: pointer;
    font-size: 13px;
    color: var(--scb-text, #1e293b);
}

.shcb-anim-group-icon {
    font-size: 16px;
}

.shcb-anim-group-label {
    font-weight: 600;
    flex: 1;
    text-align: left;
}

.shcb-anim-group-count {
    font-size: 11px;
    color: var(--scb-text-light, #64748b);
    background: #e5e7eb;
    padding: 1px 8px;
    border-radius: 10px;
}

.shcb-anim-group-selection {
    font-size: 11px;
    color: var(--scb-primary, #6366f1);
}

.shcb-anim-group-chevron {
    color: #94a3b8;
}

.shcb-anim-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
}

.shcb-anim-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
}

.shcb-anim-card:hover {
    border-color: var(--scb-primary, #6366f1);
    background: rgba(99, 102, 241, 0.03);
}

.shcb-anim-card-selected {
    border-color: var(--scb-primary, #6366f1);
    background: rgba(99, 102, 241, 0.06);
}

.shcb-anim-preview {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shcb-anim-preview-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--scb-primary, #6366f1);
}

.shcb-anim-preview-none {
    font-size: 14px;
    color: #94a3b8;
}

.shcb-anim-card-label {
    font-size: 10px;
    color: var(--scb-text-light, #64748b);
    text-align: center;
    line-height: 1.2;
}

.shcb-anim-card-check {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
    color: var(--scb-primary, #6366f1);
}

.shcb-anim-card {
    position: relative;
}

/* Toast */
.shcb-saving-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    background: #1e293b;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
}

/* Responsive */
@media (max-width: 1024px) {
    .shcb-editor-layout {
        grid-template-columns: 1fr;
    }

    .shcb-editor-sidebar {
        display: flex;
        border-right: none;
        border-bottom: 1px solid var(--scb-border, #e5e7eb);
        padding: 0;
        overflow-x: auto;
    }

    .shcb-editor-tab {
        white-space: nowrap;
        padding: 10px 16px;
        border-right: none;
    }

    .shcb-editor-tab-active {
        border-right: none;
        border-bottom: 3px solid var(--scb-primary, #6366f1);
    }

    .shcb-editor-preview {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════
   COLOR PICKER — Redesigned
   ═══════════════════════════════════════════════════════ */

/* Solid / Gradient mode tab switcher */
.shcb-color-mode-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
    margin-bottom: 12px;
}

.shcb-color-mode-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

.shcb-color-mode-tab.active {
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Color panel header */
.shcb-color-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.shcb-color-panel-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #94a3b8;
    text-transform: uppercase;
}

/* Trigger Button */
.shcb-color-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.shcb-color-trigger-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.shcb-color-trigger-btn.active {
    background: #ffffff;
    border-color: #5170ff;
    color: #5170ff;
    box-shadow: 0 0 0 3px rgba(81, 112, 255, 0.1);
}

.shcb-trigger-color-preview {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

.shcb-trigger-chevron {
    transition: transform 0.2s;
}

.shcb-color-trigger-btn.active .shcb-trigger-chevron {
    transform: rotate(180deg);
}

/* Picker Dropdown / Container */
.shcb-color-picker-dropdown {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    animation: scb-slide-down 0.2s ease-out;
}

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

/* Spectrum gradient box */
.shcb-color-spectrum {
    position: relative;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    cursor: crosshair;
}

.shcb-spectrum-overlay-white {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, #fff, transparent);
}

.shcb-spectrum-overlay-black {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, #000);
}

.shcb-spectrum-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.shcb-hue-slider-row {
    margin-bottom: 12px;
}

.shcb-hue-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
    outline: none;
}

.shcb-hue-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.shcb-hue-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Hex input row */
.shcb-color-hex-row {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 10px;
    gap: 6px;
    margin-bottom: 10px;
    position: relative;
}

.shcb-color-hash {
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    user-select: none;
}

.shcb-color-hex-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    font-family: 'Courier New', monospace;
    padding: 9px 0;
    outline: none;
    min-width: 0;
}

/* Hidden native color trigger */
.shcb-color-native {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    opacity: 0.01;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

/* Color swatches */
.shcb-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.shcb-color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    padding: 0;
}

.shcb-color-swatch:hover {
    transform: scale(1.15);
}

.shcb-color-swatch-active {
    border-color: #5170ff;
    box-shadow: 0 0 0 2px rgba(81, 112, 255, 0.25);
}

/* Solid picker container */
.shcb-solid-picker {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
}

/* Gradient builder v2 */
.shcb-gradient-builder-v2 {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
}

.shcb-gradient-panels {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

/* Gradient direction section */
.shcb-gradient-direction-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.shcb-gradient-direction-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shcb-gradient-direction-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.shcb-gradient-direction-sub {
    font-size: 11px;
    color: #94a3b8;
}

.shcb-gradient-angle-badge {
    background: #f0fdf4;
    color: var(--scb-primary-hover);
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #bbf7d0;
}

.shcb-gradient-dial-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shcb-gradient-dial-wrap {
    padding: 0 4px;
}

.shcb-gradient-dial {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #330066, #5170ff);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.shcb-gradient-dial::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #5170ff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

/* Gradient preview bar */
.shcb-gradient-preview-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shcb-gradient-preview-label {
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.shcb-gradient-preview-track {
    flex: 1;
    height: 28px;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

/* ─── Content Tab Cards ────────────────────────────── */
.shcb-settings-card {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.shcb-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid #f8fafc;
}

.shcb-card-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.shcb-card-icon {
    color: var(--scb-primary-hover); /* Matching ss icon color */
}

.shcb-card-body {
    padding: 20px;
}

.shcb-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ─── Toggle Field & Switches ─────────────────────────── */
.shcb-toggle-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

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

.shcb-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.shcb-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.shcb-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: .3s;
    border-radius: 24px;
}

.shcb-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

input:checked + .shcb-switch-slider {
    background-color: var(--scb-primary);
}

input:checked + .shcb-switch-slider:before {
    transform: translateX(20px);
}

/* ─── Media Library Field ─────────────────────────────── */
.shcb-media-field {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.shcb-media-preview-wrap {
    flex-shrink: 0;
}

.shcb-media-preview {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
}

.shcb-media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.shcb-media-placeholder {
    color: #94a3b8;
}

.shcb-media-check {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: var(--scb-primary);
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.shcb-media-controls {
    flex: 1;
}

.shcb-media-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 8px;
}

.shcb-media-controls .shcb-field-group {
    margin-bottom: 0;
}

.shcb-btn-primary {
    background: linear-gradient(135deg, #330066, #5170ff);
    color: #fff;
    border: none;
    transition: all 0.2s ease;
}
.shcb-btn-primary:hover {
    background: linear-gradient(135deg, #220044, #3d5ce6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(81, 112, 255, 0.25);
}

.shcb-btn-outline {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.shcb-btn-outline:hover {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

/* ─── Behavior Tab Redesign ─────────────────────────── */
.shcb-behavior-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--scb-primary); /* Green color from SS */
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.shcb-behavior-section-header svg {
    flex-shrink: 0;
}

.shcb-behavior-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.shcb-behavior-toggle-info {
    flex: 1;
}

.shcb-behavior-toggle-info .shcb-field-label {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.shcb-behavior-sub-field {
    margin-top: 16px;
    padding-top: 4px;
}

.shcb-sub-label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    color: #64748b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shcb-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 20px 0;
}

.shcb-slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.shcb-slider-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--scb-primary);
}

/* Custom Range Slider */
.shcb-range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #f1f5f9;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
}

.shcb-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--scb-primary);
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.shcb-range-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--scb-primary);
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.shcb-select-wrapper {
    position: relative;
    width: 100%;
}

.shcb-select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.shcb-select-wrapper:focus-within .shcb-select-arrow {
    color: var(--scb-primary);
}

/* ─── Animations Tab Redesign (V2) ─────────────────── */
.shcb-animations-header {
    margin-bottom: 24px;
}

.shcb-anim-v2-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.shcb-anim-v2-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    width: 100%;
}

.shcb-anim-v2-card:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.shcb-anim-v2-selected {
    border-color: var(--scb-primary);
    background: #f0fdf4;
    box-shadow: 0 0 0 1px var(--scb-primary);
}

.shcb-anim-v2-selected:hover {
    border-color: var(--scb-primary);
    background: #f0fdf4;
}

.shcb-anim-v2-preview {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    background: #f8fafc;
    border-radius: 50%;
}

.shcb-anim-v2-selected .shcb-anim-v2-preview {
    background: #fff;
}

.shcb-anim-v2-label {
    font-size: 11px;
    font-weight: 700;
    color: #334155;
    text-align: center;
    display: block;
}

.shcb-anim-v2-selected .shcb-anim-v2-label {
    color: #065f46;
}

.shcb-anim-v2-check {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--scb-primary);
    color: #fff;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mini Widget Icon for Preview */
.shcb-mini-widget-container {
    perspective: 800px;
}

.shcb-mini-widget {
    position: relative;
    width: 24px;
    height: 24px;
}

.shcb-mini-widget-bubble {
    width: 100%;
    height: 80%;
    background: var(--scb-primary);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3px;
    gap: 3px;
}

.shcb-mini-widget-line {
    height: 2px;
    background: rgba(255,255,255,0.4);
    border-radius: 1px;
    width: 80%;
}

.shcb-mini-widget-line.short {
    width: 50%;
}

.shcb-mini-widget-tail {
    position: absolute;
    bottom: 0;
    right: 4px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--scb-primary);
}

/* Force animations to loop in the picker */
.shcb-anim-v2-preview .shcb-mini-widget {
    animation-iteration-count: infinite !important;
    animation-delay: 0.5s !important; /* Slight delay to avoid all starting exactly at once */
}

/* Specific adjustment for entrance animations in loop */
.shcb-anim-v2-preview .shcb-mini-widget[class*="shcb-enter-"] {
    animation-duration: 2s !important;
}

.shcb-anim-v2-none-icon {
    font-size: 20px;
    color: #94a3b8;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #cbd5e1;
    border-radius: 6px;
}

.shcb-anim-v2-selected.shcb-anim-v2-none {
    border-color: #cbd5e1;
    background: #f8fafc;
    box-shadow: none;
}

.shcb-anim-v2-selected.shcb-anim-v2-none .shcb-anim-v2-label {
    color: #64748b;
}

.shcb-anim-v2-selected.shcb-anim-v2-none .shcb-anim-v2-check {
    background: #94a3b8;
}

/* ─── Toggle Switch Custom Styles ──────────────────── */
.shcb-toggle-slider {
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.shcb-toggle-slider.active {
    box-shadow: 0 2px 4px rgba(81, 112, 255, 0.2);
}

.shcb-toggle-slider > span {
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
