/* ============================================================================
   06-COMPONENTS -> #WYSIWYG
   ========================================================================= */

/**
 * An interface for editing rich text content (i.e. with formatting).
 */


//
// SCSS imports
//

@use '../01-settings' as *;
@use '../02-tools' as *;



/**
 * WYSIWYG toolbar
 */

.wysiwyg__toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    min-height: var(--form-input-height);
    overflow: hidden;
    zoom: 1;
}


/**
 * WYSIWYG icon
 */

.wysiwyg__icon {
    background-color: var(--bg-secondary);
    border-radius: var(--rounded-sm);
    cursor: pointer;
    height: var(--space-8);
    overflow: hidden;
    width: var(--space-8);
    zoom: 1;
}


/**
 * WYSIWYG overlay
 */

.wysiwyg__overlay {
    @include font-size('sm');
    background-color: var(--bg-secondary);
    border: (--border-width) solid var(--border-color-secondary);
    border-radius: var(--rounded-sm);
    box-shadow: var(--shadow-lg);
    color: var(--text-color-secondary);
    padding: var(--space-4);
    text-align: left;

    &[data-type=tooltip] {
        @include font-size('xs');
        padding: var(--space-2);
    }
}


/**
 * WYSIWYG overlay close
 */

.wysiwyg__overlay-close {
    background-size: cover;
    cursor: pointer;
    height: var(--space-4);
    position: absolute;
    right: var(--space-2);
    top: var(--space-2);
    width: var(--space-4);
}


/**
 * WYSIWYG form group
 */

.wysiwyg__form-group {
    align-items: center;
    display: flex;
    flex-direction: row;
    margin-bottom: var(--space-3);
}


/**
 * WYSIWYG label
 */

.wysiwyg__label {
    @include font-size('xs');
    color: var(--gray-700);
    font-weight: var(--font-weight-medium);
    margin-right: var(--space-2);
    min-width: var(--space-12);
}


/**
 * WYSIWYG input
 */

.wysiwyg__input {
    @include font-size('xs');
    border: var(--border-width) solid var(--border-color-secondary);
    border-radius: var(--rounded-xs);
    color: var(--gray-700);
    font-weight: var(--font-weight-medium);
    height: var(--space-6);
    padding-left: var(--space-2);
    padding-right: var(--space-2);
    width: 100%;

    &:focus {
        border-color: var(--color-primary-300);
        box-shadow: 0 0 0 var(--focus-ring-width) var(--color-primary-100);
        outline: 0;
    }
}


/**
 * WYSIWYG button
 */

.wysiwyg__button {
    @include font-size('xs');
    @include transition(('background-color'));
    align-items: center;
    appearance: none;
    background-color: var(--color-primary-600);
    border: 0;
    border-radius: var(--rounded-xs);
    color: var(--color-white);
    cursor: pointer;
    display: inline-flex;
    font-weight: var(--font-weight-semi-bold);
    height: var(--space-8);
    padding-left: var(--space-3);
    padding-right: var(--space-3);

    &:hover {
        background-color: var(--color-primary-700);
    }
}


/**
 * WYSIWYG textarea
 */

.wysiwyg__textarea {
    @include form-input-focus;
    @include transition(('border-color', 'box-shadow'), var(--duration-sm));
    appearance: none;
    background-color: var(--input-bg);
    border: var(--form-input-border-width) solid var(--form-input-border-color);
    border-radius: var(--form-input-border-radius);
    box-shadow: var(--shadow-xs);
    display: block;
    min-height: var(--space-48);
    padding: var(--space-2) var(--space-3);

    & > * + * {
        margin-top: var(--space-4);
    }

    & > :first-child {
        margin-top: 0;
    }

    &[data-selected=true] {
        
    }
}

.nicEdit-selectTxt {
    align-items: center;
    display: flex;
}