@use '../../../components/multipleSelect/editor.scss';

.sp-eap-settings-page-container {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    padding: 0 50px;
    position: relative;

    ul,
    li {
        margin: 0;
        padding: 0;
    }

    .sp-eap-setting-tabs-wrapper {
        z-index: 10;
        width: 248px;
        height: 100%;
        background: #ffffff;
        border: 1px solid #DDDDDD;
        border-radius: 12px;
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .sp-eap-setting-tabs {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .sp-eap-setting-tab {
        padding: 10px 20px 10px 8px;
        font-size: 14px;
        line-height: 20px;
        border-radius: 6px;
        font-weight: 500;
        z-index: 10;
        color: #1e1e1e;
        position: relative;
        background: transparent;
        border: 1px solid transparent;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 6px;

        .sp-eap-setting-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 16px;
            height: 16px;

            svg {
                width: 16px;
                height: 16px;
            }

            path {
                stroke: #1e1e1e;
            }
        }

        &:hover {
            background: #f5f5f5;
        }

        &.active {
            background: #ffffff;
            color: #f26c0d;
            border: 1px solid #f26c0d;

            .sp-eap-setting-icon path {
                stroke: #f26c0d;
            }
        }
    }

    .sp-eap-setting-tabs-bottom {
        display: none;
    }

    // tabs content.
    .sp-eap-setting-tab-content {
        flex: 1;
        padding: 32px;
        background: #ffffff;
        border: 1px solid #DDDDDD;
        border-radius: 12px;
        min-width: 0;
    }
}

// save and reset button wrapper.
.sp-eap-settings-save-wrapper {
    margin-top: 30px;

    button {
        border-radius: 4px;
        color: #fff;
        font-size: 16px;
        font-weight: 600;
        padding: 10px 24px;
        transition: all .3s ease-in-out;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .sp-eap-settings-save-btn {
        background-color: #c5c5c6;
        border: none;

        &.active {
            background-color: #3b9752;
        }
    }

    .sp-eap-settings-reset-btn {
        background-color: #cd3c3c;
        border: 1px solid #cd3c3c;
        color: #fff;
    }
}

// License key manage tab styles.
.sp-eap-dashboard-license-settings {
    height: 100%;
    padding: 83px 0;

    .sp-eap-license-tab-section-title {
        font-size: 22px;
        font-weight: 600;
        line-height: 28px;
        margin: 0 0 24px;
    }

    .sp-eap-help-text {
        color: #757575;
        font-size: 16px;
        font-weight: 400;
        line-height: 28px;
        margin-top: -16px;

        a {
            text-decoration: underline;
        }
    }

    // input control.
    .sp-eab-input-control {
        width: 380px;

        .components-input-control__input {
            height: 42px !important;
        }

        .sp-eab-input-control-header-left {
            display: none;
        }

        .components-base-control {
            flex: 1;
            max-width: 460px;
            position: relative;
        }

        .key-icon {
            left: 10px;
            position: absolute;
            top: 14px;
        }

        .components-input-control__input {
            padding-left: 38px !important;
        }
    }

    .components-input-control__backdrop {
        border: 1px solid #ddd !important;
        border-radius: 6px !important;
    }

    .components-base-control__help {
        margin: 0;
        padding: 0;
    }

    .sp-eap-settings-option {
        margin-top: 24px;
        gap: 8px;
    }

    .sp-eap-license-action-btn {
        font-size: 14px;
        line-height: 20px;
        padding: 0 18px;
        border-radius: 4px;
        border: none;
        outline: none;
        height: 42px;

        &.deactivate {
            width: 106px;
            color: rgb(220, 53, 69);
            background-color: rgb(246, 247, 247);
            border: 1px solid rgb(220, 53, 69);

            .components-spinner {
                color: rgb(220, 53, 69);
            }
        }

        &.active {
            width: 88px;
            color: #FFFFFF;
            background-color: var(--eab-wp-primary-color);
        }
    }

    .sp-eap-settings-option.license-active {
        input {
            pointer-events: none;
            color: #757575 !important;
        }
    }

    .active-status {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        right: 7px;
        padding: 4px 10px;
        border-radius: 3px;
        line-height: 20px;
        color: #fff;
        background-color: #28a745;
    }

    .sp-eap-api-integration-notice {
        background-color: #fff3cd;
        color: #856404;
        font-size: 14px;
        padding: 12px 20px;
        margin-top: 12px;
        border-radius: 2px;
        max-width: 476px;
        width: 100%;
    }
}

// advanced controls tab styles.
.sp-eap-dashboard-advanced-settings {
    width: 100%;
    gap: 20px;

    .sp-eap-settings-option {
        padding-bottom: 20px;
        border-bottom: 1px solid #f0f0f0;
        gap: 32px;

        &:last-child {
            border-bottom: none;
        }
    }

    .sp-eap-option-label-wrapper {
        gap: 4px;
        width: 50%;
    }

    .sp-eap-component-title {
        font-size: 14px;
        font-weight: 600;
        color: #2f2f2f;
        line-height: 20px;
    }

    .sp-eap-option-help-text {
        font-size: 13px;
        font-weight: 400;
        color: #757575;
        line-height: 20px;
    }
}

// woocommerce settings tab css.
.sp-eap-setting-tab-content {
    .sp-eab-dashboard-woo-notice {
        font-size: 12px;
        padding: 17px 30px;
        margin: -32px -32px 15px -32px;

        &.woo-activate {
            color: #8a6d3b;
            border-color: #faebcc;
            background-color: #fcf8e3;
        }

        &.woo-inactive {
            color: #1e1e1e;
            background-color: #ffd9d9;
        }

        i.dashicons {
            color: #807f7f;
        }

        a {
            text-decoration: underline;
        }
    }

    // pointer events off if woocommerce is deactivated.
    .eap-woo-inactive {
        .react-toggle {
            pointer-events: none;
        }
    }
}

// woo tabs.
.eap-woocommerce-settings-tab {
    .sp-eap-component-title {
        width: 270px;
    }

    .sp-eap-settings-option {
        gap: 50px;
        justify-content: space-between;
    }

    // .sp-eap-woo-faq-tab-items,
    .sp-eab-input-control {
        width: 45%;
    }

    .sp-eap-woo-faq-tab-items {
        width: 600px;
    }

    .sp-eap-woo-faq-tab-items {
        div[data-rfd-droppable-id='sp-eap-woo-faq-tab-dnd'] {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
    }

    .sp-eap-woo-faq-tab-item {
        border: 1px solid #FECDBF;
        border-radius: 4px;
        box-shadow: 0px 3px 6px 0px #00000014;
        cursor: move;
    }

    .sp-eap-woo-faq-tab-header {
        background-color: #FAE9E8;
        border-top-left-radius: 4px;
        border-top-right-radius: 4px;

        .sp-eap-woo-faq-tab-label,
        .sp-eap-cloneable-helper {
            padding: 14px 20px;
        }

        .sp-eap-woo-faq-tab-label {
            width: 90%;
        }
    }

    .sp-eap-woo-faq-tab-content {
        padding: 24px;
        background-color: #fff;
        border-bottom-left-radius: 4px;
        border-bottom-right-radius: 4px;
    }

    .sp-eap-woo-faq-tab-label {
        font-weight: 600;
        font-size: 13px;
        line-height: 1.3;
    }

    // multi select css.
    .sp-multiple-select-dnd-label {
        display: none;
    }

    select,
    .shaped-plugin-multiple-select {
        width: 50%;
    }

    // new item inserter css.
    .sp-eap-woo-faq-tab-inserter-button {
        color: #fff;
        background-color: var(--eab-link-color);
        transition: all 0.4s ease-in-out;
        padding: 12px 20px;
        font-weight: 600;
        font-size: 16px;
        line-height: 1.3;
        border: none;
        border-radius: 4px;

        &:hover {
            background: #1b63d2;
        }
    }

    &:has(.sp-eap-woo-faq-tab-item) {
        .sp-eap-woo-faq-tab-inserter-button {
            margin-top: 24px;
        }
    }
}

// custom css and js styles.
.sp-eap-settings-custom-assets {
    gap: 24px;

    .sp-eab-code-editor-component {
        display: flex;
        justify-content: space-between;
    }

    .sp-eab-code-editor {
        width: 60%;
    }
}

// Info text style.
.sp-eap-settings-info {
    display: flex;
    cursor: help;
    position: relative;

    img {
        height: 14px;
        width: 14px;
    }

    &:hover {
        .sp-eap-settings-info-text {
            display: block;
        }
    }

    .sp-eap-settings-info-text {
        display: none;
        position: absolute;
        background: rgb(22 30 38);
        color: rgb(127 159 175);
        width: 290px;
        padding: 14px 20px;
        font-weight: normal;
        border-radius: 5px;
        z-index: 10;
        left: 22px;
        top: 0;
        box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
    }
}
// Tools Tab Styles
.sp-eap-settings-tools-controls {
	display: flex;
	flex-direction: column;
	gap: 36px;
	width: 100%;

	.sp-eap-settings-tools-section {
		display: flex;
		gap: 32px;
		width: 100%;

		.sp-eap-settings-tools-section-header {
			width: 280px;
			flex-shrink: 0;

			.sp-eap-settings-tools-section-title {
				color: #2F2F2F;
				font-size: 14px;
				font-weight: 500;
				line-height: 1.6;
				margin: 0;
			}
		}

		.sp-eap-settings-tools-section-content {
			flex: 1;
			display: flex;
			flex-direction: column;
			gap: 24px;
			justify-content: center;

			.sp-eap-settings-tools-subtitle {
				color: #2F2F2F;
				font-size: 13px;
				font-weight: 500;
				line-height: 20px;
				margin: 0;
				white-space: nowrap;
			}

			.sp-eap-settings-tools-radio-group {
				display: flex;
				flex-direction: column;
				gap: 10px;

				.sp-eap-settings-tools-radio {
					display: flex;
					align-items: center;
					gap: 8px;
					cursor: pointer;

					input[type="radio"] {
						display: none;
					}

					.sp-eap-settings-tools-radio-label {
						color: #2F2F2F;
						font-size: 13px;
						line-height: 20px;
						position: relative;
						padding-left: 24px;

						&::before {
							content: '';
							position: absolute;
							left: 0;
							top: 50%;
							transform: translateY(-50%);
							width: 16px;
							height: 16px;
							border-radius: 10px;
							background: #FFFFFF;
							border: 1px solid #949494;
						}

						&::after {
							content: '';
							position: absolute;
							left: 5px;
							top: 50%;
							transform: translateY(-50%);
							width: 8px;
							height: 8px;
							border-radius: 50%;
							background: #FFFFFF;
							opacity: 0;
							transition: opacity 0.2s ease;
						}
					}

					&.active {
						.sp-eap-settings-tools-radio-label {
							&::before {
								background: #1A74E4;
								border-color: #1A74E4;
							}

							&::after {
								opacity: 1;
							}
						}
					}
				}
			}

			.sp-eap-settings-tools-file-input {
				display: flex;
				align-items: center;
				gap: 12px;

				.sp-eap-settings-tools-file-btn {
					background: #F0F0F0;
					border: 1px solid #2F2F2F;
					border-radius: 4px;
					padding: 10px 16px;
					color: #2F2F2F;
					font-size: 13px;
					font-weight: 500;
					line-height: 13px;
					cursor: pointer;
					display: inline-block;
				}

				.sp-eap-settings-tools-file-name {
					color: #757575;
					font-size: 13px;
					line-height: 20px;
				}
			}

			.sp-eap-settings-tools-checkbox {
				display: flex;
				align-items: center;
				gap: 8px;
				cursor: pointer;

				input[type="checkbox"] {
					width: 16px;
					height: 16px;
					cursor: pointer;
                    margin: 0;
				}

				.sp-eap-settings-tools-checkbox-label {
					color: #2F2F2F;
					font-size: 13px;
					font-weight: 500;
					line-height: 20px;
				}
			}

			.sp-eap-settings-tools-checkbox-help {
				color: #757575;
				font-size: 12px;
				line-height: 18px;
				margin: 0;
			}

			.sp-eap-settings-tools-btn {
				padding: 10px 16px;
				border-radius: 4px;
				border: none;
				color: #FFFFFF;
				font-size: 14px;
				font-weight: 600;
				line-height: 20px;
				text-transform: capitalize;
				cursor: pointer;
				white-space: nowrap;
				width: 150px;

				&.sp-eap-settings-tools-btn-primary {
					background: #1A74E4;
					border-color: #1A74E4;

					&:hover {
						background: #155DB7;
						border-color: #155DB7;
					}
				}

				&.sp-eap-settings-tools-btn-secondary {
					background: #BBBBBB;

					&:hover {
						background: #A8A8A8;
					}

					&.has-file {
						background: #1A74E4;

						&:hover {
							background: #155DB7;
						}
					}
				}
			}
		}
	}

	.sp-eap-settings-tools-divider {
		height: 1px;
		background: #F0F0F0;
		width: 100%;
	}
}

/* Multi-select dropdown */
.sp-eap-settings-tools-multiselect {
	margin-top: 12px;
}

/* React Select Multi-Select Styles */
.sp-eap-settings-tools-multiselect {
	margin-top: 12px;
	min-width: 260px;

	.sp-eap-tools-multi-select {
		.sp-eap-tools__control {
			min-height: 38px;
			border: 1px solid #ddd;
			border-radius: 4px;

			&:hover {
				border-color: #ddd;
			}
		}

		.sp-eap-tools__value-container {
			padding: 2px 8px;
		}

		.sp-eap-tools__multi-value {
			background-color: #1A74E4;
			border-radius: 4px;
			margin: 2px;
			display: flex;
			align-items: center;

			.sp-eap-tools__multi-value__label {
				color: #fff;
				font-size: 13px;
			}

			.sp-eap-tools__multi-value__remove {
				background: transparent;
				border: none;
				color: #fff;
				cursor: pointer;

				&:hover {
					background: transparent;
					color: #fff;
				}
			}
		}

		.sp-eap-tools__placeholder {
			color: #757575;
			font-size: 13px;
		}

		.sp-eap-tools__single-value,
		.sp-eap-tools__input {
			font-size: 13px;
			color: #2f2f2f;
            border: none;
            box-shadow: none;
            outline: none;
            min-height: 26px;
		}

		.sp-eap-tools__menu {
			border: 1px solid #ddd;
			border-radius: 4px;
			box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
			margin-top: 4px;

			.sp-eap-tools__menu-list {
				padding: 4px 0;

				.sp-eap-tools__option {
					padding: 8px 12px;
					font-size: 13px;
					cursor: pointer;

					&:hover {
						background-color: #f0f0f0;
					}

					&.sp-eap-tools__option--is-selected {
						background-color: #F26C0D;
						color: #fff;
					}

					&.sp-eap-tools__option--is-focused {
						background-color: #e0e0e0;
					}
				}
			}
		}

		.sp-eap-tools__indicator-separator {
			display: none;
		}

		.sp-eap-tools__dropdown-indicator,
		.sp-eap-tools__clear-indicator {
			padding: 4px;
		}

        .sp-eap-tools__input-container::after {
            display: none;
        }
	}
}
