/* dna-monitor.css — Creative DNA Monitor Sidebar */

:root {
  --dna-sidebar-width: 340px;
  --dna-toggle-width: 36px;
  --dna-bg: rgba(10, 10, 18, 0.96);
  --dna-glow-primary: #61afef;
  --dna-glow-secondary: #a78bfa;
  --dna-glow-accent: #00ff88;
  --dna-glow-warm: #ff6b6b;
  --dna-border: rgba(97, 175, 239, 0.15);
  --dna-card-bg: rgba(30, 30, 46, 0.6);
  --dna-text: #c0caf5;
  --dna-text-muted: #565f89;
  --dna-radius: 8px;
}

/* ---- Toggle Button (always visible on right edge) ---- */

.dna-toggle-btn {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 51;
  width: var(--dna-toggle-width);
  height: 88px;
  background: linear-gradient(180deg,
    rgba(97, 175, 239, 0.12) 0%,
    rgba(167, 139, 250, 0.12) 100%);
  border: 1px solid var(--dna-border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dna-glow-primary);
  transition: all 0.3s ease;
  writing-mode: vertical-rl;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-family: 'Courier New', monospace;
}

.dna-toggle-btn:hover {
  background: linear-gradient(180deg,
    rgba(97, 175, 239, 0.22) 0%,
    rgba(167, 139, 250, 0.22) 100%);
  box-shadow: 0 0 14px rgba(97, 175, 239, 0.25);
  width: 42px;
}

/* DNA Toggle Glow (after DNA refresh, until clicked) */
.dna-toggle-btn.dna-toggle-glow {
  animation: dna-toggle-frost-glow 2s ease-in-out infinite;
  border-color: rgba(97, 175, 239, 0.4);
  color: #fff;
  text-shadow: 0 0 8px rgba(97, 175, 239, 0.6);
}
@keyframes dna-toggle-frost-glow {
  0%, 100% {
    background: linear-gradient(180deg, rgba(97, 175, 239, 0.15) 0%, rgba(167, 139, 250, 0.15) 100%);
    box-shadow: 0 0 8px rgba(97, 175, 239, 0.2), 0 0 4px rgba(97, 175, 239, 0.1);
  }
  50% {
    background: linear-gradient(180deg, rgba(97, 175, 239, 0.3) 0%, rgba(167, 139, 250, 0.25) 100%);
    box-shadow: 0 0 18px rgba(97, 175, 239, 0.4), 0 0 8px rgba(97, 175, 239, 0.2);
  }
}

body.dna-monitor-open .dna-toggle-btn {
  right: var(--dna-sidebar-width);
}

/* ---- Sidebar Container ---- */

.dna-monitor {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 28px;
  width: var(--dna-sidebar-width);
  background: var(--dna-bg);
  border-left: 1px solid var(--dna-border);
  backdrop-filter: blur(16px);
  z-index: 50;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(97,175,239,0.15) transparent;
}

.dna-monitor::-webkit-scrollbar {
  width: 4px;
}
.dna-monitor::-webkit-scrollbar-track {
  background: transparent;
}
.dna-monitor::-webkit-scrollbar-thumb {
  background: rgba(97,175,239,0.2);
  border-radius: 2px;
}

.dna-monitor.open {
  transform: translateX(0);
}

/* Push content when sidebar is open (wide screens only) */
@media (min-width: 1201px) {
  body.dna-monitor-open .content {
    margin-right: var(--dna-sidebar-width);
    transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  body.dna-monitor-open .status-bar {
    right: var(--dna-sidebar-width);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* Overlay mode on medium screens */
@media (max-width: 1200px) and (min-width: 769px) {
  .dna-monitor.open {
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
  }
}

/* Mobile: full-screen overlay mode */
@media (max-width: 768px) {
  .dna-toggle-btn {
    position: fixed;
    right: 10px;
    top: auto;
    bottom: 44px;
    transform: none;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1.5px solid rgba(97, 175, 239, 0.4);
    writing-mode: horizontal-tb;
    font-size: 16px;
    letter-spacing: 0;
    background: linear-gradient(135deg,
      rgba(97, 175, 239, 0.22) 0%,
      rgba(167, 139, 250, 0.22) 100%);
    box-shadow: 0 0 12px rgba(97, 175, 239, 0.2), 0 2px 12px rgba(0, 0, 0, 0.3);
    animation: mobile-dna-idle-glow 3s ease-in-out infinite;
  }

  @keyframes mobile-dna-idle-glow {
    0%, 100% {
      box-shadow: 0 0 8px rgba(97, 175, 239, 0.15), 0 2px 10px rgba(0, 0, 0, 0.3);
      border-color: rgba(97, 175, 239, 0.35);
    }
    50% {
      box-shadow: 0 0 16px rgba(97, 175, 239, 0.3), 0 2px 12px rgba(0, 0, 0, 0.3);
      border-color: rgba(97, 175, 239, 0.5);
    }
  }

  .dna-toggle-btn::before {
    content: "🧬";
    font-size: 22px;
  }

  /* Hide the text on mobile, show only the icon */
  .dna-toggle-btn {
    text-indent: -9999px;
    overflow: hidden;
  }

  .dna-toggle-btn::before {
    text-indent: 0;
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  body.dna-monitor-open .dna-toggle-btn {
    right: 8px;
    bottom: 40px;
    z-index: 1001;
  }

  .dna-monitor {
    width: 100%;
    max-width: 100%;
    bottom: 0;
    border-left: none;
    border-top: 1px solid var(--dna-border);
    z-index: 1000;
  }

  .dna-monitor.open {
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
  }
}

/* ---- Header ---- */

.dna-monitor-header {
  position: relative;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--dna-border);
  background: linear-gradient(180deg,
    rgba(97, 175, 239, 0.06) 0%,
    transparent 100%);
  overflow: hidden;
}

/* Scanline effect */
.dna-monitor-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(97, 175, 239, 0.35),
    transparent);
  animation: dna-scanline 4s linear infinite;
}

@keyframes dna-scanline {
  0% { top: 0; }
  100% { top: 100%; }
}

.dna-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.dna-header-title h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--dna-glow-primary), var(--dna-glow-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.dna-helix-icon {
  width: 22px;
  height: 22px;
}

.dna-helix-icon svg {
  width: 100%;
  height: 100%;
}

.dna-header-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dna-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dna-text-muted);
}

.dna-status-dot.active {
  background: var(--dna-glow-accent);
  box-shadow: 0 0 6px var(--dna-glow-accent);
  animation: dna-dot-pulse 2s ease-in-out infinite;
}

.dna-status-dot.inactive {
  background: var(--dna-text-muted);
}

.dna-status-dot.error {
  background: var(--dna-glow-warm);
  box-shadow: 0 0 6px var(--dna-glow-warm);
}

@keyframes dna-dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.dna-status-text {
  font-size: 10px;
  color: var(--dna-text-muted);
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ---- Section Styling ---- */

.dna-section {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(97, 175, 239, 0.06);
}

.dna-section-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dna-text-muted);
  margin: 0 0 10px 0;
  font-family: 'Courier New', monospace;
}

/* ---- Empty State ---- */

.dna-empty-state {
  text-align: center;
  padding: 40px 24px;
}

.dna-empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.dna-empty-state p {
  font-size: 13px;
  color: var(--dna-text-muted);
  line-height: 1.5;
  margin: 4px 0;
}

.dna-hint {
  font-size: 11px;
  color: var(--dna-text-muted);
  line-height: 1.4;
}

/* ---- About Signature Strengths (collapsible) ---- */

.dna-about-box {
  margin-bottom: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--dna-border);
  border-radius: 6px;
  overflow: hidden;
}
.dna-about-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  cursor: pointer;
  user-select: none;
  font-size: 9px;
  font-weight: 600;
  color: var(--dna-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  transition: background 0.15s;
}
.dna-about-header:hover { background: rgba(97, 175, 239, 0.06); }
.dna-about-chevron {
  font-size: 9px;
  transition: transform 0.2s ease;
}
.dna-about-box.collapsed .dna-about-chevron { transform: rotate(-90deg); }
.dna-about-body {
  padding: 6px 10px 10px;
  max-height: 500px;
  opacity: 1;
  transition: max-height 0.35s ease, opacity 0.2s ease, padding 0.2s ease;
  overflow: hidden;
}
.dna-about-box.collapsed .dna-about-body {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}
.dna-about-list {
  margin: 0;
  padding: 0;
}
.dna-about-list dt {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--dna-text);
  margin-top: 5px;
}
.dna-about-list dt:first-child { margin-top: 0; }
.dna-about-list dd {
  margin: 1px 0 0 0;
  font-size: 9px;
  line-height: 1.45;
  color: var(--dna-text-muted);
}
.dna-about-hint {
  margin: 7px 0 0;
  padding-top: 6px;
  border-top: 1px solid var(--dna-border);
  font-size: 8.5px;
  color: var(--dna-text-muted);
  opacity: 0.65;
  line-height: 1.4;
}

/* ---- Strength Bars ---- */

.dna-strength-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dna-strength-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dna-strength-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--dna-text);
}

.dna-strength-icon {
  font-size: 12px;
  width: 16px;
  text-align: center;
}

.dna-strength-value {
  margin-left: auto;
  font-size: 10px;
  font-family: 'Courier New', monospace;
  color: var(--dna-glow-primary);
  font-weight: 700;
}

.dna-strength-bar {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.dna-strength-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  animation: dna-bar-glow 3s ease-in-out infinite;
}

.dna-strength-fill.voice {
  background: linear-gradient(90deg, var(--dna-glow-primary), #7dc4ff);
}
.dna-strength-fill.visual {
  background: linear-gradient(90deg, #ff9f43, #ffc048);
}
.dna-strength-fill.motion {
  background: linear-gradient(90deg, #ee5a24, #ff7845);
}
.dna-strength-fill.thematic {
  background: linear-gradient(90deg, var(--dna-glow-secondary), #c4a0ff);
}
.dna-strength-fill.sonic {
  background: linear-gradient(90deg, var(--dna-glow-accent), #5cffb1);
}
.dna-strength-fill.social {
  background: linear-gradient(90deg, #0abde3, #48dbfb);
}

@keyframes dna-bar-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
}

/* ---- Tag Cloud (Core Obsessions) ---- */

.dna-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dna-tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--dna-glow-secondary);
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 12px;
  font-weight: 500;
}

/* ---- Philosophy ---- */

.dna-philosophy-text {
  font-size: 12px;
  color: var(--dna-text);
  line-height: 1.6;
  font-style: italic;
  padding: 8px 12px;
  border-left: 2px solid rgba(97, 175, 239, 0.3);
  background: rgba(97, 175, 239, 0.03);
  border-radius: 0 var(--dna-radius) var(--dna-radius) 0;
  margin: 0;
}

/* ---- Quotable Lines ---- */

.dna-quotes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dna-quote {
  font-size: 11px;
  color: var(--dna-glow-accent);
  padding: 6px 10px;
  background: rgba(0, 255, 136, 0.04);
  border: 1px solid rgba(0, 255, 136, 0.1);
  border-radius: var(--dna-radius);
  line-height: 1.5;
  font-style: italic;
}

/* ---- Data Sources ---- */

.dna-sources-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.dna-source-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  background: var(--dna-card-bg);
  border: 1px solid rgba(97, 175, 239, 0.08);
  border-radius: var(--dna-radius);
  text-align: center;
}

.dna-source-icon {
  font-size: 16px;
  opacity: 0.7;
}

.dna-source-value {
  font-size: 18px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  background: linear-gradient(135deg, var(--dna-glow-primary), var(--dna-glow-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dna-source-label {
  font-size: 8px;
  color: var(--dna-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- Stale Indicator ---- */

.dna-stale-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(255, 107, 107, 0.06);
  border: 1px solid rgba(255, 107, 107, 0.15);
  border-radius: var(--dna-radius);
  font-size: 11px;
  color: var(--dna-glow-warm);
}

.dna-stale-indicator.hidden { display: none; }

.dna-refresh-btn {
  background: rgba(97, 175, 239, 0.15);
  border: 1px solid rgba(97, 175, 239, 0.3);
  color: var(--dna-glow-primary);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.dna-refresh-btn:hover {
  background: rgba(97, 175, 239, 0.25);
  box-shadow: 0 0 8px rgba(97, 175, 239, 0.2);
}

/* ---- Evolution Timeline ---- */

.dna-evolution {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.dna-evolution::-webkit-scrollbar {
  display: none;
}

.dna-evo-node {
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--dna-glow-primary), var(--dna-glow-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  position: relative;
  box-shadow: 0 0 6px rgba(97, 175, 239, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.dna-evo-node:hover {
  transform: scale(1.3);
  box-shadow: 0 0 12px rgba(97, 175, 239, 0.5);
}

.dna-evo-label {
  font-size: 7px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Courier New', monospace;
}

.dna-evo-connector {
  flex-shrink: 0;
  width: 12px;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(97, 175, 239, 0.3),
    rgba(167, 139, 250, 0.3));
}

.dna-meta-row {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 10px;
  color: var(--dna-text-muted);
  font-family: 'Courier New', monospace;
}

/* ---- Reduced Motion ---- */

@media (prefers-reduced-motion: reduce) {
  .dna-monitor { transition: none; }
  .dna-toggle-btn { transition: none; }
  .dna-strength-fill { animation: none; transition: none; }
  .dna-monitor-header::after { animation: none; display: none; }
  .dna-status-dot.active { animation: none; }
  .dna-evo-node { transition: none; }
  body.dna-monitor-open .content { transition: none; }
  body.dna-monitor-open .status-bar { transition: none; }
  .dna-toggle-btn.dna-toggle-glow { animation: none; background: rgba(97, 175, 239, 0.2); }
}
