/* ═══════════════════════════════════════════════════════════════════════════
   SeismoSim — Engineering Dashboard CSS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── TOKENS & RESET ──────────────────────────────────────────────────────── */
:root {
  --bg:           #040a13;
  --bg-raised:    #07101f;
  --bg-card:      #0a1426;
  --border:       rgba(71,201,255,0.15);
  --border-hover: rgba(71,201,255,0.6);
  --accent:       #e8ff47;
  --cyan:         #47c9ff;
  --red:          #ff4757;
  --green:        #5dde5d;
  --text:         #b8c8e0;
  --text-dim:     #4a5a72;
  --sidebar-w:    190px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.65;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── SIDEBAR ─────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 28px 24px 24px;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
}

/* ── SIDEBAR NAV ─────────────────────────────────────────────────────────── */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  gap: 2px;
  flex: 1;
}

.nav-item {
  display: block;
  padding: 9px 12px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 5px;
  border: 1px solid transparent;
  position: relative;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 2px; height: 60%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  transition: transform 0.18s;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.nav-item.active {
  color: var(--accent);
  background: rgba(232,255,71,0.06);
  border-color: rgba(232,255,71,0.15);
}

.nav-item.active::before {
  transform: translateY(-50%) scaleY(1);
}

.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}

.tagline {
  font-size: 9.5px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── MAIN CONTENT ────────────────────────────────────────────────────────── */
.content {
  margin-left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.section {
  padding: 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
  border-bottom: none;
  position: relative;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::before {
  content: '';
  display: block;
  width: 24px; height: 1px;
  background: var(--cyan);
  opacity: 0.5;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text);
  margin-top: -16px;
  margin-bottom: 32px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ── SECTION 1 – MODEL VIEWER ────────────────────────────────────────────── */
#model-viewer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding-bottom: 40px;
}

#model-viewer .section-title {
  margin-bottom: 20px;
}

.iframe-container {
  width: 100%;
  height: 62vh;
  min-height: 380px;
  background: radial-gradient(circle at center, #0a1426 0%, #03070f 100%);
  border: 1px solid rgba(71,201,255,0.4);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: 
    0 0 20px rgba(71,201,255,0.15),
    inset 0 0 80px rgba(0,0,0,0.8),
    0 20px 60px rgba(0,0,0,0.6);
}

/* Live iframe fills container */
.iframe-container iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
}

/* Corner ticks */
.iframe-container::before,
.iframe-container::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border-color: rgba(71,201,255,0.4);
  border-style: solid;
  pointer-events: none;
  z-index: 2;
}
.iframe-container::before { top: 10px; left: 10px; border-width: 1px 0 0 1px; }
.iframe-container::after  { bottom: 10px; right: 10px; border-width: 0 1px 1px 0; }

/* Loading overlay */
.iframe-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060c15;
  z-index: 3;
  transition: opacity 0.4s ease;
}

.loader-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(71,201,255,0.4);
  animation: loaderPulse 1.4s ease-in-out infinite;
}

@keyframes loaderPulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 1;   }
}

.chips-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.chip {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid rgba(71,201,255,0.25);
  border-radius: 3px;
  padding: 5px 12px;
  background: rgba(71,201,255,0.06);
  opacity: 0.8;
}

/* ── CARDS SHARED STYLES ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid #47c9ff;
  border-radius: 6px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.card-icon {
  font-size: 28px;
  margin-bottom: 12px;
  line-height: 1;
}

.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(71,201,255,0.25), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
}
.card:hover::after { opacity: 1; }

.card-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ddeeff;
  margin-bottom: 10px;
  line-height: 1.3;
}

.card-title.accent { color: var(--accent); }

.card-desc {
  font-family: monospace;
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ── SECTION 2 – WORKING PRINCIPLE ──────────────────────────────────────── */
.cards-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.cards-row-4 .card:nth-child(1) { animation-delay: 0.0s; }
.cards-row-4 .card:nth-child(2) { animation-delay: 0.1s; }
.cards-row-4 .card:nth-child(3) { animation-delay: 0.2s; }
.cards-row-4 .card:nth-child(4) { animation-delay: 0.3s; }

/* Step number accent */
.card .step {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  margin-bottom: 10px;
  text-transform: uppercase;
}

/* ── SECTION 3 – COMPONENTS ──────────────────────────────────────────────── */
.cards-grid-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* ── SECTION 4 – OBSERVATIONS ────────────────────────────────────────────── */
.vs-container {
  display: grid;
  grid-template-columns: 1fr 76px 1fr;
  gap: 0;
  align-items: start;
}

.vs-column {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px 26px;
}

.normal-col {
  border-color: rgba(255,71,87,0.18);
  box-shadow: 0 0 40px rgba(255,71,87,0.04) inset;
}

.isolated-col {
  border-color: rgba(93,222,93,0.18);
  box-shadow: 0 0 40px rgba(93,222,93,0.04) inset;
}

.vs-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}

.vs-title.red   { color: var(--red); }
.vs-title.green { color: var(--green); }

.vs-labels {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vs-labels li {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  padding: 7px 12px;
  border-radius: 4px;
  border: 1px solid;
  display: flex;
  align-items: center;
}

.vs-labels li::before {
  content: '•';
  font-size: 18px;
  line-height: 1;
  margin-right: 8px;
}

.label-red {
  color: var(--red);
  background: rgba(255,71,87,0.07);
  border-color: rgba(255,71,87,0.2);
}

.label-green {
  color: var(--green);
  background: rgba(93,222,93,0.07);
  border-color: rgba(93,222,93,0.2);
}

/* VS divider */
.vs-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 180px;
  gap: 0;
}

.vs-divider::before,
.vs-divider::after {
  content: '';
  display: block;
  width: 1px;
  flex: 1;
  background: var(--border);
}

.vs-divider span {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 10px 0;
}

/* ── OBSERVATIONS: INTENSITY BARS & EXTRAS ───────────────────────────────── */
.intensity-wrap { margin-top: 24px; }
.mt-4 { margin-top: 32px; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 24px; }
.intensity-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px; font-weight: 600; }
.intensity-bar-bg { width: 100%; height: 6px; background: rgba(0,0,0,0.4); border-radius: 4px; overflow: hidden; }
.intensity-bar { height: 100%; width: 0%; border-radius: 4px; transition: width 0.1s linear; }
.bar-red   { background: linear-gradient(90deg, #ff4757, #ff6b3d); }
.bar-green { background: linear-gradient(90deg, #1fa844, #64dc64); width: 12%; } /* Default flat low */

.concept-rows {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.concept-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.concept-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  min-width: 130px;
}

.chip-small {
  font-family: monospace;
  font-size: 11px;
  background: rgba(0,0,0,0.4);
  border: 1px solid #47c9ff;
  padding: 6px 12px;
  border-radius: 4px;
  color: #47c9ff;
  letter-spacing: 0.05em;
}

.conclusion-box {
  margin-top: 40px;
  padding: 24px 32px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  font-family: monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #8a9fc2;
  border-radius: 4px;
  text-align: center;
}

/* ── INFO OVERLAY ────────────────────────────────────────────────────────── */
.info-overlay {
  position: absolute;
  bottom: 30px;
  left: 40px;
  right: 40px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: stretch;
  gap: 20px;
  z-index: 1000;
  pointer-events: none;
}

.overlay-panel {
  flex: 1;
  background: rgba(6, 12, 23, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(71, 201, 255, 0.3);
  border-radius: 8px;
  padding: 24px;
  pointer-events: auto;
  box-shadow: 
    0 8px 32px rgba(0,0,0,0.5),
    inset 0 0 20px rgba(71,201,255,0.05);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.overlay-panel:hover {
  transform: translateY(-4px);
  border-color: rgba(71, 201, 255, 0.8);
  box-shadow: 
    0 12px 40px rgba(0,0,0,0.6),
    0 0 15px rgba(71,201,255,0.2),
    inset 0 0 30px rgba(71,201,255,0.1);
}

.overlay-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(71,201,255,0.4);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.overlay-desc {
  font-family: monospace;
  font-size: 11px;
  color: #b8c8e0;
  line-height: 1.5;
}

.overlay-list {
  list-style: none;
  font-family: monospace;
  font-size: 11px;
  color: #b8c8e0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}

.overlay-list li::before {
  content: '▪';
  color: var(--cyan);
  margin-right: 6px;
  font-size: 12px;
}

/* ── SIMPLE CARDS LAYOUT ─────────────────────────────────────────────────── */
.simple-card {
  min-height: 120px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cards-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

/* ── SCROLL REVEAL ANIMATION ─────────────────────────────────────────────── */
.reveal-up {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.reveal-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ── RESPONSIVE SAFETY ───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .section { padding: 24px; }
  .info-overlay { flex-direction: column; top: auto; bottom: 24px; left: 24px; right: 24px; }
  .overlay-panel { width: 100%; }
}

@media (max-width: 767px) {
  body {
    overflow-y: auto;
  }

  .content {
    height: auto;
    min-height: 100vh;
  }

  .section { 
    padding: 16px; 
    height: auto; 
    flex: none; 
  }

  #model-viewer {
    padding-bottom: 20px;
  }

  .section-title {
    font-size: 10px;
    margin-bottom: 16px;
  }

  .iframe-container {
    height: 45vh;
    min-height: 280px;
    box-shadow: 
      0 0 10px rgba(71,201,255,0.15),
      inset 0 0 40px rgba(0,0,0,0.8),
      0 10px 30px rgba(0,0,0,0.4);
  }

  .chips-row {
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .chip {
    padding: 6px 14px;
    font-size: 9px;
  }

  .info-overlay { 
    position: static; 
    flex-direction: column; 
    gap: 16px; 
    margin-top: 24px;
    pointer-events: auto;
  }

  .overlay-panel { 
    width: 100%; 
    padding: 20px;
  }

  .overlay-title {
    font-size: 12px;
  }

  .overlay-desc {
    font-size: 11px;
  }

  .overlay-list {
    grid-template-columns: 1fr;
    font-size: 11px;
    gap: 8px;
  }
}

