/* Why Us Block Styles */
/* Apply base styles to both editor and front-end classes */
.broadplace-why-us-block,
.broadplace-why-us-block-editor {
    padding: 60px 0;
    position: relative;
    overflow: hidden;
    /* Background and text color are set via inline style on the block root */
}

.broadplace-why-us-block .why-us-container,
.broadplace-why-us-block-editor .why-us-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.broadplace-why-us-block .why-us-header,
.broadplace-why-us-block-editor .why-us-header {
    text-align: center;
    margin-bottom: 50px;
}

.broadplace-why-us-block .why-us-title,
.broadplace-why-us-block-editor .why-us-title {
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 15px;
    line-height: 1.2;
}

.broadplace-why-us-block .why-us-subtitle,
.broadplace-why-us-block-editor .why-us-subtitle {
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
}

/* Statistics Section */
.broadplace-why-us-block .why-us-statistics,
.broadplace-why-us-block-editor .why-us-statistics {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 60px;
    padding: 40px 0;
    /* Use CSS variable for border color */
    border-top: 1px solid var(--broadplace-border-color, rgba(0, 0, 0, 0.1));
    border-bottom: 1px solid var(--broadplace-border-color, rgba(0, 0, 0, 0.1));
}

.broadplace-why-us-block .statistic-item,
.broadplace-why-us-block-editor .statistic-item {
    text-align: center;
    flex: 0 1 200px;
}

.broadplace-why-us-block .statistic-number,
.broadplace-why-us-block-editor .statistic-number {
    display: block;
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 10px;
    /* Color is set via inline style on the span */
}

.broadplace-why-us-block .statistic-label,
.broadplace-why-us-block-editor .statistic-label {
    font-size: 16px;
    opacity: 0.8;
}

/* Benefits Grid */
.broadplace-why-us-block .why-us-benefits,
.broadplace-why-us-block-editor .why-us-benefits {
    display: grid;
    gap: 30px;
}

.broadplace-why-us-block .why-us-benefits.columns-2,
.broadplace-why-us-block-editor .why-us-benefits.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.broadplace-why-us-block .why-us-benefits.columns-3,
.broadplace-why-us-block-editor .why-us-benefits.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.broadplace-why-us-block .why-us-benefits.columns-4,
.broadplace-why-us-block-editor .why-us-benefits.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Benefit Cards */
.broadplace-why-us-block .benefit-card,
.broadplace-why-us-block-editor .benefit-card {
    text-align: center;
    padding: 40px 30px;
    /* Use CSS variable for background */
    background: var(--broadplace-card-bg, rgba(255, 255, 255, 0.9));
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.broadplace-why-us-block .benefit-card::before,
.broadplace-why-us-block-editor .benefit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    /* Use CSS variable for accent color in gradient */
    background: linear-gradient(90deg, transparent, var(--broadplace-accent-color, #0098e6), transparent);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.broadplace-why-us-block .benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.broadplace-why-us-block .benefit-card:hover::before {
    transform: translateX(0);
}

.broadplace-why-us-block .benefit-icon,
.broadplace-why-us-block-editor .benefit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    /* Use CSS variable for background with 10% opacity */
    background: var(--broadplace-accent-color-rgba10, rgba(0, 124, 186, 0.1));
    border-radius: 50%;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    /* Color for SVG is set via inline style on the div */
}

.broadplace-why-us-block .benefit-icon svg,
.broadplace-why-us-block-editor .benefit-icon svg {
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
}

.broadplace-why-us-block .benefit-card:hover .benefit-icon {
    transform: scale(1.1);
    /* Use CSS variable for background with 15% opacity on hover */
    background: var(--broadplace-accent-color-rgba15, rgba(0, 124, 186, 0.15));
}

.broadplace-why-us-block .benefit-card:hover .benefit-icon svg {
    transform: scale(1.1);
}

.broadplace-why-us-block .benefit-title,
.broadplace-why-us-block-editor .benefit-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 15px;
    line-height: 1.3;
}

.broadplace-why-us-block .benefit-description,
.broadplace-why-us-block-editor .benefit-description {
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .broadplace-why-us-block .why-us-benefits.columns-4,
    .broadplace-why-us-block-editor .why-us-benefits.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .broadplace-why-us-block,
    .broadplace-why-us-block-editor {
        padding: 40px 0;
    }

    .broadplace-why-us-block .why-us-title,
    .broadplace-why-us-block-editor .why-us-title {
        font-size: 32px;
    }

    .broadplace-why-us-block .why-us-subtitle,
    .broadplace-why-us-block-editor .why-us-subtitle {
        font-size: 16px;
    }

    .broadplace-why-us-block .why-us-statistics,
    .broadplace-why-us-block-editor .why-us-statistics {
        gap: 30px;
        padding: 30px 0;
    }

    .broadplace-why-us-block .statistic-item,
    .broadplace-why-us-block-editor .statistic-item {
        flex: 0 1 150px;
    }

    .broadplace-why-us-block .statistic-number,
    .broadplace-why-us-block-editor .statistic-number {
        font-size: 36px;
    }

    .broadplace-why-us-block .why-us-benefits.columns-3,
    .broadplace-why-us-block .why-us-benefits.columns-4,
    .broadplace-why-us-block-editor .why-us-benefits.columns-3,
    .broadplace-why-us-block-editor .why-us-benefits.columns-4 {
        grid-template-columns: 1fr;
    }

    .broadplace-why-us-block .benefit-card,
    .broadplace-why-us-block-editor .benefit-card {
        padding: 30px 25px;
    }

    .broadplace-why-us-block .benefit-icon,
    .broadplace-why-us-block-editor .benefit-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 20px;
    }

    .broadplace-why-us-block .benefit-icon svg,
    .broadplace-why-us-block-editor .benefit-icon svg {
        width: 30px;
        height: 30px;
    }

    .broadplace-why-us-block .benefit-title,
    .broadplace-why-us-block-editor .benefit-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .broadplace-why-us-block .why-us-benefits.columns-2,
    .broadplace-why-us-block-editor .why-us-benefits.columns-2 {
        grid-template-columns: 1fr;
    }

    .broadplace-why-us-block .why-us-statistics,
    .broadplace-why-us-block-editor .why-us-statistics {
        flex-direction: column;
        gap: 20px;
    }

    .broadplace-why-us-block .statistic-item,
    .broadplace-why-us-block-editor .statistic-item {
        flex: 1 1 auto;
    }
}

/* Alignment variations */
.broadplace-why-us-block.alignfull,
.broadplace-why-us-block-editor.alignfull {
    padding-left: 0;
    padding-right: 0;
}

/* Dark mode support - these will be overridden by dynamic CSS variables if set */
@media (prefers-color-scheme: dark) {
    /* The dynamic --broadplace-card-bg and --broadplace-border-color variables
       will handle dark mode adjustments based on the chosen background color.
       These rules are now less critical but can serve as fallbacks or specific overrides. */
    .broadplace-why-us-block .benefit-card,
    .broadplace-why-us-block-editor .benefit-card {
        /* background: rgba(0, 0, 0, 0.4); */ /* Handled by --broadplace-card-bg */
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .broadplace-why-us-block .benefit-card:hover,
    .broadplace-why-us-block-editor .benefit-card:hover {
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    }

    .broadplace-why-us-block .why-us-statistics,
    .broadplace-why-us-block-editor .why-us-statistics {
        /* border-color: rgba(255, 255, 255, 0.1); */ /* Handled by --broadplace-border-color */
    }
}

/* Animation on scroll */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.broadplace-why-us-block .benefit-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.broadplace-why-us-block .benefit-card:nth-child(1) {
    animation-delay: 0.1s;
}

.broadplace-why-us-block .benefit-card:nth-child(2) {
    animation-delay: 0.2s;
}

.broadplace-why-us-block .benefit-card:nth-child(3) {
    animation-delay: 0.3s;
}

.broadplace-why-us-block .benefit-card:nth-child(4) {
    animation-delay: 0.4s;
}

/* Disable animations in the editor for better usability */
.broadplace-why-us-block-editor .benefit-card {
    animation: none !important;
}