/**
 * Campaign Editor Modal - Professional Redesign
 * Sidebar navigation with live preview
 */

/* ============================================
   MODAL CONTAINER
   ============================================ */
.campaign-editor-modal {
    z-index: 12500;
}

.campaign-editor-modal .modal-content {
    width: 1200px;
    height: 990px;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
    background: var(--bg-primary);
}

/* ============================================
   MODAL HEADER - Solid dark like AI Model Tuning
   ============================================ */
.ce-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.ce-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.ce-header h4 i {
    color: var(--theme-primary);
}

.ce-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ce-header .modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ce-header .modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ============================================
   MAIN LAYOUT - Sidebar + Content
   ============================================ */
.ce-body {
    display: grid;
    grid-template-columns: 280px 1fr;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* ============================================
   SIDEBAR - Navigation + Preview
   ============================================ */
.ce-sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Navigation Steps */
.ce-nav {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-light);
}

.ce-nav-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-left: 4px;
}

.ce-nav-steps {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ce-nav-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    background: transparent;
    text-align: left;
    width: 100%;
    font-family: inherit;
}

.ce-nav-step:hover {
    background: var(--bg-tertiary);
}

.ce-nav-step.active {
    background: var(--bg-primary);
    border-color: var(--theme-primary);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
}

.ce-nav-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.ce-nav-step.active .ce-nav-step-number {
    background: var(--theme-primary);
    color: white;
}

.ce-nav-step.completed .ce-nav-step-number {
    background: var(--success-color);
    color: white;
}

.ce-nav-step.completed .ce-nav-step-number::after {
    content: '✓';
}

.ce-nav-step-info {
    flex: 1;
    min-width: 0;
}

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

.ce-nav-step.active .ce-nav-step-title {
    color: var(--theme-primary);
}

.ce-nav-step-desc {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   LIVE PREVIEW SECTION
   ============================================ */
.ce-preview-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow: hidden;
    min-height: 0;
}

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

.ce-preview-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ce-preview-title i {
    font-size: 10px;
}

.ce-preview-expand {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    background: var(--theme-primary);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.ce-preview-expand:hover {
    filter: brightness(1.1);
}

/* Preview Container */
.ce-preview-container {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.ce-preview-type-badge {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ce-preview-type-badge i {
    color: var(--theme-primary);
}

.ce-preview-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Preview Renderers */
.ce-preview-chat-message {
    width: 100%;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ce-preview-chat-image {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.ce-preview-chat-image img {
    width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: cover;
    display: block;
}

.ce-preview-chat-bubble {
    background: var(--theme-primary);
    color: white;
    padding: 14px 16px;
    border-radius: 16px 16px 4px 16px;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ce-preview-chat-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
}

.ce-preview-chat-text {
    opacity: 0.95;
    margin-bottom: 8px;
}

.ce-preview-chat-cta {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.9;
    margin-top: 6px;
    cursor: pointer;
}

/* Form preview fields in small preview */
.ce-preview-form-fields {
    margin-top: 8px;
    padding: 8px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}

.ce-preview-form-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 6px;
}

.ce-preview-form-field:last-child {
    margin-bottom: 0;
}

.ce-preview-field-label {
    font-size: 9px;
    opacity: 0.9;
    font-weight: 500;
    color: inherit;  /* Inherit from parent for custom in-chat text color */
}

.ce-preview-field-input {
    height: 16px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.ce-preview-form-more {
    font-size: 9px;
    opacity: 0.7;
    text-align: center;
    margin-top: 4px;
}

.ce-preview-in-chat {
    width: 100%;
    /* Background, border set by inline styles for live preview */
    padding: 14px 16px;
}

.ce-preview-in-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ce-preview-in-chat-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--theme-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.ce-preview-in-chat-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.ce-preview-in-chat-message {
    font-size: 13px;
    color: inherit;  /* Inherit from parent for custom in-chat text color */
    line-height: 1.5;
    margin-bottom: 12px;
}

.ce-preview-in-chat-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--theme-primary);
    color: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.ce-preview-modal {
    width: 100%;
    max-width: 260px;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.ce-preview-modal-header {
    padding: 14px 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ce-preview-modal-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.ce-preview-modal-body {
    padding: 16px;
}

.ce-preview-modal-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 14px;
}

.ce-preview-modal-image {
    width: 100%;
    height: 80px;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
}

.ce-preview-modal-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.ce-preview-modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 8px;
}

.ce-preview-modal-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.ce-preview-modal-btn.primary {
    background: var(--theme-primary);
    color: white;
}

.ce-preview-modal-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.ce-preview-toaster {
    width: 100%;
    max-width: 280px;
    background: var(--bg-primary);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 2px solid var(--theme-primary);
}

.ce-preview-toaster-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(74, 144, 226, 0.1);
    color: var(--theme-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.ce-preview-toaster-content {
    flex: 1;
    min-width: 0;
}

.ce-preview-toaster-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ce-preview-toaster-message {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.ce-preview-toaster-close {
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 2px;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.ce-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ce-content-header {
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-primary);
}

.ce-content-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ce-content-title i {
    color: var(--theme-primary);
    font-size: 16px;
}

.ce-content-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.ce-content-main {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-primary);
}

/* Tab Content Panels */
.ce-tab-panel {
    display: none;
}

.ce-tab-panel.active {
    display: block;
}

/* ============================================
   FORM SECTIONS - Clean containers like AI Model Tuning
   ============================================ */
.ce-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.ce-section:last-child {
    margin-bottom: 0;
}

.ce-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.ce-section-icon {
    color: var(--theme-primary);
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.ce-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.ce-section-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 16px 0;
    line-height: 1.5;
}

/* Form Grid */
.ce-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ce-form-grid.single-col {
    grid-template-columns: 1fr;
}

.ce-form-full {
    grid-column: 1 / -1;
}

/* Slider grid for rules section */
.ce-slider-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Enhanced Form Group */
.ce-form-group {
    margin-bottom: 0;
}

.ce-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.ce-form-group .form-input {
    width: 100%;
}

.ce-form-group .form-help {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ============================================
   SLIDER COMPONENT (Campaign-specific)
   ============================================ */
.ce-slider {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ce-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ce-slider-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.ce-slider-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--theme-primary);
    min-width: 50px;
    text-align: right;
}

.ce-slider-track {
    position: relative;
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.ce-slider-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--theme-primary);
    border-radius: 3px;
    pointer-events: none;
}

/* Style the native range input to be visible */
.ce-slider-input {
    position: absolute;
    width: 100%;
    height: 20px;
    top: 50%;
    left: 0;
    margin: 0;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 2;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

/* Webkit thumb */
.ce-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: white;
    border: 3px solid var(--theme-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.ce-slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

/* Firefox thumb */
.ce-slider-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: white;
    border: 3px solid var(--theme-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ce-slider-input::-moz-range-thumb:hover {
    transform: scale(1.1);
}

.ce-slider-help {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ce-slider-help i {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================
   DATE INPUTS - Calendar icon in theme color
   ============================================ */
.campaign-editor-modal input[type="datetime-local"] {
    position: relative;
}

.campaign-editor-modal input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(50%) sepia(50%) saturate(500%) hue-rotate(180deg);
    cursor: pointer;
    opacity: 0.7;
}

.campaign-editor-modal input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* For dark theme */
[data-theme="dark"] .campaign-editor-modal input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(60%) sepia(80%) saturate(400%) hue-rotate(160deg) brightness(1.2);
}

/* ============================================
   TARGETING OPTIONS
   ============================================ */
.ce-targeting-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ce-targeting-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-light);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ce-targeting-option:hover {
    border-color: var(--border-medium);
    background: var(--bg-tertiary);
}

.ce-targeting-option.selected {
    border-color: var(--theme-primary);
    background: rgba(74, 144, 226, 0.05);
}

.ce-targeting-option input[type="radio"] {
    margin-top: 2px;
}

.ce-targeting-option-content {
    flex: 1;
}

.ce-targeting-option-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ce-targeting-option-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ============================================
   INFO BOX
   ============================================ */
.ce-info-box {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid #3b82f6;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ce-info-box i {
    color: #3b82f6;
    font-size: 14px;
    margin-top: 2px;
}

.ce-info-box-content {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.ce-info-box-content strong {
    color: var(--text-primary);
}

/* ============================================
   MODAL FOOTER
   ============================================ */
.ce-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
}

.ce-footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ce-footer-status {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ce-footer-status i {
    font-size: 10px;
}

.ce-footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ce-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.ce-btn.secondary {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.ce-btn.secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
}

.ce-btn.primary {
    background: var(--theme-primary);
    color: white;
}

.ce-btn.primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* ============================================
   PREVIEW IN CONTEXT MODAL
   ============================================ */
.ce-context-preview-modal .modal-content {
    max-width: 900px;
    width: 90vw;
    max-height: 85vh;
}

.ce-context-preview-body {
    padding: 0;
    background: var(--bg-secondary);
    min-height: 500px;
    position: relative;
}

/* Chat Simulator */
.ce-chat-simulator {
    display: flex;
    flex-direction: column;
    height: 550px;
    background: var(--bg-primary);
    border-radius: 12px;
    margin: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-light);
}

.ce-chat-simulator-header {
    padding: 16px 20px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
}

.ce-chat-simulator-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--theme-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    overflow: hidden;
}

.ce-chat-simulator-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.ce-chat-simulator-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--bg-primary);
}

.ce-sim-message {
    max-width: 80%;
}

.ce-sim-message.user {
    align-self: flex-end;
}

/* Chat message rows - matching actual chat interface with theme colors */
.ce-sim-message-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

/* All avatars on the left, like the actual chat */
.ce-sim-message-row.user {
    flex-direction: row;
}

.ce-sim-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
}

.ce-sim-avatar.user-avatar {
    background: #f97316;
    color: white;
}

.ce-sim-avatar.assistant-avatar {
    background: white;
    padding: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ce-sim-bubble-wrapper {
    max-width: 600px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

/* Theme-aware bubble styling - matches actual chat */
/* All bubbles have same structure, just different border colors */
.ce-sim-bubble-wrapper {
    background: var(--bg-secondary);
    border-left: 4px solid var(--theme-primary);
}

.ce-sim-bubble-wrapper.assistant {
    border-left-color: var(--theme-primary);
}

.ce-sim-bubble-content {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.ce-sim-bubble-content strong {
    color: var(--text-primary);
}

/* Legacy bubble styles for backward compat */
.ce-sim-message.user .ce-sim-bubble,
.ce-sim-bubble.user-bubble {
    background: var(--bg-secondary);
    border-left: 4px solid var(--theme-primary);
    color: var(--text-primary);
    border-radius: 12px;
}

.ce-sim-message.assistant {
    align-self: flex-start;
}

.ce-sim-message.assistant .ce-sim-bubble,
.ce-sim-bubble.assistant-bubble {
    background: var(--bg-secondary);
    border-left: 4px solid var(--theme-primary);
    color: var(--text-primary);
    border-radius: 12px;
}

.ce-sim-bubble {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.6;
}

/* Campaign bubble in preview - matching chat message style */
.ce-sim-campaign-bubble {
    background: var(--bg-secondary);
    border-left: 4px solid var(--theme-primary);
    border-radius: 12px;
    padding: 16px;
}

/* Toaster Position Simulator */
.ce-toaster-simulator {
    position: relative;
    height: 500px;
    margin: 20px;
    background: var(--bg-primary);
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ce-toaster-simulator::before {
    content: 'Page Content Area';
    font-size: 14px;
    color: var(--text-muted);
    opacity: 0.5;
}

.ce-toaster-preview-positioned {
    position: absolute;
    max-width: 320px;
}

/* Top row */
.ce-toaster-preview-positioned.top-left,
.ce-toaster-preview-positioned.upper-left {
    top: 20px;
    left: 20px;
}

.ce-toaster-preview-positioned.top-center,
.ce-toaster-preview-positioned.upper-middle {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.ce-toaster-preview-positioned.top-right,
.ce-toaster-preview-positioned.upper-right {
    top: 20px;
    right: 20px;
}

/* Middle row */
.ce-toaster-preview-positioned.middle-left {
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
}

.ce-toaster-preview-positioned.center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ce-toaster-preview-positioned.middle-right {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

/* Bottom row */
.ce-toaster-preview-positioned.bottom-left {
    bottom: 20px;
    left: 20px;
}

.ce-toaster-preview-positioned.bottom-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.ce-toaster-preview-positioned.bottom-right {
    bottom: 20px;
    right: 20px;
}

/* ============================================
   DARK MODE ADJUSTMENTS
   ============================================ */
[data-theme="dark"] .ce-header {
    background: var(--bg-secondary);
}

[data-theme="dark"] .ce-preview-container {
    background: var(--bg-secondary);
}

[data-theme="dark"] .ce-slider-track {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
}

[data-theme="dark"] .ce-slider-thumb {
    background: var(--bg-primary);
    border-color: var(--theme-primary);
}

[data-theme="dark"] .ce-preview-modal,
[data-theme="dark"] .ce-preview-toaster {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
}

/* ============================================
   EXISTING TAB CONTENT INTEGRATION
   ============================================ */
.campaign-editor-modal .campaign-tab-content {
    display: none;
    padding: 0;
}

.campaign-editor-modal .campaign-tab-content.active {
    display: block;
}

/* Ensure modal body scrolls while keeping consistent size */
.campaign-editor-modal .ce-content-main {
    flex: 1;
    overflow-y: auto;
}

.campaign-editor-modal .campaign-tab-content .form-group {
    margin-bottom: 20px;
}

.campaign-editor-modal .campaign-tab-content .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.campaign-editor-modal .campaign-tab-content label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.campaign-editor-modal .campaign-tab-content .form-input {
    width: 100%;
}

.campaign-editor-modal .campaign-tab-content .form-help {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Section headers within tabs - match AI Model Tuning style */
.campaign-editor-modal .campaign-tab-content h5,
.campaign-editor-modal .campaign-tab-content h6 {
    color: var(--theme-primary);
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.campaign-editor-modal .campaign-tab-content h5:first-child,
.campaign-editor-modal .campaign-tab-content h6:first-child {
    margin-top: 0;
}

/* Wrap tab content sections in styled containers */
.campaign-editor-modal .campaign-tab-content > div[style*="margin-bottom"] {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px !important;
}

.campaign-editor-modal .campaign-tab-content > div[style*="margin-bottom"]:last-child {
    margin-bottom: 0 !important;
}

/* Targeting options styling */
.campaign-editor-modal .targeting-option {
    transition: all 0.2s ease;
}

.campaign-editor-modal .targeting-option:hover {
    border-color: var(--theme-primary) !important;
    background: rgba(74, 144, 226, 0.03) !important;
}

.campaign-editor-modal .targeting-option input[type="radio"]:checked + strong,
.campaign-editor-modal .targeting-option:has(input[type="radio"]:checked) {
    border-color: var(--theme-primary) !important;
    background: rgba(74, 144, 226, 0.08) !important;
}

/* Info boxes */
.campaign-editor-modal [style*="background: rgba(59, 130, 246, 0.1)"] {
    border-radius: 8px !important;
}

/* Form builder section */
.campaign-editor-modal #customFormBuilder,
.campaign-editor-modal #formBuilderSection {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 20px;
    margin-top: 16px;
}

.campaign-editor-modal .form-field-card {
    background: var(--bg-primary) !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .ce-body {
        grid-template-columns: 240px 1fr;
    }
    
    .ce-form-grid {
        grid-template-columns: 1fr;
    }
    
    .campaign-editor-modal .campaign-tab-content .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .ce-body {
        grid-template-columns: 1fr;
    }
    
    .ce-sidebar {
        display: none;
    }
}

