/**
 * Qvio Floating Button - Editor Styles
 *
 * Styles specific to the block editor.
 *
 * @package Qvio_WP
 */

// Editor wrapper
.qvio-floating-button-editor {
    min-height: 100px;

    // Preview container
    &__preview {
        position: relative;
        padding: 24px;
        background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 16px;
        min-height: 150px;
    }

    // Info bar
    &__info {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 16px;
        background: #fff;
        border-radius: 4px;
        font-size: 13px;
        color: #1e1e1e;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);

        .dashicons {
            color: #0073aa;
        }
    }

    &__position {
        padding-left: 8px;
        border-left: 1px solid #ddd;
        color: #757575;
        text-transform: capitalize;
    }
}

// Icon picker styles
.qvio-icon-picker {
    margin-bottom: 16px;

    &__label {
        font-size: 11px;
        font-weight: 500;
        line-height: 1.4;
        text-transform: uppercase;
        margin-bottom: 8px;
        color: #1e1e1e;
    }

    &__trigger {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        background: #fff;
        border: 1px solid #949494;
        border-radius: 2px;
        cursor: pointer;
        width: 100%;
        justify-content: flex-start;

        &:hover {
            border-color: #0073aa;
        }

        &:focus {
            border-color: #0073aa;
            box-shadow: 0 0 0 1px #0073aa;
            outline: none;
        }

        .dashicons {
            font-size: 20px;
            width: 20px;
            height: 20px;
            color: #1e1e1e;
        }
    }

    &__trigger-text {
        font-size: 13px;
        color: #757575;
    }

    &__custom-image {
        width: 20px;
        height: 20px;
        object-fit: contain;
        border-radius: 2px;
    }

    &__dropdown-content {
        padding: 0;
        width: 240px;
    }

    &__tabs {
        .components-tab-panel__tabs {
            display: flex;
            border-bottom: 1px solid #ddd;
            margin: 0;
            padding: 0;
        }

        .components-tab-panel__tabs-item {
            flex: 1;
            padding: 10px 12px;
            font-size: 12px;
            font-weight: 500;
            background: transparent;
            border: none;
            border-bottom: 2px solid transparent;
            cursor: pointer;
            color: #757575;
            margin: 0;

            &:hover {
                color: #1e1e1e;
            }

            &.is-active {
                color: #0073aa;
                border-bottom-color: #0073aa;
            }
        }
    }

    &__tab-content {
        padding: 12px;
    }

    &__grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
        width: 200px;
    }

    &__option {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        background: transparent;
        border: 2px solid transparent;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.15s ease;

        &:hover {
            background: #f0f0f0;
        }

        &--selected {
            background: #e7f3ff;
            border-color: #0073aa;
        }

        .dashicons {
            font-size: 24px;
            width: 24px;
            height: 24px;
            color: #1e1e1e;
        }
    }

    &__upload {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    &__upload-placeholder {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 16px;
        width: 100%;
        box-sizing: border-box;
    }

    &__upload-button {
        display: flex;
        align-items: center;
        gap: 6px;

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

    &__upload-help {
        font-size: 11px;
        color: #757575;
        margin: 0;
        text-align: center;
    }

    &__upload-preview {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    &__preview-image {
        width: 64px;
        height: 64px;
        object-fit: contain;
        border: 1px solid #ddd;
        border-radius: 4px;
        padding: 8px;
        background: #f9f9f9;
    }

    &__upload-actions {
        display: flex;
        gap: 8px;
    }
}

// Color picker adjustments
.components-base-control {
    .components-color-picker {
        width: 100%;
    }
}

// Placeholder styling
.wp-block-qvio-floating-button {
    .components-placeholder {
        min-height: 150px;

        .components-placeholder__label {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .components-text-control {
            max-width: 400px;
        }
    }
}
