/* ──────────────────────────────────────────────────────────────────────
   Dilles UFO Companion — frontend visuals
   ────────────────────────────────────────────────────────────────────── */

.dufo-ufo {
  position: fixed;
  top: 0; left: 0;
  width: 32px; height: 16px;
  pointer-events: none;
  z-index: 99999;
  transform: translate3d(-100px, -100px, 0);
  opacity: 0;
  transition: opacity .25s ease-out;
  will-change: transform;
}
.dufo-ufo.dufo-active { opacity: 1; }
.dufo-ufo svg {
  display: block;
  filter: drop-shadow(0 0 6px rgba(0, 255, 80, .55));
  animation: dufo-bob 2.4s ease-in-out infinite;
}
@keyframes dufo-bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-1.5px) rotate(1.5deg); }
}
.dufo-ufo.dufo-scanning svg {
  animation: dufo-scan-pulse .8s ease-in-out infinite;
}
@keyframes dufo-scan-pulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(0, 255, 80, .55)); }
  50%      { filter: drop-shadow(0 0 12px rgba(0, 255, 80, .9)); }
}

/* Laser-Beam — verdickt mit core + glow layer + downstream Partikel */
.dufo-laser {
  position: fixed;
  top: 0; left: 0;
  width: 5px;
  pointer-events: none;
  z-index: 99998;
  transform-origin: top center;
  opacity: 0;
  transition: opacity .12s ease-out;
}
.dufo-laser::before,
.dufo-laser::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* Outer glow halo — red so it stays readable over green page content */
.dufo-laser::before {
  left: -8px; right: -8px;
  background: linear-gradient(to bottom,
    rgba(255, 60, 60, .65) 0%,
    rgba(255, 30, 30, .35) 50%,
    rgba(255, 0, 0, 0) 100%);
  filter: blur(7px);
}
/* Inner core — hot-white → red */
.dufo-laser::after {
  left: 1px; right: 1px;
  background: linear-gradient(to bottom,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 220, 200, .98) 12%,
    rgba(255, 80, 60, .95) 45%,
    rgba(255, 20, 20, .85) 80%,
    rgba(255, 0, 0, .35) 100%);
  box-shadow:
    0 0 6px rgba(255, 60, 30, .95),
    0 0 14px rgba(255, 30, 30, .65),
    0 0 22px rgba(255, 0, 0, .35);
}
.dufo-laser.dufo-active {
  opacity: 1;
  animation: dufo-laser-flicker .22s ease-in-out infinite;
}
@keyframes dufo-laser-flicker {
  0%, 100% { opacity: 1; }
  45%      { opacity: .78; }
  55%      { opacity: .9; }
}

/* Particles — flow downstream along the beam (red glow, matches laser) */
.dufo-particle {
  position: fixed;
  top: 0; left: 0;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(255, 220, 200, .95);
  box-shadow:
    0 0 6px rgba(255, 80, 30, .95),
    0 0 12px rgba(255, 30, 30, .65);
  pointer-events: none;
  z-index: 99998;
  opacity: 0;
  will-change: transform, opacity;
}
.dufo-particle.dufo-spark {
  width: 2px; height: 2px;
  background: rgba(255, 240, 230, .95);
  box-shadow: 0 0 4px rgba(255, 60, 30, .95);
}

/* ── Note (persistent, page-absolute) ────────────────────────────────── */
.dufo-note {
  position: absolute;
  top: 0; left: 0;
  width: 360px;
  background: #0a0a0a;
  border: 1px solid rgba(0, 255, 80, .55);
  color: #dcdcdc;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  font-size: 12px;
  line-height: 1.55;
  z-index: 9000;
  pointer-events: auto;
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5), 0 0 16px rgba(0, 255, 80, .15);
}
.dufo-note.dufo-flash {
  animation: dufo-flash 1.2s ease-out;
}
@keyframes dufo-flash {
  0%   { box-shadow: 0 0 0 4px rgba(0,255,80,.7), 0 0 30px rgba(0,255,80,.5); }
  100% { box-shadow: 0 6px 24px rgba(0,0,0,.5), 0 0 16px rgba(0,255,80,.15); }
}
.dufo-note-header {
  background: rgba(0, 255, 80, .08);
  padding: 6px 10px;
  font-size: 10px;
  letter-spacing: .15em;
  color: #0f0;
  border-bottom: 1px solid rgba(0, 255, 80, .25);
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  touch-action: none;
}
.dufo-note-header.dufo-draggable { cursor: grab; }
.dufo-note.dufo-dragging .dufo-note-header { cursor: grabbing; }
.dufo-note.dufo-dragging {
  z-index: 9500;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .65), 0 0 24px rgba(0, 255, 80, .35);
  transition: none;
}
.dufo-note-title { font-weight: 500; }
.dufo-note-model { color: #7cf3a4; opacity: .85; }
.dufo-note-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dufo-tts {
  cursor: pointer;
  opacity: .6;
  font-size: 12px;
  padding: 0 2px;
  transition: opacity .12s, transform .12s;
  user-select: none;
}
.dufo-tts:hover { opacity: 1; }
.dufo-tts.dufo-tts-active {
  opacity: 1;
  color: #0f0;
  text-shadow: 0 0 6px rgba(0, 255, 80, .6);
  animation: dufo-tts-pulse 1.4s ease-in-out infinite;
}
@keyframes dufo-tts-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}
.dufo-close {
  cursor: pointer;
  opacity: .55;
  font-size: 13px;
  padding: 0 4px;
  transition: opacity .12s, color .12s;
}
.dufo-close:hover { opacity: 1; color: #f55; }
.dufo-note-body {
  padding: 10px 12px;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  user-select: text;
}
.dufo-note-body.dufo-loading::before {
  content: '▸ ';
  color: #0f0;
  animation: dufo-blink .8s steps(1) infinite;
}
@keyframes dufo-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}
.dufo-note-body.dufo-error {
  color: #fcc;
  border-left: 2px solid #f55;
  padding-left: 10px;
}
.dufo-note-cta {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed rgba(0, 255, 80, .25);
  font-size: 11px;
  letter-spacing: .08em;
}
.dufo-note-cta a {
  color: #0f0;
  text-shadow: 0 0 6px rgba(0, 255, 80, .55);
  text-decoration: none;
  padding: 2px 0;
  transition: color .15s;
}
.dufo-note-cta a:hover { color: #fff; text-shadow: 0 0 10px rgba(0, 255, 80, .9); }
.dufo-note-quote {
  margin: 0 12px 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(0, 255, 80, .2);
  font-size: 10px;
  color: #777;
  font-style: italic;
  user-select: text;
}

/* ── Bookmark Rail (fixed right, for out-of-view notes) ──────────────── */
.dufo-rail {
  position: fixed;
  top: 80px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 99997;
  pointer-events: none;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}
.dufo-bookmark {
  pointer-events: auto;
  background: #0a0a0a;
  border: 1px solid rgba(0, 255, 80, .5);
  border-right: 0;
  color: #dcdcdc;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 11px;
  padding: 6px 10px 6px 8px;
  border-radius: 3px 0 0 3px;
  box-shadow: -2px 2px 8px rgba(0, 0, 0, .5);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 200px;
  transition: background .15s, transform .15s;
}
.dufo-bookmark:hover {
  background: rgba(0, 255, 80, .08);
  transform: translateX(-3px);
}
.dufo-bm-marker {
  color: #0f0;
  text-shadow: 0 0 4px rgba(0, 255, 80, .6);
  font-size: 10px;
}
.dufo-bm-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.dufo-bm-close {
  flex: 0 0 auto;
  color: #5a5a5a;
  font-size: 11px;
  padding: 2px 4px;
  cursor: pointer;
  user-select: none;
  transition: color .15s, transform .12s;
  line-height: 1;
}
.dufo-bm-close:hover {
  color: #f55;
  transform: scale(1.15);
}

/* Admin-bar Toggle Active-State */
#wp-admin-bar-dilles-ufo.dufo-on > a {
  background: rgba(0, 255, 80, .18) !important;
  color: #0f0 !important;
}
