/**
 * IELTS Writing Task 1 - 3D Isometric Viewport & HUD Stylesheet
 * Framework: Glassmorphism / Dark Modern Cyber Slate
 * File: IELTS/Writing-Hub/css/cinematic-task1-3d.css
 */

/* 2D / 3D Segmented Switcher in Task 1 Visual Card Header */
.task1-view-mode-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 9999px;
  padding: 3px;
  gap: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  margin-left: auto;
}

.btn-view-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn-view-mode:hover {
  color: #e2e8f0;
}

.btn-view-mode.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.35), rgba(56, 189, 248, 0.2));
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.btn-view-mode .sparkle-tag {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 2px;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

/* 3D Viewport Container */
.t3d-viewport-wrapper {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #0a0f1d;
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.6), 0 8px 32px rgba(0, 0, 0, 0.45);
}

.t3d-canvas {
  display: block;
  width: 100% !important;
  cursor: grab;
  outline: none;
}

.t3d-canvas:active {
  cursor: grabbing;
}

/* Glassmorphic HUD Layer */
.t3d-hud-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
}

.t3d-hud-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 6px 12px;
}

.t3d-hud-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.t3d-badge-3d {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 8px;
  border-radius: 6px;
}

.t3d-scene-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f1f5f9;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.btn-t3d-tool {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-t3d-tool:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

/* Floating 3D Tooltip */
.t3d-entity-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(56, 189, 248, 0.25);
  max-width: 240px;
  z-index: 20;
  transition: opacity 0.15s ease;
}

.t3d-tip-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.t3d-tip-desc {
  font-size: 0.72rem;
  color: #cbd5e1;
  line-height: 1.35;
}

/* Bottom Controls Bar */
.t3d-hud-bottombar {
  pointer-events: auto;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Map Time-Slider Group */
.t3d-map-timeline-control {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.t3d-timeline-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.t3d-timeline-btn-group {
  display: flex;
  gap: 8px;
}

.btn-t3d-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-t3d-step .step-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
  transition: all 0.2s ease;
}

.btn-t3d-step:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #f1f5f9;
  border-color: rgba(56, 189, 248, 0.3);
}

.btn-t3d-step.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.4), rgba(56, 189, 248, 0.2));
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.btn-t3d-step.active .step-dot {
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

/* Process Scrubber Group */
.t3d-process-scrubber-control {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.t3d-scrubber-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-t3d-step-nav {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-t3d-step-nav:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

.btn-t3d-step-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-t3d-play-toggle {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
}

.btn-t3d-play-toggle:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.45), rgba(5, 150, 105, 0.3));
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.t3d-scrubber-pills {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.btn-t3d-pill {
  flex: 1;
  min-width: 60px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 4px 6px;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.2s ease;
}

.btn-t3d-pill .pill-num {
  font-size: 0.68rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: #64748b;
}

.btn-t3d-pill .pill-name {
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 85px;
}

.btn-t3d-pill:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #cbd5e1;
}

.btn-t3d-pill.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.35), rgba(56, 189, 248, 0.15));
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.btn-t3d-pill.active .pill-num {
  color: #38bdf8;
}

/* Pedagogical Model Sentence Card */
.t3d-pedagogical-card {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.t3d-insight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.t3d-insight-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: #34d399;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.t3d-insight-grammar {
  font-size: 0.7rem;
  font-weight: 600;
  color: #f59e0b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.t3d-insight-sentence {
  font-size: 0.78rem;
  line-height: 1.4;
  color: #e2e8f0;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
}

.t3d-insight-sentence strong {
  color: #38bdf8;
}

/* Loading & Error States */
.t3d-loading, .t3d-error {
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.88rem;
  gap: 10px;
  background: #0a0f1d;
  border-radius: 14px;
}

.t3d-error {
  color: #f87171;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .t3d-hud-layer {
    padding: 8px;
  }
  .t3d-map-timeline-control {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .t3d-timeline-btn-group {
    justify-content: space-between;
  }
  .btn-t3d-step {
    flex: 1;
    justify-content: center;
  }
}

/* =================================================================
   View Mode Selector (Single Year vs Side-by-Side Comparison)
   ================================================================= */
.t3d-view-mode-selector {
  display: inline-flex;
  align-items: center;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.btn-t3d-mode-pill {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-t3d-mode-pill:hover {
  color: #f1f5f9;
}

.btn-t3d-mode-pill.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.4), rgba(56, 189, 248, 0.2));
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

/* Zoom Trigger & Close Buttons */
.btn-t3d-zoom-trigger {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.35), rgba(56, 189, 248, 0.2)) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
}

.btn-t3d-zoom-trigger:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.5), rgba(56, 189, 248, 0.35)) !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.btn-t3d-close-zoom {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
}

.btn-t3d-close-zoom:hover {
  background: rgba(239, 68, 68, 0.4) !important;
  color: #ffffff !important;
}

/* Comparison Bar Indicators */
.t3d-comparison-badge-bar {
  justify-content: center !important;
  gap: 16px !important;
  background: rgba(15, 23, 42, 0.92) !important;
}

.t3d-dual-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 8px;
}

.t3d-dual-indicator.left {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.t3d-dual-indicator.right {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.t3d-dual-vs {
  font-size: 0.72rem;
  font-weight: 800;
  color: #f59e0b;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(245, 158, 11, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* =================================================================
   3D Zoom Theater Modal
   ================================================================= */
body.t3d-modal-open {
  overflow: hidden !important;
}

.t3d-zoom-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5vh 1.5vw;
}

.t3d-zoom-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 20, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.t3d-zoom-modal-content {
  position: relative;
  z-index: 10;
  width: 97vw;
  height: 94vh;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.3);
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: #070c18;
}

.t3d-zoom-modal-body {
  width: 100%;
  height: 100%;
}

.t3d-fullscreen-viewport {
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
  border: none !important;
}

.t3d-fullscreen-viewport .t3d-canvas {
  height: 100% !important;
}

/* =================================================================
   Camera Angle Presets Switcher (Top-Down Plan vs Isometric 3D)
   ================================================================= */
.t3d-angle-mode-selector {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.btn-t3d-angle-pill {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn-t3d-angle-pill:hover {
  color: #f1f5f9;
}

.btn-t3d-angle-pill.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.45), rgba(56, 189, 248, 0.25));
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

/* ==========================================================================
 * 3D Projected Floating Step Pins & Guess Mode HUD Styles
 * Inspired by IELTS Process Lab 3D Authentic Architecture
 * ========================================================================== */

.t3d-pin-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 15;
}

.t3d-step-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f1f5f9;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), background 0.18s ease, border-color 0.18s ease;
  user-select: none;
}

.t3d-step-pin:hover {
  transform: translate(-50%, -100%) scale(1.08);
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(56, 189, 248, 0.6);
  z-index: 25;
}

.t3d-step-pin b {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
}

.t3d-step-pin.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.95), rgba(2, 132, 199, 0.95));
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.6);
  transform: translate(-50%, -100%) scale(1.06);
  z-index: 30;
}

.t3d-step-pin.active b {
  background: #ffffff;
  color: #0284c7;
}

/* Guess Mode & Verbs Chips */
.t3d-insight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.t3d-insight-title-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-t3d-guess-toggle {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #94a3b8;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-t3d-guess-toggle:hover {
  color: #f1f5f9;
  border-color: rgba(56, 189, 248, 0.5);
}

.btn-t3d-guess-toggle.active {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.t3d-blank-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px dashed #f59e0b;
  color: #fef08a;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  letter-spacing: 1px;
}

.t3d-insight-verbs-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.t3d-verbs-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.5px;
}

.t3d-verb-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Container Host in Task 1 Visual Card */
.task1-3d-container {
  width: 100%;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.t3d-dedicated-wrapper {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: #0f172a;
}

.t3d-dedicated-iframe {
  width: 100%;
  border: none;
  display: block;
}
