/*
 * pages-bi.css
 * Shared styles for Building Intelligence sub-pages:
 *   template-bi-hvac.php, template-bi-energy-analytics.php,
 *   template-bi-iot-sensors.php, template-bi-plant-room.php
 *
 * @package Prysmedge
 */

/* ── BI Hero: Diagnostic Scan animation ── */
@property --scan {
    syntax: '<percentage>';
    initial-value: 0%;
    inherits: true;
}

.bi-hero-img-wrap {
    --scan: 0%;
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    aspect-ratio: 4/3;
    max-width: 520px;
    width: 100%;
    min-height: 360px;
    transition: --scan 1.1s ease-out;
}
.bi-hero-img-wrap:hover { --scan: 100%; }

/* Dark grid base — always visible at rest */
.bi-hero-placeholder-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #262626 50%, #1a1a1a 100%);
    border-radius: inherit;
}
.bi-hero-placeholder-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(249,115,22,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(249,115,22,0.06) 1px, transparent 1px);
    background-size: 28px 28px;
    border-radius: inherit;
}

/* Colour base — always visible underneath */
.bi-hero-img-color {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}
/* Greyscale overlay — scan line sweeps it away top-to-bottom, revealing full colour */
.bi-hero-img-bw {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    filter: grayscale(1) brightness(0.82);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0 var(--scan), black var(--scan));
    mask-image: linear-gradient(to bottom, transparent 0 var(--scan), black var(--scan));
}

.bi-scan-line {
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #f97316, transparent);
    top: var(--scan);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.2s;
}
.bi-hero-img-wrap:hover .bi-scan-line { opacity: 1; }

/* ── Floating metric badges ── */
@keyframes badge-in { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none; } }
.bi-badge {
    position: absolute;
    background: white;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 0.75rem;
    padding: 0.6rem 0.9rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    animation: badge-in 0.5s ease-out forwards;
    opacity: 0;
    z-index: 20;
    white-space: nowrap;
}
.bi-badge-label { font-family: 'JetBrains Mono', monospace; font-size: 0.6rem; color: #737373; text-transform: uppercase; letter-spacing: 0.08em; display: block; }
.bi-badge-value { font-family: 'Barlow', sans-serif; font-weight: 700; font-size: 0.85rem; color: #171717; display: block; margin-top: 0.1rem; }
.bi-badge-1 { animation-delay: 0.6s; top: 12%; right: -1rem; }
.bi-badge-2 { animation-delay: 0.9s; bottom: 20%; left: -1rem; }
.bi-badge-3 { animation-delay: 1.2s; bottom: 6%; right: 1rem; }

/* ── Dark approach section ── */
.dark-approach { background: #0a0a0a; position: relative; overflow: hidden; }
.dark-approach::before {
    content: ''; position: absolute; top: 0; right: 0;
    width: 500px; height: 500px;
    background: radial-gradient(ellipse at 80% 0%, rgba(35,21,13,0.85) 0%, transparent 65%);
    pointer-events: none;
}
.approach-num { font-family: 'JetBrains Mono', monospace; font-size: 0.65rem; font-weight: 500; color: #ea580c; letter-spacing: 0.15em; text-transform: uppercase; min-width: 2.5rem; }
.approach-item { border-bottom: 1px solid rgba(255,255,255,0.07); padding: 1.5rem 0; }
.approach-item:first-child { padding-top: 0; }
.approach-item:last-child { border-bottom: none; padding-bottom: 0; }
.approach-item:hover .approach-title { color: #f97316; }
.approach-title { font-family: 'Barlow', sans-serif; font-weight: 700; font-size: 1.1rem; color: #f5f5f5; transition: color 0.2s; line-height: 1.3; }
.approach-desc { font-size: 0.875rem; color: #737373; line-height: 1.6; margin-top: 0.4rem; }
.approach-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.approach-tag { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; background: rgba(249,115,22,0.1); border: 1px solid rgba(249,115,22,0.2); color: #ea580c; padding: 0.2rem 0.55rem; border-radius: 0.25rem; }

/* ── Dark metrics strip ── */
.metrics-strip { background: #0f0f0f; border-top: 1px solid rgba(255,255,255,0.06); border-bottom: 1px solid rgba(255,255,255,0.06); }
.metric-item { border-right: 1px solid rgba(255,255,255,0.07); padding: 2.5rem 2rem; text-align: center; }
.metric-item:last-child { border-right: none; }
.metric-val { font-family: 'JetBrains Mono', monospace; font-size: clamp(1.875rem, 3.5vw, 2.75rem); font-weight: 500; color: #f97316; line-height: 1; }
.metric-label { font-family: 'Manrope', sans-serif; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: #525252; margin-top: 0.6rem; }

/* ── Dark section headline helper ── */
.section-h2-dark { font-family: 'Barlow', sans-serif; font-weight: 800; font-size: clamp(1.875rem, 3.5vw, 2.75rem); color: #f5f5f5; line-height: 1.1; }

/* === From: template-building-intelligence.php === */
/* Note: body{font-family}, .text-gradient, .text-gradient-orange, .engineer-grid
   are covered by page-theme.css / design-system.css and skipped here. */

/* Interaction Classes */
.hover-reveal .hidden-content {
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.5s ease;
}

.hover-reveal:hover .hidden-content {
    height: auto;
    opacity: 1;
    margin-top: 1rem;
}

.card-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.card-shadow:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    transform: translateY(-4px);
    border-color: #f97316;
}

/* SVG Animations */
.node-circle {
    transition: all 0.3s ease;
    transform-origin: center;
}

.node-circle:hover {
    r: 8;
    fill: #f97316;
    filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.6));
}

.connection-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: dash 3s linear forwards;
    opacity: 0.2;
    transition: opacity 0.3s;
}

.node-group:hover .connection-line {
    opacity: 0.6;
    stroke: #f97316;
}

@keyframes dash {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes pulse-opacity {
    0%, 100% { opacity: 0.3; }
    50%       { opacity: 1; }
}

.active-pulse {
    animation: pulse-opacity 2s infinite;
}

/* Process section: animated dot along connector lines */
@keyframes dotTravel {
    0%   { left: -8px; opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { left: calc(100% + 8px); opacity: 0; }
}
.dot-travel {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ea580c;
    box-shadow: 0 0 10px rgba(234, 88, 12, 0.9);
    animation: dotTravel 2.5s ease-in-out infinite;
}
@keyframes dotTravelV {
    0%   { top: -8px; opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { top: calc(100% + 8px); opacity: 0; }
}
.dot-travel-v {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ea580c;
    box-shadow: 0 0 10px rgba(234, 88, 12, 0.9);
    animation: dotTravelV 2.5s ease-in-out infinite;
}

/* Problem section — building intelligence hub SVG */
@keyframes biFloat {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-8px); }
}
@keyframes biPulse {
    0%, 100% { opacity: 0.8; }
    50%       { opacity: 0.2; }
}
.bi-float-a { animation: biFloat 4.0s ease-in-out 0.0s infinite; }
.bi-float-b { animation: biFloat 5.0s ease-in-out 1.2s infinite; }
.bi-float-c { animation: biFloat 3.5s ease-in-out 0.6s infinite; }
.bi-pulse   { animation: biPulse 3.0s ease-in-out 0.0s infinite; }

/* === From: template-ac-remote-monitoring.php === */
@keyframes screenGlow { 0%,100% { opacity: 0.85; } 50% { opacity: 1; } }
.screen-glow { animation: screenGlow 3s ease-in-out infinite; }
@keyframes dataStream { 0% { stroke-dashoffset: 40; } 100% { stroke-dashoffset: 0; } }
.data-stream { animation: dataStream 2s linear infinite; stroke-dasharray: 8 12; }
@keyframes alertBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.alert-blink { animation: alertBlink 1.5s ease-in-out infinite; }

/* ── Mobile guards: hide decorative floaters that cause overflow / dead space ── */
@media (max-width: 767px) {
    /* BI hero image with scan animation + floating metric badge cards */
    .bi-hero-img-wrap { display: none; }
    .bi-badge { display: none; }
}
