@use "variables" as *;

.ekesto-settings-panel {
    background: white;
    border: 1px solid $color-border;

    &__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: $spacing-lg;
        border-bottom: 1px solid $color-border;
        position: relative;

        &--collapsible {
            cursor: pointer;
            user-select: none;
            border-bottom: none;

            &:hover {
                background-color: $color-surface-muted;
            }
        }

        &--open {
            cursor: pointer;
            user-select: none;
            border-bottom: 1px solid $color-border;

            &:hover {
                background-color: $color-surface-muted;
            }
        }
    }

    &__header-main {
        display: inline-flex;
        align-items: center;
        gap: $spacing-xs;
        min-width: 0;
        flex: 1 1 auto;
    }

    &__header-title {
        font-weight: 500;
        font-size: $font-size-heading;
        margin: 0;
        min-width: 0;
    }

    &__header-help {
        position: relative;
        z-index: $z-index-help-button;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 25px;
        height: 25px;
        min-width: 25px;
        color: var(--wp-admin-theme-color, #2271b1);
        text-decoration: none;
        border-radius: 999px;
        flex: 0 0 auto;

        .dashicons {
            width: 18px;
            height: 18px;
            font-size: 18px;
            line-height: 1;
        }

        &:hover {
            color: $gray-700;
            background: #f0f0f0;
        }

        &:focus,
        &:focus-visible {
            box-shadow: none;
            outline: 2px solid var(--wp-admin-theme-color, #2271b1);
            outline-offset: 2px;
        }
    }

    &__header-icon {
        flex-shrink: 0;
        margin-left: $spacing-md;
        color: $color-icon-dark;
        width: 18px !important;
        height: 18px !important;
    }

    &__body {
        display: flex;
        flex-direction: column;
        gap: $spacing-lg;
        padding: $spacing-lg;

        &--2-columns,
        &--3-columns,
        &--4-columns {
            flex-direction: row;
            flex-wrap: wrap;
        }

        &--2-columns > * {
            flex: 0 0 calc((100% - #{$spacing-lg}) / 2);
        }

        &--3-columns > * {
            flex: 0 0 calc((100% - (#{$spacing-lg} * 2)) / 3);
        }

        &--4-columns > * {
            flex: 0 0 calc((100% - (#{$spacing-lg} * 3)) / 4);
        }

        @media screen and (max-width: $breakpoint-mobile-max) {
            flex-direction: column;

            > * {
                flex: 0 0 100%;
            }
        }
    }
}

.ekesto-settings-subpanels {
    display: flex;
    flex-direction: column;
    gap: $spacing-lg;
}

.ekesto-settings-subpanel {
    display: flex;
    flex-direction: column;
    gap: $spacing-xl;
    padding: $spacing-md;
    border: 1px solid $color-border;
    background: #fff;

    .settings-inner-container {
        margin-bottom: 0;
    }
}

.ekesto-settings-subpanel__title {
    margin: 0;
    font-size: $font-size-body;
    font-weight: 600;
    line-height: 1.4;
    + .settings-inner-container {
        // margin-top: $spacing-xl;
    }
}
