/**
 * Promo Builder Styles
 * 
 * Drag-and-drop visual builder for creating promos
 * 
 * @package PromioSync
 * @since 1.1.0
 */

/* ==========================================================================
   Variables
   ========================================================================== */

:root {
    --psb-primary: #00843D;
    --psb-primary-light: #e8f5e9;
    --psb-accent: #3182ce;
    --psb-border: #ddd;
    --psb-border-dark: #ccc;
    --psb-bg: #f5f5f5;
    --psb-bg-dark: #e8e8e8;
    --psb-text: #333;
    --psb-text-light: #666;
    --psb-white: #fff;
    --psb-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --psb-shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
    --psb-radius: 4px;
    --psb-radius-lg: 8px;
    --psb-transition: all 0.2s ease;
}

/* ==========================================================================
   Builder Container
   ========================================================================== */

.psb-builder {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 600px;
    padding: 16px;
}

.psb-main {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
}

.psb-builder--fullscreen {
    position: fixed;
    top: 32px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: var(--psb-bg);
    padding: 20px;
}

/* ==========================================================================
   Canvas Area
   ========================================================================== */

.psb-canvas {
    background: var(--psb-white);
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius-lg);
    padding: 0;
    overflow: hidden;
}

.psb-canvas__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, #2c3e50 0%, #3d5a73 100%);
    border-radius: var(--psb-radius-lg) var(--psb-radius-lg) 0 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.psb-canvas__header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.psb-canvas__header-icon {
    color: #fff;
    font-size: 20px;
    opacity: 0.9;
}

.psb-canvas__title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    letter-spacing: 0.3px;
}

.psb-canvas__header-right {
    display: flex;
    gap: 6px;
}

.psb-history-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--psb-radius);
    color: #fff;
    cursor: pointer;
    transition: var(--psb-transition);
}

.psb-history-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
}

.psb-history-btn:disabled,
.psb-history-btn--disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.psb-history-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.psb-canvas__actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.psb-canvas__actions .button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0;
}

.psb-canvas__actions .button .dashicons {
    margin: 0;
}

.psb-canvas__content {
    min-height: 400px;
    padding: 16px;
}

/* ==========================================================================
   Rows
   ========================================================================== */

.psb-row {
    position: relative;
    margin-bottom: 16px;
    border: 2px solid #d97706;
    border-radius: var(--psb-radius-lg);
    background: rgba(217, 119, 6, 0.02);
    overflow: hidden;
    transition: var(--psb-transition);
}

.psb-row--dragging {
    opacity: 0.5;
    border-color: #b45309;
}

.psb-row--ghost {
    background: rgba(217, 119, 6, 0.1);
    border-color: #b45309;
}

.psb-row__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #fff;
    cursor: grab;
}

.psb-row__header:active {
    cursor: grabbing;
}

.psb-row__header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.psb-row__header-icon {
    font-size: 16px;
    opacity: 0.9;
}

.psb-row__header-icon .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.psb-row__header-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.psb-row__header-controls {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: var(--psb-transition);
}

.psb-row:hover .psb-row__header-controls {
    opacity: 1;
}

.psb-row__header-control {
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--psb-transition);
}

.psb-row__header-control:hover {
    background: rgba(255,255,255,0.25);
}

.psb-row__header-control .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.psb-row__header-control--delete:hover {
    background: rgba(220, 53, 69, 0.8);
}

.psb-row__inner {
    display: flex;
    gap: 0;
    min-height: auto;
    padding: 12px;
    background: rgba(217, 119, 6, 0.03);
}

/* Hide psb-column controls - no longer needed */
.psb-column__controls {
    display: none !important;
}

/* ==========================================================================
   Columns
   ========================================================================== */

.psb-column {
    position: relative;
    flex: 1;
    min-height: auto;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    transition: var(--psb-transition);
}

.psb-column:hover {
    border-color: transparent;
}

.psb-column--w-1-6 { flex: 0 0 calc(16.666% - 8px); }
.psb-column--w-1-4 { flex: 0 0 calc(25% - 8px); }
.psb-column--w-1-3 { flex: 0 0 calc(33.333% - 8px); }
.psb-column--w-1-2 { flex: 0 0 calc(50% - 8px); }
.psb-column--w-2-3 { flex: 0 0 calc(66.666% - 8px); }
.psb-column--w-3-4 { flex: 0 0 calc(75% - 8px); }
.psb-column--w-5-6 { flex: 0 0 calc(83.333% - 8px); }
.psb-column--w-full { flex: 0 0 100%; }

.psb-column__modules {
    min-height: 60px;
}

.psb-column__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    color: var(--psb-text-light);
    font-size: 13px;
}

.psb-column__empty .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-bottom: 5px;
    opacity: 0.5;
}

.psb-column__width-handle {
    position: absolute;
    top: 0;
    right: -5px;
    bottom: 0;
    width: 10px;
    cursor: col-resize;
    z-index: 5;
}

.psb-column__width-handle:hover::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 30px;
    background: var(--psb-accent);
    border-radius: 2px;
}

.psb-column__controls {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: var(--psb-transition);
}

.psb-column:hover .psb-column__controls {
    opacity: 1;
}

/* ==========================================================================
   Modules
   ========================================================================== */

.psb-module {
    position: relative;
    background: var(--psb-white);
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius);
    margin-bottom: 8px;
    transition: var(--psb-transition);
    cursor: pointer;
}

.psb-module:last-child {
    margin-bottom: 0;
}

.psb-module:hover {
    border-color: var(--psb-primary);
    box-shadow: var(--psb-shadow);
}

.psb-module--selected {
    border-color: var(--psb-primary);
    box-shadow: 0 0 0 2px var(--psb-primary-light);
}

.psb-module--dragging {
    opacity: 0.5;
}

.psb-module--ghost {
    background: var(--psb-primary-light);
    border-color: var(--psb-primary);
}

.psb-module__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--psb-bg);
    border-bottom: 1px solid var(--psb-border);
    border-radius: var(--psb-radius) var(--psb-radius) 0 0;
}

.psb-module__icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--psb-primary);
}

.psb-module__type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--psb-text-light);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.psb-module__controls {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: var(--psb-transition);
}

.psb-module:hover .psb-module__controls {
    opacity: 1;
}

.psb-module__control {
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--psb-text-light);
    border-radius: 3px;
    transition: var(--psb-transition);
}

.psb-module__control:hover {
    background: var(--psb-bg-dark);
    color: var(--psb-text);
}

.psb-module__control--delete:hover {
    background: #fee;
    color: #dc3545;
}

.psb-module__control--drag {
    cursor: grab;
}

.psb-module__control--drag:active {
    cursor: grabbing;
}

.psb-module__preview {
    padding: 10px;
    font-size: 13px;
    color: var(--psb-text);
}

.psb-module__preview--empty {
    color: var(--psb-text-light);
    font-style: italic;
}

/* Module type specific previews */
.psb-module--heading .psb-module__preview {
    font-weight: 600;
}

.psb-module--image .psb-module__preview img {
    max-width: 100%;
    height: auto;
    display: block;
}

.psb-module--button .psb-module__preview .psb-btn-preview {
    display: inline-block;
    padding: 8px 16px;
    background: var(--psb-primary);
    color: var(--psb-white);
    border-radius: var(--psb-radius);
    font-size: 13px;
}

/* Spacer module - light grey header for contrast */
.psb-module--spacer .psb-module__header {
    background: #e5e7eb;
}

.psb-module--spacer .psb-module__header .psb-module__icon,
.psb-module--spacer .psb-module__header .psb-module__type {
    color: #374151;
}

.psb-module--spacer .psb-module__controls button {
    color: #6b7280;
}

.psb-module--spacer .psb-module__controls button:hover {
    color: #374151;
}

.psb-module--spacer .psb-module__preview {
    display: none;
}

/* Inner spacer modules */
.psb-inner-module.psb-module--spacer .psb-module__header--inner {
    background: #e5e7eb !important;
}

.psb-inner-module.psb-module--spacer .psb-module__header--inner .psb-module__icon,
.psb-inner-module.psb-module--spacer .psb-module__header--inner .psb-module__type {
    color: #374151 !important;
}

.psb-inner-module.psb-module--spacer .psb-module__controls button {
    color: #6b7280 !important;
}

/* ==========================================================================
   Add Row/Module Buttons
   ========================================================================== */

.psb-add-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px;
    border: 2px dashed var(--psb-border);
    border-radius: var(--psb-radius);
    background: transparent;
    color: var(--psb-text-light);
    font-size: 13px;
    cursor: pointer;
    transition: var(--psb-transition);
    width: 100%;
}

.psb-add-row:hover {
    border-color: var(--psb-primary);
    color: var(--psb-primary);
    background: var(--psb-primary-light);
}

.psb-add-module {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px;
    border: 1px dashed var(--psb-border);
    border-radius: var(--psb-radius);
    background: transparent;
    color: var(--psb-text-light);
    font-size: 12px;
    cursor: pointer;
    transition: var(--psb-transition);
    width: 100%;
    margin-top: 8px;
}

.psb-add-module:hover {
    border-color: var(--psb-primary);
    color: var(--psb-primary);
    background: var(--psb-primary-light);
}

/* ==========================================================================
   Settings Panel (Right Sidebar)
   ========================================================================== */

.psb-settings {
    background: var(--psb-white);
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius-lg);
    overflow: visible;
    height: auto;
}

.psb-settings__tabs {
    display: flex;
    border-bottom: 1px solid var(--psb-border);
}

.psb-settings__tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--psb-text-light);
    cursor: pointer;
    transition: var(--psb-transition);
}

.psb-settings__tab:hover {
    background: var(--psb-bg);
}

.psb-settings__tab--active {
    color: var(--psb-primary);
    background: var(--psb-white);
    border-bottom: 2px solid var(--psb-primary);
    margin-bottom: -1px;
}

.psb-settings__content {
    padding: 15px;
}

.psb-settings__section {
    margin-bottom: 20px;
}

.psb-settings__section:last-child {
    margin-bottom: 0;
}

.psb-settings__section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--psb-text-light);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--psb-border);
}

/* ==========================================================================
   Form Fields
   ========================================================================== */

.psb-field {
    margin-bottom: 15px;
}

.psb-field:last-child {
    margin-bottom: 0;
}

.psb-field__label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--psb-text);
    margin-bottom: 5px;
}

.psb-field__input,
.psb-field__select,
.psb-field__textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius);
    font-size: 13px;
    transition: var(--psb-transition);
}

.psb-field__input:focus,
.psb-field__select:focus,
.psb-field__textarea:focus {
    border-color: var(--psb-primary);
    outline: none;
    box-shadow: 0 0 0 2px var(--psb-primary-light);
}

.psb-field__textarea {
    min-height: 80px;
    resize: vertical;
}

.psb-field__help {
    font-size: 11px;
    color: var(--psb-text-light);
    margin-top: 4px;
}

/* Color picker field */
.psb-field--color {
    display: flex;
    gap: 8px;
}

.psb-field--color .psb-field__input {
    flex: 1;
}

.psb-field__color-swatch {
    width: 36px;
    height: 36px;
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius);
    cursor: pointer;
}

/* Range slider field */
.psb-field__range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.psb-field__range input[type="range"] {
    flex: 1;
}

.psb-field__range-value {
    width: 50px;
    text-align: center;
    font-size: 12px;
    color: var(--psb-text-light);
}

/* Button group field */
.psb-field__button-group {
    display: flex;
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius);
    overflow: hidden;
}

.psb-field__button-group button {
    flex: 1;
    padding: 8px;
    border: none;
    background: var(--psb-white);
    font-size: 12px;
    cursor: pointer;
    transition: var(--psb-transition);
}

.psb-field__button-group button:not(:last-child) {
    border-right: 1px solid var(--psb-border);
}

.psb-field__button-group button:hover {
    background: var(--psb-bg);
}

.psb-field__button-group button.active {
    background: var(--psb-primary);
    color: var(--psb-white);
}

/* Image picker field */
.psb-field__image-picker {
    border: 2px dashed var(--psb-border);
    border-radius: var(--psb-radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--psb-transition);
}

.psb-field__image-picker:hover {
    border-color: var(--psb-primary);
    background: var(--psb-primary-light);
}

.psb-field__image-picker--has-image {
    padding: 5px;
    border-style: solid;
}

.psb-field__image-picker img {
    max-width: 100%;
    height: auto;
    display: block;
}

.psb-field__image-picker-placeholder {
    color: var(--psb-text-light);
    font-size: 13px;
}

.psb-field__image-picker-placeholder .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    display: block;
    margin: 0 auto 8px;
}

/* ==========================================================================
   Module Picker Modal
   ========================================================================== */

.psb-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: var(--psb-transition);
}

.psb-modal--visible {
    opacity: 1;
    visibility: visible;
}

.psb-modal__content {
    background: var(--psb-white);
    border-radius: var(--psb-radius-lg);
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--psb-shadow-hover);
    transform: translateY(-20px);
    transition: var(--psb-transition);
}

.psb-modal--visible .psb-modal__content {
    transform: translateY(0);
}

.psb-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--psb-border);
    background: var(--psb-bg);
}

.psb-modal__title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.psb-modal__close {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    color: var(--psb-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--psb-radius);
    transition: var(--psb-transition);
}

.psb-modal__close:hover {
    background: var(--psb-bg-dark);
    color: var(--psb-text);
}

.psb-modal__search {
    padding: 15px 20px;
    border-bottom: 1px solid var(--psb-border);
}

.psb-modal__search input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius);
    font-size: 14px;
}

.psb-modal__search input:focus {
    border-color: var(--psb-primary);
    outline: none;
}

.psb-modal__body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 150px);
}

/* Module grid in picker */
.psb-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.psb-module-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius);
    background: var(--psb-white);
    cursor: pointer;
    transition: var(--psb-transition);
}

.psb-module-card:hover {
    border-color: var(--psb-primary);
    background: var(--psb-primary-light);
    transform: translateY(-2px);
    box-shadow: var(--psb-shadow);
}

.psb-module-card__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    color: var(--psb-primary);
    font-size: 24px;
}

.psb-module-card__icon .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
}

.psb-module-card__name {
    font-size: 12px;
    font-weight: 500;
    color: var(--psb-text);
    text-align: center;
}

/* ==========================================================================
   Column Width Selector
   ========================================================================== */

.psb-width-selector {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--psb-white);
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius);
    box-shadow: var(--psb-shadow-hover);
    padding: 10px;
    z-index: 100;
    display: none;
}

.psb-width-selector--visible {
    display: block;
}

.psb-width-selector__options {
    display: flex;
    gap: 5px;
}

.psb-width-selector__option {
    padding: 6px 10px;
    border: 1px solid var(--psb-border);
    border-radius: 3px;
    background: var(--psb-white);
    font-size: 11px;
    cursor: pointer;
    transition: var(--psb-transition);
}

.psb-width-selector__option:hover,
.psb-width-selector__option--active {
    border-color: var(--psb-primary);
    background: var(--psb-primary);
    color: var(--psb-white);
}

/* ==========================================================================
   Live Preview Panel
   ========================================================================== */

.psb-preview {
    background: var(--psb-white);
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius-lg);
    overflow: hidden;
    margin-top: 20px;
}

.psb-preview__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--psb-bg);
    border-bottom: 1px solid var(--psb-border);
}

.psb-preview__title {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
}

.psb-preview__devices {
    display: flex;
    gap: 5px;
}

.psb-preview__device {
    width: 28px;
    height: 28px;
    border: 1px solid var(--psb-border);
    border-radius: 3px;
    background: var(--psb-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--psb-text-light);
    transition: var(--psb-transition);
}

.psb-preview__device:hover,
.psb-preview__device--active {
    border-color: var(--psb-primary);
    color: var(--psb-primary);
}

.psb-preview__frame {
    padding: 20px;
    min-height: 300px;
    transition: var(--psb-transition);
}

.psb-preview__frame--tablet {
    max-width: 768px;
    margin: 0 auto;
}

.psb-preview__frame--mobile {
    max-width: 375px;
    margin: 0 auto;
}

/* ==========================================================================
   Global Settings Panel
   ========================================================================== */

.psb-global {
    margin-bottom: 20px;
}

.psb-global__section {
    background: var(--psb-white);
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius);
    margin-bottom: 10px;
}

.psb-global__section:last-child {
    margin-bottom: 0;
}

.psb-global__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: var(--psb-transition);
}

.psb-global__header:hover {
    background: var(--psb-bg);
}

.psb-global__title {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.psb-global__toggle {
    font-size: 12px;
    color: var(--psb-text-light);
    transition: var(--psb-transition);
}

.psb-global__section--open .psb-global__toggle {
    transform: rotate(180deg);
}

.psb-global__body {
    padding: 15px;
    border-top: 1px solid var(--psb-border);
    display: none;
}

.psb-global__section--open .psb-global__body {
    display: block;
}

/* ==========================================================================
   Inline Module Settings Popover
   ========================================================================== */

.psb-popover {
    position: absolute;
    z-index: 1000;
    background: var(--psb-white);
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius-lg);
    box-shadow: var(--psb-shadow-hover);
    width: 300px;
    max-height: 400px;
    overflow: auto;
}

.psb-popover__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--psb-border);
    background: var(--psb-bg);
    position: sticky;
    top: 0;
}

.psb-popover__title {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
}

.psb-popover__close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--psb-text-light);
    padding: 0;
    font-size: 18px;
}

.psb-popover__body {
    padding: 15px;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.psb-hidden {
    display: none !important;
}

.psb-text-center {
    text-align: center;
}

.psb-text-left {
    text-align: left;
}

.psb-text-right {
    text-align: right;
}

.psb-mb-0 { margin-bottom: 0 !important; }
.psb-mb-10 { margin-bottom: 10px !important; }
.psb-mb-20 { margin-bottom: 20px !important; }

.psb-mt-0 { margin-top: 0 !important; }
.psb-mt-10 { margin-top: 10px !important; }
.psb-mt-20 { margin-top: 20px !important; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
    .psb-main {
        grid-template-columns: 1fr 280px;
    }
}

@media (max-width: 992px) {
    .psb-main {
        grid-template-columns: 1fr;
    }
    
    .psb-settings {
        order: -1;
    }
    
    .psb-live-preview__frame[data-device="desktop"],
    .psb-live-preview__frame[data-device="tablet"] {
        max-width: 100%;
    }
}

/* ==========================================================================
   Live Preview (Above Builder)
   ========================================================================== */

.psb-live-preview {
    background: var(--psb-white);
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius-lg);
    overflow: hidden;
    transition: var(--psb-transition);
}

.psb-live-preview--collapsed .psb-live-preview__frame {
    display: none;
}

.psb-live-preview__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    color: #fff;
}

.psb-live-preview__title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff !important;
}

.psb-live-preview__title .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #fff !important;
}

.psb-live-preview__controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.psb-live-preview__devices {
    display: flex;
    gap: 5px;
    background: rgba(255,255,255,0.1);
    padding: 4px;
    border-radius: 4px;
}

.psb-live-preview__device {
    width: 32px;
    height: 28px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.7);
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--psb-transition);
}

.psb-live-preview__device:hover {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

.psb-live-preview__device--active {
    color: #fff;
    background: rgba(255,255,255,0.2);
}

.psb-live-preview__toggle {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--psb-transition);
}

.psb-live-preview__toggle:hover {
    background: rgba(255,255,255,0.25);
}

.psb-live-preview__frame {
    padding: 15px;
    background: 
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    min-height: 200px;
    max-height: 400px;
    overflow: auto;
    transition: max-width 0.3s ease;
    margin: 0 auto;
}

.psb-live-preview__frame[data-device="desktop"] {
    max-width: 100%;
}

.psb-live-preview__frame[data-device="tablet"] {
    max-width: 768px;
}

.psb-live-preview__frame[data-device="mobile"] {
    max-width: 375px;
}

/* Iframe preview */
.psb-live-preview__iframe {
    width: 100%;
    min-height: 300px;
    max-height: 600px;
    border: none;
    display: block;
    background: repeating-conic-gradient(#e5e5e5 0% 25%, #fff 0% 50%) 50% / 20px 20px;
    border-radius: 0 0 8px 8px;
}

.psb-live-preview__iframe[data-device="tablet"] {
    max-width: 768px;
    margin: 0 auto;
}

.psb-live-preview__iframe[data-device="mobile"] {
    max-width: 375px;
    margin: 0 auto;
}

/* Fallback div preview content styling */
.psb-live-preview__frame .ps-promo {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.psb-live-preview__frame .ps-promo__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.psb-live-preview__frame .ps-promo__content {
    position: relative;
    z-index: 1;
}

.psb-live-preview__frame .ps-promo__row {
    display: flex;
    gap: 15px;
}

.psb-live-preview__frame .ps-promo__columns {
    display: flex;
}

/* ==========================================================================
   Spacing Controls
   ========================================================================== */

.psb-settings__section--spacing {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--psb-border);
}

.psb-spacing-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.psb-spacing-group {
    background: var(--psb-bg);
    padding: 12px;
    border-radius: var(--psb-radius);
}

.psb-spacing-group > .psb-field__label {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--psb-text-light);
}

.psb-spacing-inputs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.psb-spacing-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.psb-spacing-input input {
    width: 100%;
    text-align: center;
    padding: 6px 4px;
    font-size: 13px;
}

.psb-spacing-label {
    font-size: 10px;
    color: var(--psb-text-light);
    text-transform: uppercase;
}

.psb-field__input--small {
    max-width: 60px;
}

/* ==========================================================================
   Module Preview Backgrounds (for visibility)
   ========================================================================== */

.psb-module__preview {
    /* Solid background - color set dynamically via JS based on text color */
    background-color: #f0f0f0;
    min-height: 30px;
    padding: 10px;
    border-radius: 0 0 var(--psb-radius) var(--psb-radius);
}

/* Dark background variant for light text (white, yellow, etc.) */
.psb-module__preview.psb-module__preview--dark {
    background-color: #2d3748 !important;
}

/* Light background variant for dark text (black, dark gray, etc.) */
.psb-module__preview.psb-module__preview--light {
    background-color: #f7fafc !important;
}

/* Empty state styling */
.psb-module__preview--empty {
    color: #a0aec0;
    font-size: 12px;
    text-align: center;
    padding: 20px;
}

/* ==========================================================================
   Column Layout Picker
   ========================================================================== */

.psb-column-layout-picker {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.psb-column-layout-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius);
    background: var(--psb-white);
    cursor: pointer;
    transition: var(--psb-transition);
}

.psb-column-layout-option:hover {
    border-color: var(--psb-primary);
    background: rgba(0, 132, 61, 0.05);
}

.psb-column-layout-option.active {
    border-color: var(--psb-primary);
    background: rgba(0, 132, 61, 0.1);
}

.psb-column-layout-icon {
    margin-bottom: 6px;
}

.psb-column-layout-icon svg {
    display: block;
}

.psb-column-layout-label {
    font-size: 10px;
    color: var(--psb-text-light);
}

/* ==========================================================================
   Columns Module - Builder View
   ========================================================================== */

.psb-module--columns {
    border: 2px solid var(--psb-primary) !important;
    border-radius: var(--psb-radius-lg) !important;
    background: rgba(0, 132, 61, 0.02);
    overflow: hidden;
}

.psb-module--columns .psb-module__header {
    background: linear-gradient(135deg, #00843D 0%, #006830 100%);
    color: #fff;
    border-radius: 0;
    margin: 0;
}

.psb-module--columns .psb-module__header .psb-module__icon,
.psb-module--columns .psb-module__header .psb-module__type {
    color: #fff;
}

.psb-module--columns .psb-module__controls button {
    color: #fff;
}

.psb-columns__container {
    display: flex;
    padding: 12px;
    background: #f0fdf4;
    border-top: none;
    gap: 8px;
    flex-wrap: nowrap;
    overflow: hidden;
    box-sizing: border-box;
    justify-content: center;
}

.psb-inner-column {
    display: flex;
    flex-direction: column;
    min-height: 60px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: var(--psb-radius);
    transition: var(--psb-transition);
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.psb-inner-column:hover {
    border-color: var(--psb-primary);
    box-shadow: 0 0 0 1px var(--psb-primary);
}

.psb-inner-column__modules {
    flex: 1;
    padding: 6px;
    min-height: 50px;
    box-sizing: border-box;
    overflow: hidden;
}

.psb-inner-column__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 60px;
    color: #9ca3af;
    font-size: 10px;
    cursor: pointer;
    background: #fafafa;
    border-radius: calc(var(--psb-radius) - 1px);
    transition: var(--psb-transition);
    padding: 8px 4px;
    box-sizing: border-box;
    text-align: center;
}

.psb-inner-column__empty:hover {
    color: var(--psb-primary);
    background: rgba(0, 132, 61, 0.05);
}

.psb-inner-column__empty .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    margin-bottom: 4px;
}

/* Drag over state for inner columns */
.psb-inner-column__modules.sortable-ghost,
.psb-inner-column__modules:has(.sortable-ghost) {
    background: rgba(0, 132, 61, 0.1);
}

.psb-inner-add-module {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border: none;
    background: rgba(0, 132, 61, 0.08);
    color: var(--psb-primary);
    cursor: pointer;
    border-top: 1px solid #e5e7eb;
    transition: var(--psb-transition);
}

.psb-inner-add-module:hover {
    background: rgba(0, 132, 61, 0.1);
}

/* Inner modules */
.psb-inner-module {
    background: #fff;
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius);
    margin-bottom: 8px;
    transition: var(--psb-transition);
    overflow: hidden;
    max-width: 100%;
}

.psb-inner-module .psb-module__preview {
    overflow: hidden;
    max-width: 100%;
    padding: 6px;
    box-sizing: border-box;
}

.psb-inner-module .psb-btn-preview {
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px !important;
    padding: 4px 6px !important;
}

.psb-inner-module:last-child {
    margin-bottom: 0;
}

.psb-inner-module:hover {
    border-color: var(--psb-primary);
}

.psb-inner-module.psb-module--selected {
    border-color: var(--psb-primary);
    box-shadow: 0 0 0 2px rgba(0, 132, 61, 0.2);
}

.psb-inner-module .psb-module__header {
    padding: 4px 6px;
    font-size: 10px;
    cursor: grab;
    overflow: hidden;
}

.psb-inner-module .psb-module__type {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    font-size: 10px;
}

.psb-inner-module .psb-module__header:active {
    cursor: grabbing;
}

.psb-inner-module .psb-module__header--inner {
    background: #4a5568;
    color: #fff;
}

.psb-inner-module .psb-module__header--inner .psb-module__icon,
.psb-inner-module .psb-module__header--inner .psb-module__type {
    color: #fff !important;
}

.psb-inner-module .psb-module__header--inner .psb-inner-module__control {
    color: rgba(255, 255, 255, 0.7);
}

.psb-inner-module .psb-module__header--inner .psb-inner-module__control:hover {
    color: #fff;
}

.psb-inner-module .psb-module__icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.psb-inner-module .psb-module__icon .dashicons {
    font-size: 12px;
    color: #fff !important;
    width: 12px;
    height: 12px;
}

.psb-inner-module__control {
    padding: 1px 2px;
    border: none;
    background: transparent;
    color: var(--psb-text-light);
    cursor: pointer;
    opacity: 0;
    transition: var(--psb-transition);
}

.psb-inner-module__control .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

.psb-inner-module:hover .psb-inner-module__control {
    opacity: 1;
}

.psb-inner-module__control:hover {
    color: var(--psb-primary);
}

.psb-inner-module__control--drag {
    cursor: grab;
}

.psb-inner-module__control--drag:active {
    cursor: grabbing;
}

.psb-inner-module__control--delete:hover {
    color: #e53e3e;
}

/* Draggable headers */
.psb-drag-handle,
.psb-inner-drag-handle {
    cursor: grab;
}

.psb-drag-handle:active,
.psb-inner-drag-handle:active {
    cursor: grabbing;
}

/* Module header styles */
.psb-module__header {
    cursor: grab;
}

.psb-module__header:active {
    cursor: grabbing;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes psb-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 132, 61, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 132, 61, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 132, 61, 0); }
}

.psb-pulse {
    animation: psb-pulse 1s ease-out;
}

@keyframes psb-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.psb-shake {
    animation: psb-shake 0.3s ease-in-out;
}

/* ==========================================================================
   Icon Picker
   ========================================================================== */

.psb-icon-picker {
    display: flex;
    align-items: center;
    gap: 8px;
}

.psb-icon-picker__button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius);
    cursor: pointer;
    transition: var(--psb-transition);
    flex: 1;
    text-align: left;
}

.psb-icon-picker__button:hover {
    border-color: var(--psb-primary);
}

.psb-icon-picker__button i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    color: var(--psb-text);
}

.psb-icon-picker__none {
    font-size: 14px;
    color: #999;
    width: 24px;
    text-align: center;
}

.psb-icon-picker__label {
    flex: 1;
    font-size: 13px;
    color: var(--psb-text);
}

.psb-icon-picker__arrow {
    font-size: 10px;
    color: #999;
}

.psb-icon-picker__clear {
    padding: 4px 8px;
    background: #f5f5f5;
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius);
    cursor: pointer;
    font-size: 14px;
    color: #666;
    line-height: 1;
}

.psb-icon-picker__clear:hover {
    background: #fee;
    border-color: #e53e3e;
    color: #e53e3e;
}

/* Icon Modal */
.psb-icon-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.psb-icon-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.psb-icon-modal__content {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    background: #fff;
    border-radius: var(--psb-radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.psb-icon-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--psb-border);
    background: #f7f7f7;
}

.psb-icon-modal__header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.psb-icon-modal__close {
    padding: 4px 8px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.psb-icon-modal__close:hover {
    color: #e53e3e;
}

.psb-icon-modal__search {
    padding: 12px 20px;
    border-bottom: 1px solid var(--psb-border);
}

.psb-icon-modal__search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius);
    font-size: 14px;
}

.psb-icon-modal__search-input:focus {
    outline: none;
    border-color: var(--psb-primary);
    box-shadow: 0 0 0 3px rgba(0, 132, 61, 0.1);
}

.psb-icon-modal__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--psb-border);
    background: #fafafa;
}

.psb-icon-modal__cat {
    padding: 5px 12px;
    background: #fff;
    border: 1px solid var(--psb-border);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--psb-transition);
}

.psb-icon-modal__cat:hover {
    border-color: var(--psb-primary);
    color: var(--psb-primary);
}

.psb-icon-modal__cat.active {
    background: var(--psb-primary);
    border-color: var(--psb-primary);
    color: #fff;
}

.psb-icon-modal__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    padding: 20px;
    overflow-y: auto;
    max-height: 400px;
}

.psb-icon-modal__icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    background: #f7f7f7;
    border: 2px solid transparent;
    border-radius: var(--psb-radius);
    cursor: pointer;
    transition: var(--psb-transition);
}

.psb-icon-modal__icon:hover {
    background: var(--psb-primary-light);
    border-color: var(--psb-primary);
}

.psb-icon-modal__icon i {
    font-size: 22px;
    color: var(--psb-text);
}

.psb-icon-modal__icon:hover i {
    color: var(--psb-primary);
}

.psb-icon-modal__icon-label {
    font-size: 10px;
    color: #666;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.psb-icon-modal__icon--none {
    background: #fff;
    border: 1px dashed #ccc;
}

.psb-icon-modal__icon--none:hover {
    background: #fee;
    border-color: #e53e3e;
    border-style: solid;
}

.psb-icon-modal__icon-none {
    font-size: 18px;
    color: #999;
}

.psb-icon-modal__icon--none:hover .psb-icon-modal__icon-none {
    color: #e53e3e;
}

/* ==========================================================================
   Module Override Indicators
   ========================================================================== */

/* Overridden module styling */
.psb-module--overridden {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.03);
}

.psb-module--overridden .psb-module__header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}

.psb-module--overridden .psb-module__header .psb-module__icon,
.psb-module--overridden .psb-module__header .psb-module__type {
    color: #fff;
}

.psb-module--overridden .psb-module__controls button {
    color: #fff;
}

/* Local-only module styling */
.psb-module--local-only {
    border-color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.03);
}

.psb-module--local-only .psb-module__header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
}

.psb-module--local-only .psb-module__header .psb-module__icon,
.psb-module--local-only .psb-module__header .psb-module__type {
    color: #fff;
}

.psb-module--local-only .psb-module__controls button {
    color: #fff;
}

/* Override badge in header */
.psb-module__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
    margin-right: 8px;
}

.psb-module__badge .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

.psb-module__badge--overridden {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.psb-module__badge--local {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Override banner in settings panel */
.psb-override-banner {
    padding: 12px 15px;
    border-radius: var(--psb-radius);
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.psb-override-banner__info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    line-height: 1.4;
}

.psb-override-banner__info .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.psb-override-banner--overridden {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(185, 28, 28, 0.15) 100%);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #991b1b;
}

.psb-override-banner--local {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #1e40af;
}

/* Reset to parent button */
.psb-reset-to-parent {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px !important;
    background: #fff !important;
    border: 1px solid #dc2626 !important;
    color: #991b1b !important;
    font-size: 12px !important;
    border-radius: var(--psb-radius) !important;
    cursor: pointer;
    transition: var(--psb-transition);
    align-self: flex-start;
}

.psb-reset-to-parent:hover {
    background: #fef2f2 !important;
    border-color: #b91c1c !important;
}

.psb-reset-to-parent .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    line-height: 14px;
    vertical-align: middle;
    margin-top: -1px;
}

/* Override fields list */
.psb-override-banner__fields {
    font-size: 11px;
    color: #7f1d1d;
    background: rgba(239, 68, 68, 0.1);
    padding: 6px 10px;
    border-radius: var(--psb-radius);
    margin-top: -5px;
}

.psb-override-banner__fields strong {
    font-weight: 600;
}

/* Inner module overrides */
.psb-inner-module.psb-module--overridden {
    border-color: #ef4444 !important;
}

.psb-inner-module.psb-module--overridden .psb-module__header--inner {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.psb-inner-module.psb-module--local-only {
    border-color: #3b82f6 !important;
}

.psb-inner-module.psb-module--local-only .psb-module__header--inner {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}


/* ==========================================================================
   Wrapper Modules
   ========================================================================== */

.psb-module--wrapper {
    border: 2px solid #8b5cf6;
    background: rgba(139, 92, 246, 0.02);
    border-radius: var(--psb-radius-lg);
}

.psb-module__header--wrapper {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.psb-module__header--wrapper .psb-module__icon,
.psb-module__header--wrapper .psb-module__type {
    color: white;
}

.psb-module__header--wrapper .psb-module__controls button {
    color: rgba(255,255,255,0.8);
}

.psb-module__header--wrapper .psb-module__controls button:hover {
    color: white;
}

.psb-wrapper__container {
    padding: 15px;
    min-height: 60px;
    border-radius: 0 0 var(--psb-radius-lg) var(--psb-radius-lg);
}

.psb-wrapper__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
    border: 2px dashed rgba(139, 92, 246, 0.3);
    border-radius: var(--psb-radius);
    cursor: pointer;
    transition: var(--psb-transition);
    flex: 1;
}

.psb-wrapper__empty:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: #8b5cf6;
}

.psb-wrapper__empty .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-bottom: 8px;
}

.psb-wrapper-add-module {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px dashed #8b5cf6;
    border-radius: var(--psb-radius);
    color: #8b5cf6;
    font-size: 12px;
    cursor: pointer;
    transition: var(--psb-transition);
}

.psb-wrapper-add-module:hover {
    background: rgba(139, 92, 246, 0.2);
}

.psb-wrapper-module {
    margin: 8px 0;
}

/* ==========================================================================
   Button Group (alignment buttons)
   ========================================================================== */

.psb-button-group {
    display: flex;
    gap: 2px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: var(--psb-radius);
}

.psb-button-group__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--psb-radius);
    cursor: pointer;
    transition: var(--psb-transition);
    color: #6b7280;
}

.psb-button-group__btn:hover {
    background: white;
    border-color: #d1d5db;
    color: #374151;
}

.psb-button-group__btn.active {
    background: white;
    border-color: var(--psb-primary);
    color: var(--psb-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.psb-button-group__btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   Toggle Switch
   ========================================================================== */

.psb-field__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.psb-field__toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.psb-field__toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    transition: var(--psb-transition);
    flex-shrink: 0;
}

.psb-field__toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: var(--psb-transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.psb-field__toggle input:checked + .psb-field__toggle-slider {
    background: var(--psb-primary);
}

.psb-field__toggle input:checked + .psb-field__toggle-slider::after {
    transform: translateX(20px);
}

.psb-field__toggle-label {
    font-size: 13px;
    color: var(--psb-text);
}

/* ==========================================================================
   Field with Unit Selector
   ========================================================================== */

.psb-field__with-unit {
    display: flex;
    gap: 8px;
    align-items: center;
}

.psb-field__unit-select {
    width: 70px !important;
    flex-shrink: 0;
}

/* ==========================================================================
   Spacing Group Header
   ========================================================================== */

.psb-spacing-group__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.psb-spacing-group__header .psb-field__label {
    margin-bottom: 0;
}

.psb-spacing-group__header .psb-field__unit-select {
    width: 60px !important;
    padding: 4px 6px;
    font-size: 12px;
}

/* ==========================================================================
   Box Shadow Settings
   ========================================================================== */

.psb-shadow-settings {
    padding-top: 10px;
}

.psb-field-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.psb-field--half {
    flex: 1;
}

.psb-field--half .psb-field__label {
    font-size: 12px;
}

.psb-field--half .psb-field__input {
    padding: 6px 8px;
}
