/* ================= Shiba Helper – Overlay Setup ================= */

/* Overlay Container */
#overlay-root {
  position: fixed;
  inset: 0;
  z-index: 3000; /* hochgesetzt, damit Shiba über allem liegt */
  pointer-events: none;
}

#shiba-anchor {
  position: fixed;    /* oder absolute, wenn nur im Header */
  top: 20px;          /* Desktop oben */
  right: 20px;        /* rechts an den Rand */
  width: 100px;
  z-index: 5000;
}


#shiba-fixed {
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  z-index: 5000;
}




/* ================= Avatar & Animation ================= */

#shiba-helper {
  position: relative;
  width: 100%;
  height: 100%;
}



/* Optional: horizontal spiegeln */
/* .shiba-bark.flipped { transform: scaleX(-1); } */



/* ================= Modal direkt unter dem Shiba ================= */

#shiba-modal {
  position: fixed;       /* NICHT mehr relativ zu #shiba-fixed */
  top: 90px;             /* Abstand unter dem Shiba; nach Wunsch */
  right: 20px;
  width: 280px;
  background-color: #2b2b2b;
  color: #f1f1f1;
  border: 2px solid #57d9c4;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 6px 14px rgba(0,0,0,0.4);
  z-index: 3000;   /* gleich hoch wie Overlay */
  max-height: min(70vh, 420px);
  overflow: visible;
  pointer-events: auto;  /* …aber das Modal schon */
}

/* Pfeil, der auf den Shiba zeigt */
#shiba-modal::before {
  content: "";
  position: absolute;
  top: -10px;
  right: 20px;
  border-width: 0 10px 10px 10px;
  border-style: solid;
  border-color: transparent transparent #57d9c4 transparent;
}


.shiba-close-button {
  position: absolute;
  top: -12px;         
  right: 0px;        
  width: 2.4rem;
  height: 2.4rem;
  border-top: 2px solid #57d9c4;
  border-radius: 70%;
  background-color: #2a2a2a;
  background-image: url("assets/icons/close_pink.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1.2rem;
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
  transform: translateZ(0);
  transition: transform 0.2s ease, background-color 0.2s ease;
  z-index: 9999;
}



.shiba-close-button:hover {
  background-color: #3a3a3a;
}


/* ================= Modal-Inhalte ================= */

.shiba-modal-content input {
  width: 100%;
  padding: 8px;
  margin-top: 10px;
  border: 1px solid #444;
  border-radius: 6px;
  background-color: #1e1e1e;
  color: #f1f1f1;
  position: relative;
  z-index:3000;
}

#shiba-search-btn {
  margin-top: 8px;
  background-color: #57d9c4;
  color: #000;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

#shiba-results {
  margin-top: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-bottom: 1px solid #444;
  cursor: pointer;
  color: #ccc;
}

.result-item:hover {
  background-color: #3a3a3a;
  color: #fff;
}

.result-item img.result-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #666;
}

/* Utility */
.hidden { display: none !important; }

/* ================= Mobile Tweaks ================= */

@media (max-width: 600px) {
   #shiba-anchor {
    top: auto;
    bottom: 70px;  /* exakt über der mobilen Navigation */
    right: 10px;
    width: 60px;
  }

  .shiba-bark {
    width: 60px;
    height: 90px;
  }

  #shiba-modal {
  top: auto;
    bottom: 90px;        /* über der Bottom-Nav */
    right: 10px;
    width: 90vw;
    max-width: 320px;
    padding: 0.8rem;
    z-index: 3000; /* nicht absenken */
  }

#shiba-fixed {
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
  }
  
  #shiba-modal::before {
    right: 14px;
    border-width: 0 8px 8px 8px;
  }
  
  #shiba-greeting {
  font-size: 1rem;
  margin-top: 1.7rem;     /* NEU → Abstand nach oben */
  margin-bottom: 0.5rem;
  line-height: 1.4;
}


  .result-item { gap: 8px; padding: 5px; font-size: 0.95rem; }
  .result-item img.result-thumb { width: 28px; height: 28px; }
  
  /* Shiba-Container bleibt Bezugspunkt */
  
  /* Speech-Bubble schwebt über dem Shiba und ist kleiner */
   #shiba-speech {
    position: absolute;
    bottom: 65px;
    right: 0;
    max-width: 70vw;
    font-size: 0.75rem;
    padding: 0.45rem 0.7rem;
    border-radius: 0.9rem;
    background: linear-gradient(145deg, rgba(120,0,140,0.9), rgba(0,180,190,0.8));
  }
  #shiba-speech::after {
    right: 20px;
    bottom: -5px;
  }
  
  #shiba-hint {
    font-size: 0.7rem;
    margin-bottom: 0.3rem;
  }
}




/* === TrendBiest Shiba Speech Bubble === */

#shiba-speech {
  position: absolute;
  bottom: 80px;  /* vorher war ~60px, höher setzen */
  right: 0;
  display: inline-block;
  font-size: 0.85rem;
  line-height: 1.3;
  max-width: 260px;
  padding: 0.55rem 0.9rem;
  border-radius: 1.2rem;
  color: #fff;
  background: linear-gradient(145deg, rgba(65,0,80,0.9), rgba(10,180,200,0.85));
  box-shadow:
    0 0 6px rgba(255, 120, 220, 0.4),
    0 0 12px rgba(80, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.15);
  opacity: 0;
  transform: translateY(4px) scale(.97);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}

/* kleiner dreieckiger "Tail" */
#shiba-speech::after {
  content: "";
  position: absolute;
  bottom: -6px;
  right: 24px;
  width: 12px;
  height: 12px;
  background: inherit;
  transform: rotate(45deg);
  border-radius: 2px;
  box-shadow:
    0 0 6px rgba(255, 120, 220, 0.4),
    0 0 12px rgba(80, 255, 255, 0.25);
}

#shiba-speech.shiba-speech-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#shiba-speech.shiba-speech-pop {
  animation: shiba-pop 0.35s ease-out;
}

@keyframes shiba-pop {
  0%   { transform: translateY(8px) scale(.8); opacity: 0; }
  60%  { transform: translateY(-2px) scale(1.05); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* sanftes Glühen */
@keyframes shiba-glow {
  0%,100% { box-shadow:
    0 0 6px rgba(255,120,220,0.4),
    0 0 12px rgba(80,255,255,0.25);
  }
  50% { box-shadow:
    0 0 8px rgba(255,120,220,0.7),
    0 0 18px rgba(80,255,255,0.4);
  }
}
#shiba-speech.shiba-speech-visible {
  animation: shiba-glow 3s ease-in-out infinite;
}

#shiba-hint {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  text-align: center;
  font-style: italic;
  user-select: none;
}

#shiba-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.45rem 0 0.6rem;
  justify-content: center;
}

.shiba-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: radial-gradient(circle at top left,
    rgba(255, 120, 220, 0.4),
    rgba(20, 20, 40, 0.95)
  );
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0.9;
  transition:
    background .15s ease,
    transform .15s ease,
    opacity .15s ease,
    box-shadow .15s ease;
}

.shiba-tag:hover {
  opacity: 1;
  transform: translateY(-1px) scale(1.02);
  box-shadow:
    0 0 6px rgba(255,120,220,0.6),
    0 0 12px rgba(80,255,255,0.4);
}

.shiba-tag-icon {
  font-size: 0.9em;
}

@media (max-width: 600px) {
  #shiba-tags {
    gap: 0.3rem;
    margin: 0.4rem 0 0.4rem;
  }

  .shiba-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.55rem;
  }
}
