/* ═══════════════════════════════════════════
   UreTech Neural Network Widget — Mobile-First CSS
   Prefix: .ure-nn-
   ═══════════════════════════════════════════ */

/* ── Root ── */
.ure-nn-root {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--nn-bg, #060510);
    border-radius: 24px;
    font-family: 'Outfit', sans-serif;
}

.ure-nn-root *,
.ure-nn-root *::before,
.ure-nn-root *::after {
    box-sizing: border-box;
}

/* ── Container ── */
.ure-nn-container {
    position: relative;
    width: 100%;
    padding: 24px 16px;
    border-radius: 24px;
    overflow: hidden;
}

/* ── Header ── */
.ure-nn-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.ure-nn-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border: 1px solid rgba(234, 136, 222, 0.3);
    background: rgba(234, 136, 222, 0.1);
    color: #EA88DE;
    margin-bottom: 12px;
}

.ure-nn-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--nn-text, #FAFAFA);
    line-height: 1.2;
}

.ure-nn-desc {
    font-size: 13px;
    line-height: 1.5;
    margin: 0 auto;
    max-width: 480px;
    opacity: 0.6;
    color: var(--nn-text, #FAFAFA);
}

/* ── SVG Canvas Wrap ── */
/* Mobile-first: slight negative margin for edge-to-edge feel on small screens */
.ure-nn-canvas-wrap {
    position: relative;
    width: 100%;
    margin: 0 -8px;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(193, 191, 230, 0.03);
    border: 1px solid rgba(193, 191, 230, 0.08);
}

.ure-nn-svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 50vh;
}

/* ── Connections ── */
.ure-nn-connection {
    stroke-linecap: round;
    pointer-events: none;
}

/* ── Nodes ── */
.ure-nn-node {
    transition: r 0.2s ease, opacity 0.2s ease;
}

.ure-nn-node-group {
    cursor: pointer;
}

.ure-nn-node-glow {
    animation: ure-nn-pulse 1.5s ease-in-out infinite;
}

@keyframes ure-nn-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* ── Particles ── */
.ure-nn-particle {
    pointer-events: none;
    will-change: cx, cy;
}

/* ── Orbs (ambient background) ── */
.ure-nn-orb {
    pointer-events: none;
    filter: blur(60px);
}

/* ── Layer Labels ── */
.ure-nn-layer-label {
    pointer-events: none;
    user-select: none;
    font-size: 10px;
}

/* ── Tooltip (glassmorphism, rendered in foreignObject) ── */
.ure-nn-tooltip {
    background: rgba(6, 5, 16, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(193, 191, 230, 0.2);
    border-radius: 12px;
    padding: 6px 12px;
    text-align: center;
    font-size: 12px;
    font-family: 'Outfit', sans-serif;
    color: #FAFAFA;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.ure-nn-tooltip-fo {
    overflow: visible;
    pointer-events: none;
}

/* ── Mobile base adjustments (< 768px) ── */
/* SVG scales responsively via viewBox; nodes are 20px effective via circle r=10.
   On small screens, canvas bleeds slightly for edge-to-edge feel. */

/* ═══════════════════════════════════════════
   Tablet (768px+)
   ═══════════════════════════════════════════ */
@media (min-width: 768px) {
    .ure-nn-container {
        padding: 32px 24px;
    }

    .ure-nn-title {
        font-size: 28px;
    }

    .ure-nn-desc {
        font-size: 14px;
    }

    .ure-nn-badge {
        font-size: 11px;
        padding: 6px 16px;
    }

    .ure-nn-svg {
        max-height: 60vh;
    }

    .ure-nn-canvas-wrap {
        margin: 0;
        border-radius: 20px;
    }

    .ure-nn-header {
        margin-bottom: 24px;
    }

    .ure-nn-layer-label {
        font-size: 11px;
    }
}

/* ═══════════════════════════════════════════
   Desktop (1024px+)
   ═══════════════════════════════════════════ */
@media (min-width: 1024px) {
    .ure-nn-container {
        padding: 48px 40px;
    }

    .ure-nn-title {
        font-size: 32px;
    }

    .ure-nn-desc {
        font-size: 15px;
        max-width: 560px;
    }

    .ure-nn-svg {
        max-height: 80vh;
    }

    .ure-nn-canvas-wrap {
        border-radius: 24px;
    }

    .ure-nn-header {
        margin-bottom: 32px;
    }

    .ure-nn-layer-label {
        font-size: 12px;
    }
}

/* ═══════════════════════════════════════════
   Large (1440px+)
   ═══════════════════════════════════════════ */
@media (min-width: 1440px) {
    .ure-nn-container {
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }

    .ure-nn-title {
        font-size: 36px;
    }
}

/* ═══════════════════════════════════════════
   Accessibility — Reduced Motion
   ═══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .ure-nn-particle {
        display: none;
    }

    .ure-nn-node-glow {
        animation: none;
        opacity: 0.4;
    }

    .ure-nn-orb {
        animation: none;
    }

    .ure-nn-node {
        transition: none;
    }
}
