/* =====================================================================
   SOLUKEN® TECH DAS — Dashboard explicatif animé
   ===================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-1: #0a1628;
    --bg-2: #0d1b2e;
    --panel: rgba(255, 255, 255, 0.035);
    --panel-2: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --accent: #ff4d3d;
    --accent-2: #e8483a;
    --secondary: #5b7a9e;
    --text: #ffffff;
    --muted: #9fb3c8;
    --muted-2: #6c85a0;
    --radius: 10px;
    --font: 'Space Grotesk', 'Inter', 'Segoe UI', system-ui, sans-serif;
}

html, body {
    min-height: 100%;
}

body {
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(ellipse at 50% -20%, #12294a 0%, transparent 60%),
        linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 100%);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- sky of tiny white dots --- */
.stars {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.55;
}
.stars span {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #cfe0f2;
    opacity: 0.8;
}

.wrap {
    position: relative;
    z-index: 1;
    max-width: 1160px;
    margin: 0 auto;
    padding: 22px 18px 60px;
}

/* =====================================================================
   HEADER
   ===================================================================== */
.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 4px 18px;
    border-bottom: 1px solid var(--border-strong);
    margin-bottom: 20px;
}
.brand {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.brand-word {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    white-space: nowrap;
}
.brand-word em { font-style: normal; color: var(--accent); }
.brand-sub {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2.4px;
    color: var(--secondary);
    text-transform: uppercase;
}
.badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    flex-shrink: 0;
    box-shadow: 0 6px 24px rgba(255, 77, 61, 0.10);
}
.badge-logo {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #fff;
    font-size: 14px;
}
.badge-name {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.6px;
}
.badge-name small {
    display: block;
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 1.6px;
    color: var(--secondary);
    margin-top: 1px;
}

/* =====================================================================
   GRID / PANELS
   ===================================================================== */
.grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
    margin-bottom: 16px;
}
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    position: relative;
}
.panel-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2.4px;
    color: var(--muted);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-label .sub {
    color: var(--secondary);
    font-weight: 500;
    letter-spacing: 1.2px;
    text-transform: none;
}
.panel-label .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(255, 77, 61, 0.8);
}

/* --- top view panel --- */
.topview { grid-column: 1 / 2; grid-row: 1 / 2; }
.zoom { grid-column: 2 / 3; grid-row: 1 / 2; }
.signal { grid-column: 1 / 3; grid-row: 2 / 3; }

.svg-box {
    width: 100%;
    height: auto;
    display: block;
    margin-top: 12px;
}
.svg-box text {
    font-family: var(--font);
    fill: var(--muted);
}

/* cable points */
.pt { transition: opacity 0.5s ease, r 0.5s ease; }
.dim { opacity: 0.25; }

/* intruder silhouette */
.intruder {
    transform-origin: 50% 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.halo {
    transform-origin: 50% 50%;
    animation: haloPulse 2.2s ease-out infinite;
}
@keyframes haloPulse {
    0%   { transform: translate(50%,50%) scale(0.6);  opacity: 0.9; }
    100% { transform: translate(50%,50%) scale(2.4);  opacity: 0; }
}

/* laser impulse travelling through points */
.impulse {
    transition: transform 0.6s linear, opacity 0.4s ease;
}
@keyframes pulseGlow {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
}

/* magnification connector */
.connector line { stroke: var(--secondary); stroke-width: 1; stroke-dasharray: 3 4; }
@keyframes dashMove { to { stroke-dashoffset: -14; } }
.connector line { animation: dashMove 1.4s linear infinite; }

/* zoom context labels */
.zoom-labels {
    list-style: none;
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
    display: grid;
    gap: 4px;
    transition: opacity 0.4s ease;
}
.zoom-labels li {
    display: flex;
    align-items: center;
    gap: 7px;
    opacity: 0.5;
    transition: opacity 0.5s ease, color 0.5s ease;
}
.zoom-labels li::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--secondary);
    flex-shrink: 0;
}
.zoom-labels li.active { opacity: 1; color: #fff; }
.zoom-labels li.alert { opacity: 1; color: var(--accent); }
.zoom-labels li.alert::before { background: var(--accent); box-shadow: 0 0 8px rgba(255,77,61,.8); }

/* =====================================================================
   STEP COUNTER
   ===================================================================== */
.stepbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 14px 18px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 74px;
}
.step-progress {
    flex-shrink: 0;
    width: 132px;
    height: 6px;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}
.step-progress i {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
    border-radius: 6px;
    transition: width 0.4s cubic-bezier(.4,0,.2,1);
}
.counter {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 26px;
    line-height: 1;
}
.counter .n {
    font-size: 40px;
    font-weight: 800;
    color: var(--accent);
    -webkit-text-stroke: 1px rgba(255,77,61,.25);
}
.counter .of { color: var(--secondary); font-size: 18px; font-weight: 600; }
.steptext {
    flex: 1;
    font-size: 16px;
    color: var(--text);
    line-height: 1.5;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.steptext.slide { opacity: 0; transform: translateY(8px); }

/* dots indicator */
.step-dots {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.step-dots b {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--border-strong);
    transition: all 0.3s ease;
}
.step-dots b.on {
    background: var(--accent);
    box-shadow: 0 0 8px rgba(255,77,61,.8);
    transform: scale(1.25);
}

/* =====================================================================
   SIGNAL CHART
   ===================================================================== */
.signal-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--muted);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.signal-title .sub { color: var(--secondary); font-weight: 500; letter-spacing: .5px; text-transform: none; }
.echo-hint {
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--secondary);
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.echo-hint.show { opacity: 1; }

/* =====================================================================
   ALERT (step 5)
   ===================================================================== */
.alert-box {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    background: rgba(215, 55, 45, 0.92);
    border: 1px solid rgba(255, 120, 110, 0.8);
    border-radius: var(--radius);
    padding: 10px 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,.4), 0 0 18px rgba(255,77,61,.45);
    transform: translateY(-12px);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    pointer-events: none;
}
.alert-box.show { transform: translateY(0); opacity: 1; }
.alert-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #fff;
    white-space: nowrap;
}
.alert-title .pulse-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: #fff;
    animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0.2; } }
.alert-text { font-size: 12px; color: #ffe9e5; margin-top: 4px; letter-spacing: .4px; }
.alert-text b { color: #fff; font-weight: 700; }
.alert-prec { font-size: 10px; color: #ffc9c2; letter-spacing: 1px; margin-top: 2px; }

/* =====================================================================
   CONTROLS
   ===================================================================== */
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}
.btn-nav {
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 8px 16px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .5px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-nav:hover:not(:disabled) {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,.3);
}
.btn-nav:hover:not(:disabled) span { color: var(--accent); }
.btn-nav:disabled { opacity: 0.4; cursor: default; }
.btn-play {
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    border: none;
    width: 44px; height: 44px;
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 18px rgba(255,77,61,.4);
}
.btn-play:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(255,77,61,.55); }
.btn-play svg { width: 16px; height: 16px; display: block; }

/* anim pause on hover of the whole dashboard */
.pause-on-hover:hover .cluster { animation-play-state: paused; }

/* fade/slide helpers */
svg * { transition: opacity 0.5s ease; }
.fade { transition: opacity 0.5s ease; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 820px) {
    .grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .topview, .zoom, .signal { grid-column: 1 / 2; }
    .topview { grid-row: auto; }
    .zoom { grid-row: auto; }
    .signal { grid-row: auto; }
    .brand-word { font-size: 19px; }
    .brand-sub { font-size: 8px; letter-spacing: 1.6px; }
    .stepbar { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .wrap { padding: 14px 12px 50px; }
    .badge-name small { display: none; }
    .counter .n { font-size: 32px; }
    .steptext { font-size: 14px; }
    .alert-box { top: 8px; right: 8px; padding: 8px 10px; }
}
