/**
 * Vision Builder - Background Presets
 * Modern background styles including mesh gradients and subtle patterns
 */

/* ==================== MESH GRADIENTS ==================== */

/* Purple Mesh - Vibrant purple/pink mesh gradient */
.nvb-mesh-purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 400% 400%;
    position: relative; /* Needed for ::before positioning */
    /* No z-index or overflow to avoid stacking/clipping issues */
}

.nvb-mesh-purple::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.35), transparent 35%),
        radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.35), transparent 35%),
        radial-gradient(circle at 40% 20%, rgba(236, 72, 153, 0.25), transparent 35%);
    filter: blur(50px);
    pointer-events: none;
}

/* Blue Mesh - Blue/teal mesh gradient */
.nvb-mesh-blue {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    background-size: 400% 400%;
    position: relative; /* Needed for ::before positioning */
    /* No z-index or overflow to avoid stacking/clipping issues */
}

.nvb-mesh-blue::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(59, 130, 246, 0.4), transparent 35%),
        radial-gradient(circle at 70% 70%, rgba(16, 185, 129, 0.35), transparent 35%),
        radial-gradient(circle at 50% 90%, rgba(14, 165, 233, 0.25), transparent 35%);
    filter: blur(50px);
    pointer-events: none;
}

/* Ensure mesh backgrounds have proper contrast for text */
.nvb-mesh-purple *,
.nvb-mesh-blue * {
    color: inherit;
}

.nvb-mesh-purple .elementor-heading-title,
.nvb-mesh-blue .elementor-heading-title {
    color: #FFFFFF;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nvb-mesh-purple .elementor-widget-text-editor,
.nvb-mesh-blue .elementor-widget-text-editor {
    color: rgba(255, 255, 255, 0.9);
}

/* ==================== SUBTLE PATTERNS ==================== */

/* Dot Pattern - Subtle repeating dots */
.nvb-pattern-dots {
    background-color: #FFFFFF;
    background-image:
        radial-gradient(circle, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Wave Pattern - Diagonal wave lines */
.nvb-pattern-waves {
    background-color: #FFFFFF;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(0,0,0,0.02) 10px,
            rgba(0,0,0,0.02) 20px
        );
}

/* ==================== STANDARD GRADIENTS ==================== */

/* Purple Gradient (for programmatic use) */
.nvb-gradient-purple {
    background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
}

/* Blue Gradient (for programmatic use) */
.nvb-gradient-blue {
    background: linear-gradient(135deg, #3B82F6 0%, #10B981 100%);
}

/* Warm Gradient (for programmatic use) */
.nvb-gradient-warm {
    background: linear-gradient(135deg, #F59E0B 0%, #EC4899 100%);
}

/* Cool Gradient (for programmatic use) */
.nvb-gradient-cool {
    background: linear-gradient(135deg, #3B82F6 0%, #10B981 100%);
}

/* ==================== RESPONSIVE ADJUSTMENTS ==================== */

/* Reduce blur on smaller screens for better performance */
@media (max-width: 768px) {
    .nvb-mesh-purple::before,
    .nvb-mesh-blue::before {
        filter: blur(30px);
    }
}

/* ==================== RESPONSIVE SPACING ==================== */

/* Vertical Spacing (Top & Bottom) using clamp() */
[data-nvb-vspacing="xs"] {
    padding-top: clamp(16px, calc(14.18px + 0.909vw), 24px) !important;
    padding-bottom: clamp(16px, calc(14.18px + 0.909vw), 24px) !important;
}
[data-nvb-vspacing="sm"] {
    padding-top: clamp(24px, calc(17.45px + 1.818vw), 40px) !important;
    padding-bottom: clamp(24px, calc(17.45px + 1.818vw), 40px) !important;
}
[data-nvb-vspacing="md"] {
    padding-top: clamp(40px, calc(30.91px + 2.727vw), 64px) !important;
    padding-bottom: clamp(40px, calc(30.91px + 2.727vw), 64px) !important;
}
[data-nvb-vspacing="lg"] {
    padding-top: clamp(56px, calc(41.45px + 4.545vw), 96px) !important;
    padding-bottom: clamp(56px, calc(41.45px + 4.545vw), 96px) !important;
}
[data-nvb-vspacing="xl"] {
    padding-top: clamp(72px, calc(51.64px + 6.364vw), 128px) !important;
    padding-bottom: clamp(72px, calc(51.64px + 6.364vw), 128px) !important;
}
[data-nvb-vspacing="xxl"] {
    padding-top: clamp(96px, calc(65.45px + 9.545vw), 180px) !important;
    padding-bottom: clamp(96px, calc(65.45px + 9.545vw), 180px) !important;
}

/* Horizontal Spacing (Left & Right) using clamp() */
[data-nvb-hspacing="xs"] {
    padding-left: clamp(12px, calc(10.55px + 0.455vw), 16px) !important;
    padding-right: clamp(12px, calc(10.55px + 0.455vw), 16px) !important;
}
[data-nvb-hspacing="sm"] {
    padding-left: clamp(16px, calc(13.09px + 0.909vw), 24px) !important;
    padding-right: clamp(16px, calc(13.09px + 0.909vw), 24px) !important;
}
[data-nvb-hspacing="md"] {
    padding-left: clamp(20px, calc(16.36px + 1.364vw), 32px) !important;
    padding-right: clamp(20px, calc(16.36px + 1.364vw), 32px) !important;
}
[data-nvb-hspacing="lg"] {
    padding-left: clamp(24px, calc(15.27px + 2.727vw), 48px) !important;
    padding-right: clamp(24px, calc(15.27px + 2.727vw), 48px) !important;
}
[data-nvb-hspacing="xl"] {
    padding-left: clamp(32px, calc(20.36px + 3.636vw), 64px) !important;
    padding-right: clamp(32px, calc(20.36px + 3.636vw), 64px) !important;
}
[data-nvb-hspacing="xxl"] {
    padding-left: clamp(48px, calc(30.55px + 5.455vw), 96px) !important;
    padding-right: clamp(48px, calc(30.55px + 5.455vw), 96px) !important;
}

/* ==================== UTILITIES ==================== */

/* Force white text on dark backgrounds */
.nvb-force-white-text .elementor-heading-title,
.nvb-force-white-text .elementor-widget-text-editor,
.nvb-force-white-text .elementor-icon-list-text {
    color: #FFFFFF !important;
}

/* Ensure background covers full section */
.elementor-container > .nvb-mesh-purple,
.elementor-container > .nvb-mesh-blue,
.elementor-container > .nvb-pattern-dots,
.elementor-container > .nvb-pattern-waves {
    min-height: 100%;
}
