// Editor Styles for Facebook Reviews Block
.ask-facebook-reviews {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    width: 100%;

    .ask-loading {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 60px 20px;

        p {
            margin-top: 16px;
            color: #666;
        }
    }

    .ask-reviews-grid {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
    }

    // Carousel Layout Styles
    &.ask-layout-carousel {

        .swiper,
        .swiper-container {
            overflow: visible !important;
            padding: 20px 0 50px !important;
            margin: 0 !important;
            width: 100% !important;
        }

        .swiper-wrapper {
            align-items: stretch;
        }

        .swiper-slide {
            height: auto;
            display: flex;
            box-sizing: border-box;
        }

        .ask-review-card.ask-deneb-card {
            height: 100%;
            display: flex;
            flex-direction: column;

            .ask-card-content {
                flex: 1;
                display: flex;
                flex-direction: column;
            }

            .ask-review-text {
                flex: 1;
            }
        }
    }

    .swiper-wrapper {
        align-items: stretch;
    }

    .swiper-slide {
        height: auto;
        display: flex;
        flex-direction: column;

        .ask-review-card {
            flex: 1;
            height: 100%;
            display: flex;
            flex-direction: column;
        }
    }

    .ask-review-card {
        background: #fff;
        border: 1px solid #e0e0e0;
        padding: 20px;
        transition: all 0.3s ease;

        &:hover {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            transform: translateY(-2px);
        }

        .ask-review-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 12px;

            .ask-reviewer-avatar {
                width: 48px;
                height: 48px;
                border-radius: 50%;
                overflow: hidden;
                flex-shrink: 0;

                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                }

                .ask-avatar-placeholder {
                    width: 100%;
                    height: 100%;
                    background: #e0e0e0;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    font-weight: 600;
                    font-size: 20px;
                    color: #666;
                }
            }

            .ask-reviewer-info {
                flex: 1;

                .ask-reviewer-name {
                    font-weight: 600;
                    color: #333;
                    margin-bottom: 4px;
                }

                .ask-review-date {
                    font-size: 12px;
                    color: #999;
                }
            }
        }

        .ask-review-rating {
            margin-bottom: 12px;

            .ask-rating-stars {
                display: flex;
                gap: 2px;

                .ask-star {
                    font-size: 20px;
                    line-height: 1;

                    &.filled {
                        color: #FFB800;
                    }

                    &.empty {
                        color: #ddd;
                    }
                }
            }
        }

        .ask-review-text {
            color: #555;
            line-height: 1.6;
            margin-bottom: 12px;
            flex: 1;
        }

        .ask-review-source {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            color: #999;
            padding-top: 12px;
            border-top: 1px solid #f0f0f0;

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

    // Deneb Header
    .ask-deneb-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: linear-gradient(135deg, #fff8e5 0%, #fffbf0 100%);
        /* Light yellow gradient */
        border: 1px solid #ffda6a;
        /* Yellow border */
        border-radius: 16px;
        padding: 25px 35px;
        margin-bottom: 50px;
        flex-wrap: wrap;
        gap: 20px;
        box-shadow: 0 8px 20px rgba(255, 218, 106, 0.15);

        .ask-deneb-header-content {
            display: flex;
            align-items: center;
            gap: 20px;
            flex-wrap: wrap;
        }

        .ask-deneb-brand {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 26px;
            font-weight: 800;
            color: #1877f2; // Facebook blue
            letter-spacing: -0.5px;

            .ask-rating-label {
                color: #555;
                font-weight: 500;
                font-size: 16px;
                margin-left: 5px;
                letter-spacing: normal;
            }
        }

        .ask-deneb-rating-info {
            display: flex;
            align-items: center;
            gap: 12px;
            background: rgba(255, 255, 255, 0.6);
            padding: 8px 15px;
            border-radius: 30px;
            border: 1px solid rgba(255, 218, 106, 0.5);

            .ask-rating-score {
                font-size: 20px;
                font-weight: 800;
                color: #333;
            }

            .ask-rating-stars {
                display: flex;

                .ask-star {
                    font-size: 22px;
                    color: #FFB800;
                    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);

                    &.empty {
                        color: #e0e0e0;
                        text-shadow: none;
                    }
                }
            }

            .ask-review-count {
                color: #666;
                font-size: 14px;
                margin-left: 5px;
            }
        }

        .ask-write-review-btn {
            background: linear-gradient(to right, #1877f2, #0056b3);
            color: white;
            padding: 12px 25px;
            border-radius: 30px;
            text-decoration: none;
            font-weight: 600;
            font-size: 15px;
            transition: all 0.3s ease;
            box-shadow: 0 4px 10px rgba(24, 119, 242, 0.3);

            &:hover {
                transform: translateY(-2px);
                box-shadow: 0 6px 15px rgba(24, 119, 242, 0.4);
            }
        }
    }

    // Deneb Card Style
    .ask-review-card.ask-deneb-card {
        background: #fff;
        border: 1px solid #ffda6a;
        /* Yellow border */
        border-radius: 12px;
        padding: 45px 20px 20px;
        /* Reduced top/bottom padding */
        position: relative;
        text-align: center;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
        display: flex;
        flex-direction: column;
        min-height: auto;
        /* Allow content to dictate height */
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

        // Quote mark background centered
        &::before {
            content: '"';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 80px;
            line-height: 1;
            font-family: Georgia, serif;
            color: #1877f2;
            /* Blue quote */
            opacity: 0.05;
            pointer-events: none;
            z-index: 0;
        }

        &:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
            border-color: #ffcd38;
        }

        .ask-reviewer-avatar {
            position: absolute;
            top: -35px;
            left: 50%;
            transform: translateX(-50%);
            width: 70px;
            height: 70px;
            border-radius: 50%;
            overflow: hidden;
            border: 4px solid #fff;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            background: #fff;
            z-index: 2;

            img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                transition: transform 0.5s ease;
            }

            &:hover img {
                transform: scale(1.1);
            }

            .ask-avatar-placeholder {
                width: 100%;
                height: 100%;
                display: flex;
                align-items: center;
                justify-content: center;
                background: linear-gradient(135deg, #1877f2, #0056b3);
                color: white;
                font-weight: bold;
                font-size: 28px;
            }
        }

        .ask-facebook-icon {
            position: absolute;
            top: 15px;
            right: 15px;
            background: #1877f2;
            /* Blue background */
            color: #fff;
            /* White icon */
            width: 28px;
            /* Slightly larger for square */
            height: 28px;
            border-radius: 6px;
            /* Rounded square */
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            box-shadow: 0 2px 5px rgba(24, 119, 242, 0.2);

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

            i,
            svg {
                font-size: 16px;
                fill: #fff;
                /* Ensure SVG is white */
            }

            &:hover {
                transform: scale(1.1);
                box-shadow: 0 4px 8px rgba(24, 119, 242, 0.3);
            }
        }

        .ask-card-content {
            margin-top: 40px;
            /* Extra space so title is fully below the avatar */
            position: relative;
            z-index: 1;
            flex-grow: 1;
            display: flex;
            flex-direction: column;
        }

        .ask-reviewer-name {
            font-weight: 700;
            font-size: 16px;
            margin-bottom: 8px;
            /* Reduced margin */
            color: #333;
            letter-spacing: -0.2px;
        }

        .ask-review-text {
            color: #666;
            font-size: 14px;
            line-height: 1.5;
            margin-bottom: 12px;
            /* Reduced margin */

            .ask-read-more {
                display: block;
                /* New line */
                margin-top: 5px;
                color: #1877f2;
                text-decoration: none;
                font-weight: 500;
                border-bottom: 1px solid transparent;

                &:hover {
                    border-bottom-color: #1877f2;
                }
            }
        }

        .ask-recommendation {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            color: #666;
            /* Grey text */
            font-weight: 500;
            font-size: 14px;
            margin-bottom: 8px;
            /* Reduced margin */
            padding: 0;
            background: transparent;
            border-radius: 0;
            align-self: center;

            .dashicons {
                font-size: 18px;
                color: #ff5a5f;
                /* Red icon */
                background: #ff5a5f20;
                padding: 4px;
                border-radius: 4px;
            }

            &.positive {
                color: #555;
                background: transparent;
            }

            &.negative {
                color: #666;
                background: transparent;
            }
        }

        .ask-review-date {
            color: #999;
            font-size: 12px;
            font-weight: 400;
            margin-top: auto;
            /* Push to bottom */
        }
    }
}

// Style variations
.ask-style-classic {
    .ask-review-card {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
}

.ask-style-minimal {
    .ask-review-card {
        border: none;
        border-left: 3px solid #FFB800;
        background: #fafafa;
    }
}

// Layout variations
.ask-layout-list {
    .ask-reviews-grid {
        grid-template-columns: 1fr !important;
    }
}

// Responsive
@media (max-width: 768px) {
    .ask-facebook-reviews {
        .ask-deneb-header {
            flex-direction: column;
            text-align: center;

            .ask-deneb-header-content {
                justify-content: center;
            }
        }

        .ask-reviews-grid {
            grid-template-columns: 1fr !important;
        }
    }
}

// Carousel Equal Height Fix
.ask-layout-carousel {

    .swiper,
    .swiper-container {
        overflow: hidden;
        padding-bottom: 50px !important;
        /* Make room for pagination */
    }

    .swiper-wrapper {
        align-items: stretch;
    }

    .swiper-slide {
        height: auto;
        display: flex;
        box-sizing: border-box;
    }

    .ask-review-card.ask-deneb-card {
        height: 100%;
        display: flex;
        flex-direction: column;

        .ask-card-content {
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        .ask-review-text {
            flex: 1;
        }
    }
}

// Masonry Layout
.ask-layout-masonry {
    .ask-reviews-grid {
        display: block;
        /* Override grid display */
    }

    .ask-review-card {
        break-inside: avoid;
        margin-bottom: 30px;
        /* Match gap */
    }
}

// List Layout
.ask-layout-list {
    .ask-reviews-grid {
        grid-template-columns: 1fr !important;
    }

    .ask-review-card.ask-deneb-card {
        flex-direction: row;
        text-align: left;
        padding: 24px;
        align-items: flex-start;
        min-height: 180px;

        .ask-reviewer-avatar {
            position: static;
            transform: none;
            margin-right: 24px;
            margin-bottom: 0;
            border: 2px solid #fff;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            width: 80px;
            height: 80px;
            flex-shrink: 0;

            .ask-avatar-placeholder {
                font-size: 32px;
            }
        }

        .ask-card-content {
            margin-top: 0;
            text-align: left;
        }

        .ask-facebook-icon {
            right: 20px;
            top: 20px;
        }

        .ask-reviewer-name {
            margin-bottom: 4px;
            font-size: 18px;
        }

        .ask-review-rating {
            margin-bottom: 8px;
            justify-content: flex-start;
        }

        .ask-recommendation {
            justify-content: flex-start;
        }

        .ask-review-text .ask-read-more {
            display: inline-block;
            margin-left: 5px;
        }

        &::before {
            display: none;
            /* Hide quote in list view for cleaner look */
        }
    }
}