@use './responsive-css.scss';
@use '../blocks/tailwind-class.scss';
@use './pages/quickStart/quick-start-style.scss';
@use './pages/blockVisibility/visibility-style.scss';
@use './pages/saved-templates/saved-templates.scss';
@use './pages/settings/setting-styles.scss';
@use './setup-wizard/setup-wizard.scss';
@use './pages/integrations/integrations-style.scss';
@use './pages/lite-vs-pro/lite-vs-pro.scss';
@use './pages/about-us/about-us.scss';

$primary-text-color: #1E1E1E;

/*
 * ADMIN DASHBOARD LAYOUT CSS.
 */

.sp-eab-admin-dashboard-wrapper {
    margin-left: -20px;

    * {
        box-sizing: border-box;
    }

    a {
        text-decoration: none;
    }

    // width and padding.
    .sp-eab-admin-dashboard-content {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 32px;
    }

    .sp-eab-block-setting-header-wrapper {
        max-width: 1400px;
        margin: 0 auto;
    }

    // override default a tag focus style.
    .wp-person a:focus .gravatar,
    a:focus,
    a:focus .media-icon img,
    a:focus .plugin-icon {
        box-shadow: none;
        outline: none;
    }

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

    .sp-eap-company-name {
        color: #2f2f2f;
        transition: color 0.4s ease-in-out;

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

/*
 * ADMIN DASHBOARD HEADING CSS.
 */
.sp-eab-green-header-notice {
    background-color: #148652;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;

    .sp-eab-green-header-notice-content {
        display: flex;
        align-items: center;
        padding: 12px 0;

        .sp-eab-green-header-notice-text {
            color: #fff;
            font-size: 14px;
            margin-left: 6px;
        }

        .sp-eab-green-header-notice-link {
            color: #fff;
            font-size: 14px;
            font-weight: bold;
            display: inline-flex;
            align-items: center;
            padding-left: 8px;
            position: relative;
            gap: 3px;

            &::after {
                content: '';
                position: absolute;
                bottom: 0px;
                left: 8px;
                right: 0;
                height: 1px;
                background-color: #fff;
            }

            &:hover {
                text-decoration: none;
                svg {
                    transform: translateX(3px) rotate(45deg);
                }
            }

            svg {
                width: 11px;
                height: 11px;
                transform: rotate(45deg);
                transition: all .3s ease-in-out;
            }
        }

        .sp-eab-green-header-notice-close {
            background: none;
            border: none;
            color: #dad7d7;
            cursor: pointer;
            padding: 4px;
            margin-left: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            transition: all 0.2s ease;
            position: absolute;
            right: 15px;
            width: 18px;

            &:hover {
                background-color: rgba(255, 255, 255, 0.1);
            }

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

.sp-eab-admin-dashboard-header {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    margin-bottom: 48px;

    .sp-eab-block-setting-header-wrapper {
        height: 64px;
        padding: 0 32px;
        max-width: 1400px;
        margin: 0 auto;
    }

    .sp-eab-admin-dashboard-header-left {
        width: auto;
        display: flex;
        gap: 10px;
        align-items: center;
        flex-shrink: 0;

        .sp-eap-dashboard-logo {
            display: flex;
            align-items: center;
        }
    }

    .sp-eap-plugin-version {
        border: 1px solid #ddd;
        border-radius: 17px;
        height: 24px;
        padding: 4px 10px;
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 13px;
        font-weight: 500;
        color: #2f2f2f;
        cursor: pointer;
        background: #fff;

        svg, img {
            width: 12px;
            height: 12px;
        }
    }

    .sp-eab-header-changelog-btn {
        border: none;
        background: none;
        outline: none;
    }

    // Navigation in center
    .sp-eab-admin-dashboard-nav {
        flex: 1;
        display: flex;
        justify-content: center;
        padding: 0;
        border: none;
        background: transparent;
        position: relative;

        ul {
            list-style: none;
            padding: 0;
            display: flex;
            gap: 24px;
            margin: 0;
        }

        // Sliding indicator
        .sp-eap-nav-sliding-indicator {
            position: absolute;
            bottom: 0;
            left: 0;
            height: 2px;
            background-color: var(--eab-primary-color);
            border-radius: 1px;
            transition: left 0.3s ease, width 0.3s ease;
            pointer-events: none;
        }

        li {
            font-size: 16px;
            font-weight: 500;
            line-height: normal;
            margin: 0;

            a {
                text-decoration: none;
                display: inline-flex;
                align-items: center;
                height: 64px;
                padding: 24px 0;
                color: #2f2f2f;
                transition: color 0.3s ease;
                position: relative;

                &.active {
                    color: var(--eab-primary-color);
                }

                .sp-eab-nav-badge {
                    position: absolute;
                    top: 11px;
                    right: 0px;
                    background-color: transparent;
                    color: #F07800;
                    font-size: 10px;
                    font-weight: 500;
                    padding: 0;
                    border-radius: 0;
                    white-space: nowrap;
                    line-height: normal;
                    text-transform: uppercase;
                }
            }

            // Divider before Lite vs Pro
            &.sp-eap-nav-divider {
                position: relative;
                margin-left: 24px;

                &::after {
                    content: '';
                    position: absolute;
                    left: -24px;
                    top: 50%;
                    transform: translateY(-50%);
                    width: 1px;
                    height: 20px;
                    background-color: #ccc;
                }
            }
        }

        // Nav item with icon styling
        a.sp-eap-nav-item-with-icon {
            display: inline-flex;
            align-items: center;
            gap: 5px;
        }
    }

    .sp-eab-admin-dashboard-header-right {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        flex-shrink: 0;
        padding: 10px 0;

        svg {
            color: #FF5B2E; // EAB primary color
        }
    }
}

/*
 * GET HELP SETTINGS.
 */
.sp-eab-admin-dashboard-header-right {
    font-size: 15px;
    font-weight: 600;
    position: relative;
    color: #2f2f2f;

    &:hover {
        .sp-eab-help-drop-down {
            visibility: visible;
            opacity: 1;
        }
    }

    .sp-eab-help-drop-down {
        position: absolute;
        top: 35px;
        background: #fff;
        right: 0px;
        padding: 10px;
        text-align: left;
        border-radius: 4px;
        box-shadow: 0 2px 15px 0 rgba(17, 17, 17, 0.15);
        z-index: 10;
        width: 244px;
        opacity: 0;
        visibility: hidden;
        transition: all .3s ease-in-out;
        display: flex;
    }

    .sp-eap-support-link {
        font-size: 16px;
        font-weight: 400;
        color: #565A5F;
        padding: 10px;
        border-radius: 5px;
        width: 100%;
        position: relative;
        transition: all 0.3s;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 10px;

        .drop-down-arrow {
            width: 16px;
            height: 18px;
            scale: 0.8;
            fill: #565A5F;
            margin-left: auto;
            position: relative;

            svg {
                position: absolute;
                top: 80%;
                left: -10px;
                transform: translate(-50%, -50%);
                transition: all 0.5s;
                opacity: 0;
            }
        }

        &:hover {
            background: #ffefe4; // Light orange tint for EAB

            .drop-down-arrow {
                svg {
                    left: 0px;
                    top: 40%;
                    opacity: 1;
                }
            }
        }
    }
}

// Recommended plugins wrapper
.eab-recommended-plugins-wrapper .sp-eab-section-title {
    margin-bottom: 18px;
    margin-top: -6px;
}

/*
 * ADMIN DASHBOARD FOOTER CSS.
 */
.sp-eab-admin-dashboard-footer {
    margin: 80px auto 0;
    width: 310px;

    h4 {
        color: #6E6A69;
        font-weight: 500;
        font-size: 14px;
        line-height: 16px;
        text-align: center;
    }

    .sp-eab-admin-dashboard-footer-title {
        h4 {
            margin: 0;
            gap: 4px;

            i {
                color: #E57373;
            }
        }
    }

    .sp-eab-admin-dashboard-footer-social-media {
        h4 {
            margin: 12px auto;
        }

        ul {
            margin: 0 auto;
            display: flex;
            width: 120px;
            gap: 16px;

            li {
                margin: 0;

                a:focus {
                    box-shadow: none;
                    outline: none;
                    border: none;
                }
            }
        }
    }
}

/*
 * CHANGELOG CSS.
 */
.sp-eab-admin-changelog-wrapper {
    margin-top: 32px;
    width: 350px;

    .sp-eab-changelog-heading {
        background: #fff;
        box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .1);
        left: 0;
        padding: 15px;
        position: sticky;
        top: 0;
        z-index: 9;

        .sp-eab-changelog-heading-title {
            font-weight: 600;
            font-size: 20px;
            line-height: 16px;
            margin: 0;
        }

        .sp-eab-changelog-close-btn {
            border: none;
            background: none;
            outline: none;
            margin: 0;
            padding: 0;

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

    .sp-eab-changelog-details {
        padding: 0 15px 50px;

        p {
            font-size: 16px;
            margin: 20px 0;
        }

        ul {
            font-size: 13px;
            list-style: disc;

            li {
                margin-bottom: 5px;
                margin-left: 18px;
            }
        }

        &.sp-eab-changelog-error {
            a {
                color: var(--eab-primary-color);
                text-decoration: underline;
            }

            .sp-eab-changelog-error-detail {
                font-size: 14px;
                color: #666;
            }
        }
    }
}

.sp-eab-pro-blocks-badge {
    align-items: center;
    background: var(--eab-primary-color);
    border-radius: 4px;
    color: #fff;
    display: flex;
    font-size: 10px;
    font-weight: 600;
    gap: 2px;
    overflow: hidden;
    padding: 0 2px;
    position: absolute;
    right: 5px;
    top: 5px;
    transition: width .3s ease;
    width: 18px;
}

.sp-eab-admin-dashboard-wrapper .sp-eab-visibility-setting-card:hover .sp-eab-pro-blocks-badge {
    width: 43px;
}

.sp-eab-pro-blocks-badge * {
    flex-shrink: 0;
}

// sub menu css.
#menu-posts-sp_easy_accordion {
    li a[href="edit.php?post_type=sp_easy_accordion&page=eap_dashboard#settings"] {
        border-bottom: 1px solid hsla(0, 0%, 100%, .1);
    }
}