/* ===================================
   SAFITRACK INTELLIGENCE LAYER
   Enhanced Premium Design
   =================================== */

.intelligence-hub {
    padding: 120px 0;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

/* Mesh Container */
.mesh-container {
    position: relative;
    max-width: 1000px;
    height: 600px;
    margin: 60px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animated Background Grid */
.mesh-grid-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(47, 95, 208, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(47, 95, 208, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(40px, 40px);
    }
}

/* SVG Connection Lines */
.mesh-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.mesh-line {
    stroke-width: 2;
    fill: none;
    animation: lineFlow 4s ease-in-out infinite;
}

@keyframes lineFlow {

    0%,
    100% {
        stroke-opacity: 0.3;
    }

    50% {
        stroke-opacity: 0.6;
    }
}

/* Data Pulses */
.data-pulse {
    filter: drop-shadow(0 0 8px rgba(47, 95, 208, 0.8));
}

/* Core Glow Effect */
.core-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle,
            rgba(47, 95, 208, 0.15) 0%,
            rgba(47, 95, 208, 0.05) 40%,
            transparent 70%);
    z-index: 0;
    animation: coreAura 6s ease-in-out infinite;
}

@keyframes coreAura {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

/* Central Core (Enhanced) */
.mesh-core {
    position: relative;
    z-index: 20;
    width: 180px;
    height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-secondary) 100%);
    border: 2px solid var(--border-color);
    border-radius: 24px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.mesh-core:hover {
    border-color: var(--color-primary);
}

.core-icon-wrapper {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(47, 95, 208, 0.1);
    border-radius: 20px;
    margin-bottom: 4px;
}

.core-icon-wrapper img {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 0 20px rgba(47, 95, 208, 0.5));
    animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.core-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.core-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #10b981;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
}

.status-dot.pulsing {
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Enhanced Connectivity Nodes */
.mesh-node {
    position: absolute;
    z-index: 15;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(47, 95, 208, 0.15);
    border-radius: 14px;
    cursor: default;
    transition: all 0.2s ease;
    animation: nodeFloat 8s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Node Icon - Color Coded by Type */
.node-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.2s ease;
    overflow: visible;
}

.node-icon svg {
    overflow: visible;
}

/* Color Variants */
.mesh-node[data-color="blue"] .node-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.mesh-node[data-color="purple"] .node-icon {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.mesh-node[data-color="orange"] .node-icon {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.mesh-node[data-color="green"] .node-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.mesh-node[data-color="cyan"] .node-icon {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
}

.mesh-node[data-color="pink"] .node-icon {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
}

/* Node Content */
.node-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.node-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.node-subtitle {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

/* Node Specific Positions */
.node-1 {
    top: 8%;
    left: 12%;
    animation-delay: 0s;
}

.node-2 {
    top: 12%;
    right: 10%;
    animation-delay: 1.3s;
}

.node-3 {
    bottom: 12%;
    left: 8%;
    animation-delay: 2.6s;
}

.node-4 {
    bottom: 16%;
    right: 12%;
    animation-delay: 3.9s;
}

.node-5 {
    top: 44%;
    left: 2%;
    animation-delay: 0.7s;
}

.node-6 {
    top: 48%;
    right: 2%;
    animation-delay: 2s;
}

/* Float Animation */
@keyframes nodeFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

/* Responsive Design */
@media (max-width: 1100px) {
    .mesh-container {
        max-width: 90%;
        height: 550px;
    }

    .mesh-core {
        width: 160px;
        height: 160px;
    }

    .core-icon-wrapper {
        width: 70px;
        height: 70px;
    }

    .core-icon-wrapper img {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 900px) {
    .intelligence-hub {
        padding: 80px 0;
    }

    .mesh-container {
        height: 500px;
    }

    .node-5,
    .node-6 {
        display: none;
    }

    .mesh-node {
        padding: 14px 18px;
    }

    .node-icon {
        width: 36px;
        height: 36px;
    }

    .node-title {
        font-size: 14px;
    }

    .node-subtitle {
        font-size: 11px;
    }
}

@media (max-width: 600px) {
    .intelligence-hub {
        padding: 60px 0;
    }

    .mesh-container {
        height: auto;
        flex-direction: column;
        gap: 24px;
        padding: 40px 0;
    }

    .mesh-grid-bg,
    .mesh-svg,
    .core-glow {
        display: none;
    }

    .mesh-core {
        position: relative;
        width: 140px;
        height: 140px;
        margin-bottom: 20px;
    }

    .core-icon-wrapper {
        width: 60px;
        height: 60px;
    }

    .core-icon-wrapper img {
        width: 36px;
        height: 36px;
    }

    .core-label {
        font-size: 13px;
    }

    .core-status {
        font-size: 10px;
    }

    .mesh-node {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        animation: none;
        width: 100%;
        max-width: 280px;
    }

    .mesh-node:hover {
        transform: scale(1.02);
    }
}

/* ===================================
   REVENUE CONTROL CENTER (NEW)
   =================================== */

.intelligence-hub {
    padding: 110px 0;
    position: relative;
    overflow: hidden;
}

.intelligence-hub::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 15% 10%, rgba(47, 95, 208, 0.14), transparent 45%), radial-gradient(circle at 85% 80%, rgba(139, 92, 246, 0.12), transparent 42%);
    pointer-events: none;
}

.revenue-control {
    position: relative;
    z-index: 1;
    margin-top: 56px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(18, 25, 35, 0.94), rgba(14, 20, 30, 0.96));
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.28);
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    overflow: hidden;
}

.rc-left {
    padding: 42px;
    border-right: 1px solid rgba(148, 163, 184, 0.16);
}

.rc-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(125, 162, 248, 0.35);
    color: #9cb5ff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.rc-title {
    font-size: clamp(1.7rem, 2.6vw, 2.4rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.rc-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 520px;
    margin-bottom: 24px;
}

.rc-live-feed {
    display: grid;
    gap: 10px;
}

.rc-feed-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 14px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(22, 31, 45, 0.82);
}

.rc-feed-label {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.rc-feed-value {
    color: var(--text-primary);
    font-size: 0.98rem;
    letter-spacing: -0.01em;
}

.rc-right {
    padding: 34px;
}

.rc-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: rgba(12, 18, 27, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 11px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 18px;
}

.rc-tab {
    height: 34px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    transition: background-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.rc-tab:hover {
    color: var(--text-primary);
}

.rc-tab.active {
    color: var(--text-primary);
    background: rgba(47, 95, 208, 0.22);
}

.rc-panes {
    position: relative;
}

.rc-pane {
    display: none;
    animation: rcFadeUp 240ms ease;
}

.rc-pane.active {
    display: block;
}

@keyframes rcFadeUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rc-metric-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(20, 29, 42, 0.9);
    margin-bottom: 16px;
}

.rc-metric-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rc-metric-value {
    font-size: 1.65rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.rc-metric-trend {
    font-size: 0.83rem;
    font-weight: 600;
}

.rc-metric-trend.up {
    color: #34d399;
}

.rc-metric-trend.neutral {
    color: #94a3b8;
}

.rc-mini-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    align-items: end;
    height: 132px;
}

.rc-mini-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    height: 100%;
}

.rc-mini-bar span {
    width: 100%;
    max-width: 30px;
    border-radius: 7px 7px 3px 3px;
    background: linear-gradient(180deg, #5b8cff, #2f5fd0);
    box-shadow: 0 8px 14px rgba(47, 95, 208, 0.24);
    animation: barPulse 2.8s ease-in-out infinite;
}

.rc-mini-bar:nth-child(2) span {
    animation-delay: 0.25s;
}

.rc-mini-bar:nth-child(3) span {
    animation-delay: 0.5s;
}

.rc-mini-bar:nth-child(4) span {
    animation-delay: 0.75s;
}

@keyframes barPulse {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.15);
    }
}

.rc-mini-bar label {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.rc-checklist {
    display: grid;
    gap: 10px;
}

.rc-checklist li {
    position: relative;
    padding-left: 22px;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.rc-checklist li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(180deg, #34d399, #10b981);
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12);
}

.rc-team-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.rc-team-pill {
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(20, 29, 42, 0.86);
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

.rc-team-pill span {
    color: var(--text-primary);
}

@media (max-width: 980px) {
    .revenue-control {
        grid-template-columns: 1fr;
    }

    .rc-left {
        border-right: none;
        border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    }
}

@media (max-width: 640px) {
    .intelligence-hub {
        padding: 72px 0;
    }

    .revenue-control {
        margin-top: 32px;
        border-radius: 14px;
    }

    .rc-left,
    .rc-right {
        padding: 22px;
    }

    .rc-team-grid {
        grid-template-columns: 1fr;
    }

    .rc-tabs {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 6px;
    }

    .rc-tab {
        height: 36px;
        font-size: 0.82rem;
    }

    .rc-feed-row {
        padding: 11px 12px;
        gap: 10px;
    }

    .rc-feed-label {
        font-size: 0.82rem;
    }

    .rc-feed-value {
        font-size: 0.9rem;
    }

    .rc-mini-bars {
        height: 116px;
        gap: 8px;
    }
}