/*
 * pages-tools.css
 * Styles for the Tools Hub and all individual tool calculator pages.
 *   template-tools.php, template-tools-chiller.php, template-tools-delta-t.php,
 *   template-tools-energy-savings.php, template-tools-hvac-load.php,
 *   template-tools-network-bandwidth.php, template-tools-roi.php,
 *   template-tools-unit-converter.php, template-tools-voltage-drop.php
 *
 * @package Prysmedge
 */

/* === From: template-tools.php === */

/* ── CUBE ANIMATION — scoped to #cube-hero to prevent design-system.css conflicts ── */
/* design-system.css defines .cube-scene/.cube-unit with flex/animation/skew that break this.
   Scoping with #cube-hero fully overrides those globally-loaded styles. */

/* Desktop-only: hide on mobile (also enforced via hidden lg:flex on the container) */
@media (max-width: 1023px) {
    #cube-hero { display: none !important; }
}

#cube-hero .cube-scene {
    position: relative;
    top: -60px;
    transform: skewY(-20deg);
    display: block;   /* reset design-system.css display: flex */
    gap: unset;
}

#cube-hero .cube-group {
    position: relative;
    z-index: 2;
    display: block;   /* reset design-system.css display: flex */
    gap: unset;
}
#cube-hero .cube-group:nth-child(2) {
    z-index: 1;
    translate: -60px -60px;
}
#cube-hero .cube-group:nth-child(3) {
    z-index: 3;
    translate: 60px 60px;
}

#cube-hero .cube-col {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 30px;
    translate: calc(-70px * var(--x)) calc(-60px * var(--y));
}

#cube-hero .cube-unit {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 50px;
    background: #e5e5e5;
    z-index: calc(1 * var(--i));
    transition: background 1.5s ease, filter 1.5s ease;
    transform: none;    /* reset design-system.css skewY(-20deg) on each unit */
    animation: none;    /* reset design-system.css cubeFloat / facePulse */
}
#cube-hero .cube-unit:hover {
    transition: background 0s, filter 0s;
    background: #f97316;
    filter: drop-shadow(0 0 28px rgba(249, 115, 22, 0.75));
}

#cube-hero .cube-unit::before {
    content: "";
    position: absolute;
    top: 0;         /* reset design-system.css top: -8px */
    right: auto;    /* reset any right value from design-system.css */
    left: -40px;
    width: 40px;
    height: 100%;
    background: #d0d0d0;
    transform-origin: right;
    transform: skewY(45deg);
    transition: background 1.5s ease;
}
#cube-hero .cube-unit:hover::before {
    transition: background 0s;
    background: #ea580c;
}

#cube-hero .cube-unit::after {
    content: "";
    position: absolute;
    top: -40px;
    right: auto;    /* reset design-system.css right: -14px */
    left: 0;
    width: 100%;
    height: 40px;
    background: #f0f0f0;
    transform-origin: bottom;
    transform: skewX(45deg);
    transition: background 1.5s ease;
}
#cube-hero .cube-unit:hover::after {
    transition: background 0s;
    background: #fb923c;
}

/* ── PREMIUM TOOL CARDS ─────────────────────── */
.tool-card {
    background: #0f0f0f;
    border: 1px solid #1e1e1e;
    border-radius: 1.25rem;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    min-height: 320px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.35s ease, box-shadow 0.35s ease;
    text-decoration: none;
    cursor: pointer;
}

.tool-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1.75rem;
    bottom: 1.75rem;
    width: 2px;
    background: #f97316;
    border-radius: 0 2px 2px 0;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.tool-card:hover {
    border-color: #2a2a2a;
    box-shadow: 0 12px 48px rgba(249, 115, 22, 0.06), 0 2px 8px rgba(0,0,0,0.4);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-num {
    position: absolute;
    top: 0.75rem;
    right: 1.25rem;
    font-size: 4.5rem;
    font-weight: 800;
    font-family: 'Barlow', sans-serif;
    color: #1c1c1c;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    letter-spacing: -0.02em;
}

.tool-cat {
    font-size: 0.6rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #4a4a4a;
    border: 1px solid #222;
    padding: 0.2rem 0.55rem;
    border-radius: 0.25rem;
    display: inline-block;
    margin-bottom: 1.5rem;
    width: fit-content;
}

.tool-icon {
    width: 42px;
    height: 42px;
    background: #151515;
    border: 1px solid #252525;
    border-radius: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f97316;
    margin-bottom: 1rem;
    flex-shrink: 0;
    transition: background 0.35s ease, border-color 0.35s ease;
}

.tool-card:hover .tool-icon {
    background: #1d0c00;
    border-color: #3d1800;
}

.tool-title {
    font-family: 'Barlow', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.tool-desc {
    font-size: 0.83rem;
    color: #5a5a5a;
    line-height: 1.65;
    flex-grow: 1;
    font-weight: 300;
}

.tool-cta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.62rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #f97316;
    margin-top: 1.5rem;
}

.tool-cta-arrow {
    transition: transform 0.25s ease;
    width: 12px;
    height: 12px;
}

.tool-card:hover .tool-cta-arrow {
    transform: translateX(4px);
}

/* ── TOOLS SECTION HEADER ───────────────────── */
.tools-section-kicker {
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #f97316;
    display: block;
    margin-bottom: 0.75rem;
}

/* ── TRUST PILLS ────────────────────────────── */
.trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.1em;
    color: #4a4a4a;
    border: 1px solid #222;
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
}

.trust-pill-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #f97316;
}

/* === From: template-tools-chiller.php === */
@keyframes refrigFlow { 0%{stroke-dashoffset:80} 100%{stroke-dashoffset:0} }
.refrig-flow { stroke-dasharray:12 6; animation:refrigFlow 1.8s linear infinite; }
.refrig-flow.hot  { animation-duration:1.4s; }
.refrig-flow.cold { animation-duration:2.2s; }
@keyframes compPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.03)} }
.comp-unit { animation:compPulse 1.5s ease-in-out infinite; transform-origin:center; }

/* === From: template-tools-delta-t.php === */
@keyframes flowPipe { 0%{stroke-dashoffset:60} 100%{stroke-dashoffset:0} }
.pipe-flow { stroke-dasharray:10 6; animation:flowPipe 1.2s linear infinite; }
.pipe-flow.hot  { animation-duration:1.0s; }
.pipe-flow.cold { animation-duration:1.5s; animation-direction:reverse; }
@keyframes tempPulse { 0%,100%{opacity:0.7} 50%{opacity:1} }
.temp-badge { animation:tempPulse 2s ease-in-out infinite; }
.temp-badge.hot-badge  { animation-delay:0s; }
.temp-badge.cold-badge { animation-delay:0.5s; }

/* === From: template-tools-energy-savings.php === */
@keyframes energyPulse { 0%,100%{opacity:0.2;r:3} 50%{opacity:1;r:5} }
@keyframes flowDot { 0%{stroke-dashoffset:100} 100%{stroke-dashoffset:0} }
@keyframes buildingGlow { 0%,100%{filter:drop-shadow(0 0 4px rgba(234,88,12,0.2))} 50%{filter:drop-shadow(0 0 12px rgba(234,88,12,0.5))} }
.energy-dot { animation:energyPulse 2s ease-in-out infinite; }
.energy-dot:nth-child(2){animation-delay:.3s} .energy-dot:nth-child(3){animation-delay:.6s}
.energy-dot:nth-child(4){animation-delay:.9s} .energy-dot:nth-child(5){animation-delay:1.2s}
.flow-line { stroke-dasharray:8 4; animation:flowDot 1.5s linear infinite; }
.flow-line:nth-child(2){animation-delay:.5s} .flow-line:nth-child(3){animation-delay:1s}
.bld-glow { animation:buildingGlow 3s ease-in-out infinite; }

/* === From: template-tools-hvac-load.php === */
@keyframes sunRay { 0%,100%{opacity:0.4;transform:scaleY(0.8)} 50%{opacity:1;transform:scaleY(1)} }
.sun-ray { animation:sunRay 2s ease-in-out infinite; transform-origin:top center; }
.sun-ray:nth-child(2){animation-delay:.2s} .sun-ray:nth-child(3){animation-delay:.4s}
.sun-ray:nth-child(4){animation-delay:.6s} .sun-ray:nth-child(5){animation-delay:.8s}
@keyframes heatRise { 0%{opacity:0;transform:translateY(0)} 50%{opacity:0.8} 100%{opacity:0;transform:translateY(-20px)} }
.heat-rise { animation:heatRise 2.5s ease-out infinite; }
.heat-rise:nth-child(2){animation-delay:.5s} .heat-rise:nth-child(3){animation-delay:1s}
.heat-rise:nth-child(4){animation-delay:1.5s} .heat-rise:nth-child(5){animation-delay:2s}

/* === From: template-tools-network-bandwidth.php === */
@keyframes dataPacket { 0%{stroke-dashoffset:120;opacity:1} 80%{opacity:0.9} 100%{stroke-dashoffset:0;opacity:0} }
.data-packet { stroke-dasharray:8 100; animation:dataPacket 2s ease-in-out infinite; }
.data-packet:nth-child(2){animation-delay:.4s} .data-packet:nth-child(3){animation-delay:.8s}
.data-packet:nth-child(4){animation-delay:1.2s} .data-packet:nth-child(5){animation-delay:1.6s}
@keyframes nodePulse { 0%,100%{opacity:0.6;r:5} 50%{opacity:1;r:7} }
.net-node { animation:nodePulse 1.8s ease-in-out infinite; }
.net-node:nth-child(2){animation-delay:.2s} .net-node:nth-child(3){animation-delay:.4s}
.net-node:nth-child(4){animation-delay:.6s} .net-node:nth-child(5){animation-delay:.8s}

/* === From: template-tools-roi.php === */
/* ROI-specific styles (shared base in design-system.css .calc-* classes) */
.yr-row { display:flex; align-items:center; gap:10px; margin-bottom:7px; }
.yr-lbl  { width:42px; font-size:11px; font-family:'JetBrains Mono',monospace; color:var(--calc-muted); flex-shrink:0; }
.yr-track { flex:1; background:var(--calc-border-lt); border-radius:3px; height:9px; overflow:hidden; }
.yr-bar   { height:9px; border-radius:3px; min-width:2px; }
.yr-bar.neg { background:#f2b3a4; }
.yr-bar.pos { background:linear-gradient(90deg,#c94b00,#f59e0b); }
.yr-val  { width:130px; font-size:11px; font-family:'JetBrains Mono',monospace; color:var(--calc-mid); text-align:right; flex-shrink:0; }
.formula-row {
  display: flex; flex-direction: column; gap: 3px;
  padding: 11px 0;
  border-bottom: 1px solid var(--calc-border-lt);
}
.formula-row:last-child { border-bottom: none; padding-bottom: 0; }
.formula-name { font-size: 11px; color: var(--calc-muted); font-family: 'JetBrains Mono', monospace; }
.formula-expr { font-size: 12px; color: var(--calc-accent); font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.s-rule { height:1px; background:var(--calc-border-lt); margin:24px 0; }

/* === From: template-tools-unit-converter.php === */
.conv-panel { display:none; }
.conv-panel.active { display:block; }

/* === From: template-tools-voltage-drop.php === */
@keyframes currentFlow { 0%{stroke-dashoffset:80} 100%{stroke-dashoffset:0} }
.current-flow { stroke-dasharray:10 8; animation:currentFlow 1.5s linear infinite; }
@keyframes voltSine { 0%{d:path('M10,40 Q30,10 50,40 Q70,70 90,40 Q110,10 130,40 Q150,70 170,40 Q190,10 210,40')} 50%{d:path('M10,45 Q30,8 50,45 Q70,72 90,45 Q110,8 130,45 Q150,72 170,45 Q190,8 210,45')} 100%{d:path('M10,40 Q30,10 50,40 Q70,70 90,40 Q110,10 130,40 Q150,70 170,40 Q190,10 210,40')} }
@keyframes dropWave { 0%{transform:translateX(0)} 100%{transform:translateX(-30px)} }
.drop-wave { animation:dropWave 1.5s linear infinite; }
