/* ==========================================================================
   SECTION 10: SMART PILOT (TSS 3.0)
   ========================================================================== */
.sp-section {
  --sp-cyan: var(--cyan);
  --sp-cyan-glow: rgba(0,229,255,0.25);
  --sp-elevated: #141414;
  --sp-muted: #888888;
  background:
    radial-gradient(ellipse at 50% 15%, rgba(0,229,255,0.03) 0%, transparent 60%),
    linear-gradient(to top, #070707 0%, #0d1117 40%, #111820 70%, #151d26 100%);
  color: var(--white);
  padding: 32px 18px;
}
.sp-section .section-inner {
  max-width: var(--container);
  margin: 0 auto;
}

/* --- Header (int-hero cinematic pattern) --- */
.sp-header { margin-bottom: 48px; }
.sp-header .eyebrow {
  color: var(--sp-cyan);
}
.sp-header .eyebrow-hr {
  margin: 0 0 24px;
}
.sp-header .heading-02 {
  color: #fff;
  max-width: 700px;
}
.sp-header .body-02 {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-top: 16px;
  max-width: 500px;
}

/* --- Layout (grid on desktop) --- */
.sp-layout { display: block; }

/* --- Video area --- */
.sp-video {
  position: relative; border-radius: var(--radius-card-sm); overflow: hidden;
  aspect-ratio: 16 / 9; background: #080808; margin-bottom: 4px;
}
.sp-video video, .sp-video img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}

/* --- Shimmer placeholder --- */
.sp-video__placeholder {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, #111 0%, #1a1a1a 50%, #111 100%);
  background-size: 200% 200%; animation: sfShimmer 3s ease infinite;
  display: flex; align-items: center; justify-content: center; z-index: 1;
}
.sp-video__placeholder span {
  font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.15);
  text-transform: uppercase; letter-spacing: 0.1em;
}

/* --- HUD overlay --- */
.sp-hud {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    radial-gradient(ellipse at 50% 80%, rgba(0,229,255,0.06) 0%, transparent 50%),
    linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 40%);
}

/* --- HUD corners --- */
.sp-hud__corner { position: absolute; width: 14px; height: 14px; }
.sp-hud__corner--tl { top: 8px; left: 8px; border-top: 1px solid rgba(0,229,255,0.3); border-left: 1px solid rgba(0,229,255,0.3); }
.sp-hud__corner--tr { top: 8px; right: 8px; border-top: 1px solid rgba(0,229,255,0.3); border-right: 1px solid rgba(0,229,255,0.3); }
.sp-hud__corner--bl { bottom: 32px; left: 8px; border-bottom: 1px solid rgba(0,229,255,0.3); border-left: 1px solid rgba(0,229,255,0.3); }
.sp-hud__corner--br { bottom: 32px; right: 8px; border-bottom: 1px solid rgba(0,229,255,0.3); border-right: 1px solid rgba(0,229,255,0.3); }

/* --- Sensor arcs --- */
.sp-arc { position: absolute; border: 1px solid rgba(0,229,255,0.12); border-radius: 50%; border-bottom: none; left: 50%; transform: translateX(-50%); }
.sp-arc--1 { width: 70px; height: 70px; bottom: -14px; }
.sp-arc--2 { width: 120px; height: 120px; bottom: -40px; opacity: 0.6; }
.sp-arc--3 { width: 180px; height: 180px; bottom: -70px; opacity: 0.3; }

/* --- Active sensor label --- */
.sp-sensor-label { position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 5px; z-index: 2; }
.sp-sensor-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px rgba(0,229,255,0.5); animation: spPulse 2s ease-in-out infinite; }
.sp-sensor-text { font-size: 8px; font-weight: 600; color: var(--cyan); background: rgba(0,229,255,0.08); padding: 2px 7px; border-radius: 8px; border: 1px solid rgba(0,229,255,0.2); white-space: nowrap; }

/* --- NCAP badge --- */
.sp-ncap { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid rgba(0,229,255,0.15); border-radius: 6px; padding: 3px 7px; display: flex; align-items: center; gap: 3px; z-index: 2; }
.sp-ncap__stars { color: var(--metallic); font-size: 8px; letter-spacing: 1px; }
.sp-ncap__text { color: var(--white); font-size: 7px; font-weight: 600; }

/* --- YouTube chapters bar --- */
.sp-chapters { position: absolute; bottom: 0; left: 0; right: 0; padding: 7px 10px; background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%); display: flex; align-items: center; gap: 8px; z-index: 3; }
.sp-play { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,0.1); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.2s ease; }
.sp-play:hover { background: rgba(255,255,255,0.2); }
.sp-play::after { content: ''; display: block; width: 0; height: 0; border-left: 6px solid white; border-top: 4px solid transparent; border-bottom: 4px solid transparent; margin-left: 2px; }
.sp-chapters__track { flex: 1; display: flex; gap: 2px; height: 3px; }
.sp-chapters__seg { flex: 1; background: #1a1a1a; border-radius: 1px; overflow: hidden; cursor: pointer; position: relative; transition: height 0.2s ease, margin-top 0.2s ease; }
.sp-chapters__seg:hover { height: 6px; margin-top: -1.5px; }
.sp-chapters__fill { height: 100%; background: var(--cyan); border-radius: 1px; width: 0; }
.sp-chapters__seg--active .sp-chapters__fill { animation: spChapterFill 6s linear forwards; }
.sp-chapters__seg--done .sp-chapters__fill { width: 100%; opacity: 0.4; }
.sp-counter { color: rgba(255,255,255,0.5); font-size: 9px; font-weight: 500; min-width: 20px; text-align: right; flex-shrink: 0; }

/* --- Ring chips (mobile) --- */
.sp-rings { display: flex; justify-content: space-between; padding: 10px 0 12px; gap: 2px; }
.sp-ring { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; cursor: pointer; }
.sp-ring__circle { position: relative; width: 36px; height: 36px; }
.sp-ring__circle svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.sp-ring__bg { fill: none; stroke: #1a1a1a; stroke-width: 3; }
.sp-ring__progress { fill: none; stroke: var(--sp-cyan); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 141.37; stroke-dashoffset: 141.37; }
.sp-ring--active .sp-ring__progress { animation: spRingFill 6s linear forwards; }
.sp-ring--done .sp-ring__progress { stroke-dashoffset: 0; opacity: 0.3; }
.sp-ring__icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 24px; height: 24px; border-radius: 50%; background: #111; border: 1px solid #222; display: flex; align-items: center; justify-content: center; font-size: 9px; color: #555; transition: all 0.3s; }
.sp-ring--active .sp-ring__icon { background: rgba(0,229,255,0.12); border-color: rgba(0,229,255,0.4); color: var(--cyan); }
.sp-ring--done .sp-ring__icon { background: rgba(0,229,255,0.05); border-color: rgba(0,229,255,0.15); color: rgba(0,229,255,0.4); }
.sp-ring__label { font-size: 8px; color: #555; font-weight: 500; }
.sp-ring--active .sp-ring__label { color: var(--cyan); font-weight: 600; }
.sp-ring--done .sp-ring__label { color: rgba(0,229,255,0.4); }

/* --- Detail card --- */
.sp-detail { background: rgba(20,20,20,0.8); border-radius: 10px; padding: 16px; border: 1px solid #1a1a1a; transition: opacity 0.15s ease; }
.sp-detail__tag { color: var(--sp-cyan); font-family: var(--font-display); font-size: var(--tag-size); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tag-spacing); margin-bottom: 5px; }
.sp-detail__title { color: var(--white); font-size: 16px; font-weight: 600; margin-bottom: 5px; font-family: var(--font-display); }
.sp-detail__desc { color: var(--sp-muted); font-size: 12px; line-height: 1.6; }

/* --- Sidebar (desktop only) --- */
.sp-sidebar { display: none; }
.sp-sidebar__item { background: #111; border-radius: 10px; padding: 12px; border: 1px solid #1a1a1a; cursor: pointer; display: flex; gap: 10px; transition: all 0.3s; }
.sp-sidebar__item--active { background: rgba(0,229,255,0.04); border-color: rgba(0,229,255,0.15); }
.sp-sidebar__ring { position: relative; width: 40px; height: 40px; flex-shrink: 0; }
.sp-sidebar__num { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #333; font-family: var(--font-display); font-size: 13px; font-weight: 700; }
.sp-sidebar__item--active .sp-sidebar__num { color: var(--cyan); }
.sp-sidebar__item--done .sp-sidebar__num { color: rgba(0,229,255,0.4); }
.sp-sidebar__name { color: #666; font-size: 11px; font-weight: 600; }
.sp-sidebar__item--active .sp-sidebar__name { color: var(--white); }
.sp-sidebar__desc { color: #888; font-size: 10px; line-height: 1.5; margin-top: 2px; display: none; }
.sp-sidebar__item--active .sp-sidebar__desc { display: block; }
.sp-sidebar__progress {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 141.37;
  stroke-dashoffset: 141.37;
  transform: rotate(-90deg);
  transform-origin: center;
}

/* --- Keyframes --- */
@keyframes spPulse { 0%, 100% { opacity: 0.6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.4); } }
@keyframes spRingFill { from { stroke-dashoffset: 141.37; } to { stroke-dashoffset: 0; } }
@keyframes spChapterFill { from { width: 0; } to { width: 100%; } }

/* --- Tablet (768px+) --- */
@media (min-width: 768px) {
  .sp-section { padding: var(--pad-y) var(--pad-x); }
  .sp-ring__circle { width: 42px; height: 42px; }
  .sp-ring__icon { width: 28px; height: 28px; }
  .sp-video { aspect-ratio: 16 / 10; }
  .sp-detail__title { font-size: 15px; }
  .sp-detail__desc { font-size: 12px; }
}
/* --- Desktop (1024px+) --- */
@media (min-width: 1024px) {
  .sp-section { padding: var(--pad-y) var(--pad-x); }
  .sp-header .heading-02 { max-width: 800px; }
  .sp-header .body-02 { max-width: 560px; }
  .sp-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }
  .sp-rings { display: none; }
  .sp-sidebar { display: flex; flex-direction: column; gap: 6px; }
  .sp-detail { display: none; }
  .sp-video { aspect-ratio: 16 / 10; }
}
/* --- Large desktop (1200px+) --- */
@media (min-width: 1200px) {
  .sp-section { padding: var(--pad-y) var(--pad-x); }
  .sp-layout { grid-template-columns: 1fr 340px; }
}

/* Keep sfShimmer for backward compat */
@keyframes sfShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
