/**
 * YesMonetize Background Patterns Component
 * 
 * Padrões de background reutilizáveis para cards e seções.
 * 
 * Uso: Adicione a classe do padrão desejado ao elemento.
 * Exemplo: <div class="ym-pattern-dots">...</div>
 *
 * @package YesMonetize_Apps
 * @author  RuthesDev
 * @link    https://ruthes.dev
 */

/* ============================================
   BASE PATTERN SETUP
   ============================================ */

[class*="ym-pattern-"] {
    position: relative;
    /* overflow: hidden; -- Removed to allow tooltips/popovers if needed, but creates containment */
}

[class*="ym-pattern-"]::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* Ensure content stays above pattern */
[class*="ym-pattern-"]>* {
    position: relative;
    z-index: 1;
}

/* ============================================
   DOTS PATTERN
   ============================================ */

.ym-pattern-dots::before {
    background-image: radial-gradient(circle, currentColor 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.08;
}

.ym-pattern-dots-sm::before {
    background-image: radial-gradient(circle, currentColor 0.5px, transparent 0.5px);
    background-size: 12px 12px;
    opacity: 0.1;
}

.ym-pattern-dots-lg::before {
    background-image: radial-gradient(circle, currentColor 1.5px, transparent 1.5px);
    background-size: 30px 30px;
    opacity: 0.06;
}

/* ============================================
   GRID PATTERN
   ============================================ */

.ym-pattern-grid::before {
    background-image:
        linear-gradient(currentColor 1px, transparent 1px),
        linear-gradient(90deg, currentColor 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.05;
}

.ym-pattern-grid-sm::before {
    background-image:
        linear-gradient(currentColor 1px, transparent 1px),
        linear-gradient(90deg, currentColor 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.06;
}

/* ============================================
   DIAGONAL LINES & GRIDS
   ============================================ */

.ym-pattern-diagonal::before {
    background-image: repeating-linear-gradient(45deg,
            transparent,
            transparent 10px,
            currentColor 10px,
            currentColor 11px);
    opacity: 0.04;
}

.ym-pattern-diagonal-dense::before {
    background-image: repeating-linear-gradient(45deg,
            transparent,
            transparent 5px,
            currentColor 5px,
            currentColor 6px);
    opacity: 0.05;
}

/* Cross diagonal / Diagonal Grid */
.ym-pattern-crosshatch::before,
.ym-pattern-diagonal-grid::before {
    background-image:
        linear-gradient(45deg, currentColor 1px, transparent 1px),
        linear-gradient(-45deg, currentColor 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.1;
}

/* ============================================
   WAVES PATTERN
   ============================================ */

.ym-pattern-waves::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23000' d='M0,160L48,170.7C96,181,192,203,288,192C384,181,480,139,576,128C672,117,768,139,864,165.3C960,192,1056,224,1152,213.3C1248,203,1344,149,1392,122.7L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
    background-position: bottom;
    opacity: 0.03;
}

/* ============================================
   CIRCUIT PATTERN (Tech look)
   ============================================ */

.ym-pattern-circuit::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23000' stroke-width='1'%3E%3Cpath d='M10 10h80v80H10z'/%3E%3Cpath d='M30 10v20h40V10M30 70v20M70 70v20M10 30h20v40H10M70 30h20v40H70'/%3E%3Ccircle cx='30' cy='30' r='3' fill='%23000'/%3E%3Ccircle cx='70' cy='30' r='3' fill='%23000'/%3E%3Ccircle cx='30' cy='70' r='3' fill='%23000'/%3E%3Ccircle cx='70' cy='70' r='3' fill='%23000'/%3E%3Ccircle cx='50' cy='50' r='5' fill='%23000'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 100px 100px;
    opacity: 0.04;
}

/* ============================================
   NOISE/GRAIN PATTERN
   ============================================ */

.ym-pattern-noise::before {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.15;
}

.ym-pattern-noise-light::before {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.08;
}

/* ============================================
   HEXAGON PATTERN
   ============================================ */

.ym-pattern-hexagon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill='none' stroke='%23000' stroke-width='1'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 28px 49px;
    opacity: 0.05;
}

/* ============================================
   PLUS/CROSS PATTERN
   ============================================ */

.ym-pattern-plus::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%23000' d='M9 4h2v5h5v2h-5v5H9v-5H4V9h5V4z'/%3E%3C/svg%3E");
    background-size: 30px 30px;
    opacity: 0.04;
}

/* ============================================
   TOPOGRAPHY PATTERN
   ============================================ */

.ym-pattern-topography::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cpath fill='none' stroke='%23000' stroke-width='1' d='M20,10 Q50,40 80,10 M10,30 Q40,60 90,30 M20,50 Q50,80 80,50 M10,70 Q40,100 90,70 M20,90 Q50,120 80,90'/%3E%3C/svg%3E");
    background-size: 100px 100px;
    opacity: 0.05;
}

/* ============================================
   OPACITY MODIFIERS
   ============================================ */

.ym-pattern-opacity-5::before {
    opacity: 0.05 !important;
}

.ym-pattern-opacity-10::before {
    opacity: 0.10 !important;
}

.ym-pattern-opacity-15::before {
    opacity: 0.15 !important;
}

.ym-pattern-opacity-20::before {
    opacity: 0.20 !important;
}

.ym-pattern-opacity-25::before {
    opacity: 0.25 !important;
}

/* ============================================
   COLOR MODIFIERS
   ============================================ */

.ym-pattern-white::before {
    color: #fff !important;
}

.ym-pattern-black::before {
    color: #000 !important;
}

.ym-pattern-primary::before {
    color: var(--ym-primary, #2196F3) !important;
}

.ym-pattern-gray::before {
    color: #6B7280 !important;
}

/* ============================================
   ANIMATED PATTERNS
   ============================================ */

.ym-pattern-animate-slow::before {
    animation: ym-pattern-drift 60s linear infinite;
}

.ym-pattern-animate::before {
    animation: ym-pattern-drift 30s linear infinite;
}

.ym-pattern-animate-fast::before {
    animation: ym-pattern-drift 15s linear infinite;
}

@keyframes ym-pattern-drift {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 100px 100px;
    }
}

/* ============================================
   GRADIENT / FADE OVERLAYS
   ============================================ */

.ym-pattern-fade-bottom::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, currentColor 0%, transparent 100%);
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

.ym-pattern-fade-top::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, currentColor 0%, transparent 100%);
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

/* Masks for smoother fading of the pattern itself */
.ym-pattern-fade-bottom-left::before {
    -webkit-mask-image: linear-gradient(to top right, transparent 0%, black 60%);
    mask-image: linear-gradient(to top right, transparent 0%, black 60%);
}

.ym-pattern-fade-bottom-right::before {
    -webkit-mask-image: linear-gradient(to top left, transparent 0%, black 60%);
    mask-image: linear-gradient(to top left, transparent 0%, black 60%);
}

.ym-pattern-vignette::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, currentColor 100%);
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}