/* ==========================================================================
   BTP Explorer - Interactive Situations & Frictions Map
   ========================================================================== */

.btp-explorer {
  display: block;
  border: 1px solid #22384a;
  border-radius: 20px;
  overflow: hidden;
  background: #09131d;
  margin: 2.5rem 0 3.5rem;
  text-align: left;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(66, 218, 218, 0.08);
}

/* 1. Top Categories Navigation Tabs */
.btp-categories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 16px 20px;
  background: #060e16;
  border-bottom: 1px solid #1c3144;
}

.btp-cat-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: inherit;
  background: #0d1e2d;
  border: 1px solid #1f384f;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.25s ease;
  position: relative;
}

.btp-cat-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.btp-cat-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.btp-cat-text strong {
  color: #d1e2f0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.btp-cat-text small {
  color: #728ea4;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btp-cat-btn:hover {
  background: #12283c;
  border-color: #386180;
  transform: translateY(-1px);
}

.btp-cat-btn[aria-pressed="true"] {
  background: #113447;
  border-color: #38d6de;
  box-shadow: 0 0 0 1px #38d6de, 0 4px 16px rgba(56, 214, 222, 0.2);
}

.btp-cat-btn[aria-pressed="true"] .btp-cat-text strong {
  color: #ffffff;
}

.btp-cat-btn[aria-pressed="true"] .btp-cat-text small {
  color: #5ce6ed;
}

.btp-cat-btn:focus-visible {
  outline: 3px solid #38d6de;
  outline-offset: 2px;
}

/* 2. Active Scene Hero Header (Location, Friction, Quote & Description) */
.btp-scene-hero {
  padding: 24px 28px 20px;
  background: linear-gradient(180deg, #091826 0%, #0c1e30 100%);
  border-bottom: 1px solid #1c3347;
  position: relative;
}

.btp-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.btp-hero-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btp-badge-place {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(56, 214, 222, 0.12);
  border: 1px solid rgba(56, 214, 222, 0.4);
  border-radius: 20px;
  color: #38d6de;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.btp-dot {
  width: 7px;
  height: 7px;
  background: #38d6de;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #38d6de;
}

.btp-badge-theme {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 20px;
  color: #fbbf24;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.btp-hero-hint {
  color: #68859e;
  font-size: 12px;
  font-style: italic;
}

.btp-hero-quote {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.35;
  color: #f8fafc;
  margin: 0 0 10px;
  font-family: inherit;
  letter-spacing: -0.3px;
}

.btp-hero-desc {
  font-size: 14px;
  line-height: 1.65;
  color: #9bb4c7;
  margin: 0;
  max-width: 900px;
}

/* 3. Map Canvas Area */
.btp-map-area {
  min-width: 0;
  background: radial-gradient(ellipse at 50% 45%, #182d3e 0%, #0a1724 75%);
  padding: 24px 20px 20px;
  position: relative;
}

.btp-world {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
}

.btp-map {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
}

/* Pins on Map */
.btp-pin {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0f2436;
  border: 1px solid #3c5e77;
  border-radius: 24px;
  padding: 8px 14px;
  color: #eaf3f9;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.25s ease;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btp-pin-beacon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #60889f;
  position: relative;
  flex-shrink: 0;
}

.btp-pin:hover {
  background: #173b54;
  border-color: #4ed9df;
  transform: translateY(-2px);
}

.btp-pin[aria-pressed="true"] {
  background: #13455a;
  border-color: #38d6de;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(56, 214, 222, 0.25), 0 8px 20px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
}

.btp-pin[aria-pressed="true"] .btp-pin-beacon {
  background: #38d6de;
  box-shadow: 0 0 10px #38d6de;
}

.btp-pin[aria-pressed="true"] .btp-pin-beacon::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 1.5px solid #38d6de;
  animation: btp-pulse 1.8s infinite;
}

@keyframes btp-pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.btp-pin-bureau { left: 8%; top: 16%; }
.btp-pin-atelier { left: 64%; top: 7%; }
.btp-pin-direction { left: 3%; top: 62%; }
.btp-pin-chantier { left: 68%; top: 80%; }

.btp-building-targets path {
  fill: transparent;
  stroke: transparent;
  stroke-width: 2;
  cursor: pointer;
  transition: fill 0.2s, stroke 0.2s;
}

.btp-building-targets path:hover {
  fill: rgba(56, 214, 222, 0.1);
  stroke: rgba(56, 214, 222, 0.5);
}

.btp-explorer[data-scene="bureau"] [data-building="bureau"],
.btp-explorer[data-scene="atelier"] [data-building="atelier"],
.btp-explorer[data-scene="direction"] [data-building="direction"],
.btp-explorer[data-scene="chantier"] [data-building="chantier"] {
  stroke: rgba(56, 214, 222, 0.8);
}

/* 4. Timeline & Interactive Stepper */
.btp-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 820px;
  margin: 20px auto 14px;
}

.btp-timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #0e2030;
  border: 1px solid #1f3b52;
  border-radius: 12px;
  padding: 12px 14px;
  color: #9db5c8;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}

.btp-timeline-item:hover {
  background: #142d42;
  border-color: #386f8a;
  color: #f0f6fa;
}

.btp-timeline-item[aria-pressed="true"] {
  background: #113448;
  color: #ffffff;
}

.btp-timeline-item.btp-stage-0[aria-pressed="true"] {
  border-color: #f87171;
  box-shadow: 0 0 16px rgba(248, 113, 113, 0.2);
}

.btp-timeline-item.btp-stage-1[aria-pressed="true"] {
  border-color: #38d6de;
  box-shadow: 0 0 16px rgba(56, 214, 222, 0.2);
}

.btp-timeline-item.btp-stage-2[aria-pressed="true"] {
  border-color: #34d399;
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.2);
}

.btp-timeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btp-timeline-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #183348;
  border: 1px solid #2d516e;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #cde1f0;
  font-weight: 800;
  flex-shrink: 0;
}

.btp-stage-0[aria-pressed="true"] .btp-timeline-badge {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.btp-stage-1[aria-pressed="true"] .btp-timeline-badge {
  background: #38d6de;
  color: #061e27;
  border-color: #38d6de;
}

.btp-stage-2[aria-pressed="true"] .btp-timeline-badge {
  background: #10b981;
  color: #042419;
  border-color: #10b981;
}

.btp-timeline-title {
  font-size: 13px;
  font-weight: 700;
}

.btp-progress-track {
  height: 4px;
  width: 100%;
  background: #152b3d;
  border-radius: 4px;
  overflow: hidden;
}

.btp-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  transition: width 0.1s linear;
}

.btp-stage-0 .btp-progress-fill { background: #ef4444; }
.btp-stage-1 .btp-progress-fill { background: #38d6de; }
.btp-stage-2 .btp-progress-fill { background: #10b981; }

/* 5. Synchronized Active Scene Caption */
.btp-caption-box {
  max-width: 820px;
  margin: 0 auto;
  padding: 14px 18px;
  background: rgba(10, 24, 38, 0.7);
  border: 1px solid #1c364d;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.btp-caption-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btp-tag-stage-0 {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.btp-tag-stage-1 {
  background: rgba(56, 214, 222, 0.15);
  border: 1px solid rgba(56, 214, 222, 0.4);
  color: #38d6de;
}

.btp-tag-stage-2 {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.btp-caption {
  font-size: 13.5px;
  line-height: 1.55;
  color: #d8e8f4;
  margin: 0;
}

/* 6. Three Detailed Step Cards Below */
.btp-copy-section {
  padding: 24px 28px 30px;
  background: #07121b;
  border-top: 1px solid #1c3144;
}

.btp-copy-intro {
  margin-bottom: 16px;
}

.btp-copy-lead {
  font-size: 13px;
  font-weight: 600;
  color: #8da4b8;
  letter-spacing: 0.3px;
}

.btp-copy-lead strong {
  color: #38d6de;
}

.btp-original-copy {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.btp-copy-card {
  padding: 20px;
  border: 1px solid #1c344a;
  border-radius: 14px;
  background: #0a1826;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.btp-card-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.btp-card-phase-btn {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 16px;
  font-family: inherit;
  font-size: 10.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 700;
  background: #0f2436;
  border: 1px solid #284762;
  color: #92b0c7;
  cursor: pointer;
  text-align: left;
}

.btp-card-step-num {
  font-size: 12px;
  font-weight: 800;
  color: #3f5e77;
}

.btp-copy-0 .btp-card-phase-btn { color: #f87171; border-color: #642830; background: #261218; }
.btp-copy-1 .btp-card-phase-btn { color: #38d6de; border-color: #175463; background: #0c2733; }
.btp-copy-2 .btp-card-phase-btn { color: #34d399; border-color: #165640; background: #0d2820; }

.btp-copy-card h3 {
  font-size: 16px;
  line-height: 1.4;
  color: #f1f7fc;
  margin: 0 0 10px;
}

.btp-copy-card p {
  font-size: 13px;
  line-height: 1.65;
  color: #8fa6ba;
  margin: 0;
}

.btp-copy-card:hover {
  transform: translateY(-2px);
  border-color: #2b5070;
}

.btp-copy-card.is-current {
  background: #0f2336;
  transform: translateY(-2px);
}

.btp-copy-0.is-current {
  border-color: #f87171;
  background: #1c151c;
  box-shadow: 0 6px 20px rgba(248, 113, 113, 0.12);
}

.btp-copy-1.is-current {
  border-color: #38d6de;
  background: #0c2533;
  box-shadow: 0 6px 20px rgba(56, 214, 222, 0.12);
}

.btp-copy-2.is-current {
  border-color: #34d399;
  background: #0c2520;
  box-shadow: 0 6px 20px rgba(52, 211, 153, 0.12);
}

/* SVG Scene Animations */
#btp-action { pointer-events: none; }
.scene-bubble rect, .scene-bubble path { fill: #102b40; stroke: #3c6e86; stroke-width: 1; }
.scene-bubble text { fill: #e4f2f9; font-size: 10px; font-weight: 600; font-family: inherit; }
.scene-bubble.problem rect, .scene-bubble.problem path { fill: #462733; stroke: #df7b7f; }
.scene-bubble.solution rect, .scene-bubble.solution path { fill: #103e4d; stroke: #42dddd; }
.scene-bubble.success rect, .scene-bubble.success path { fill: #163c36; stroke: #51dcb4; }
.scene-paper { filter: drop-shadow(0 4px 4px rgba(7, 21, 34, 0.3)); }
.scene-arrive { animation: scene-delivery 2.5s ease-in-out both; animation-delay: var(--delay, 0s); }
.scene-transfer { animation: scene-delivery 3.8s ease-in-out both; animation-delay: var(--delay, 0s); }
.scene-copy { animation: scene-delivery 2s ease-in-out infinite alternate; animation-delay: var(--delay, 0s); }
.scene-search { animation: scene-search 1.8s ease-in-out infinite; }
.scene-clock-hand { animation: scene-rotate 2s linear infinite; }
.scene-gear { animation: scene-rotate 3s linear infinite; }
.scene-wire { animation: scene-dashes 1s linear infinite; }
.scene-check, .scene-reveal { animation: scene-check .5s ease-out both; animation-delay: var(--delay, 0s); }
.scene-expert-leaves { animation: scene-leave 4s ease-in-out both; }
.scene-question { fill: #ffcf82; font: bold 32px sans-serif; animation: scene-question 1.3s ease-in-out infinite; }
.scene-tool { transform-box: fill-box; transform-origin: bottom left; animation: scene-hammer .7s ease-in-out infinite alternate; }
.scene-person-work { animation: scene-search 1.5s ease-in-out infinite; }
.scene-return-to-work { animation: scene-work 4s ease-in-out both; }
.scene-paused #btp-action * { animation-play-state: paused !important; }

@keyframes scene-delivery {
  0% { opacity: 0; transform: translate(0, 0) scale(0.85); }
  15% { opacity: 1; transform: translate(0, 0) scale(1); }
  85%, 100% { opacity: 1; transform: translate(var(--dx), var(--dy)); }
}

@keyframes scene-search {
  0%, 100% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
}

@keyframes scene-rotate { to { transform: rotate(360deg); } }
@keyframes scene-dashes { to { stroke-dashoffset: -28; } }
@keyframes scene-check { from { opacity: 0; transform: scale(0.2); } to { opacity: 1; transform: scale(1); } }
@keyframes scene-leave { 0%, 10% { opacity: 1; transform: translate(0, 0); } 100% { opacity: 0.1; transform: translate(-160px, -90px); } }
@keyframes scene-question { 50% { opacity: 0.35; } }
@keyframes scene-hammer { to { transform: rotate(-25deg); } }
@keyframes scene-work { to { transform: translate(110px, -65px); } }

/* Responsive Adaptations */
@media (max-width: 900px) {
  .btp-categories {
    grid-template-columns: repeat(2, 1fr);
    padding: 12px;
  }
  .btp-original-copy {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .btp-timeline {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .btp-scene-hero {
    padding: 20px 18px 16px;
  }
  .btp-hero-quote {
    font-size: 20px;
  }
}

@media (max-width: 580px) {
  .btp-pin {
    font-size: 11px;
    padding: 6px 10px;
    gap: 6px;
  }
  .btp-pin-direction { left: 4%; }
  .btp-pin-chantier { left: 62%; }
  .btp-caption-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btp-explorer * {
    animation: none !important;
    transition: none !important;
  }
}
