/* =====================================================
   GDMA v2 — Geanny Digital Mind Agent
   ===================================================== */

#gdma-launcher {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  z-index: 8500;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  user-select: none;
}

#gdma-avatar {
  width: 58px;
  height: 58px;
  animation: gdma-float 3.2s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(227, 162, 60, 0.45));
  transition: filter 0.2s, transform 0.2s;
}

#gdma-launcher:hover #gdma-avatar {
  filter: drop-shadow(0 0 18px rgba(227, 162, 60, 0.75));
  transform: scale(1.07);
}

#gdma-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  color: rgba(227, 162, 60, 0.75);
  letter-spacing: 0.06em;
  background: rgba(10, 14, 12, 0.85);
  border: 1px solid rgba(227, 162, 60, 0.2);
  border-radius: 3px;
  padding: 0.15rem 0.45rem;
  white-space: nowrap;
}

#gdma-notif {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  background: #e3a23c;
  border-radius: 50%;
  border: 2px solid #0a0e0c;
  animation: gdma-ping 2s ease-in-out infinite;
  display: none;
}

#gdma-notif.show {
  display: block;
}

#gdma-panel {
  position: fixed;
  bottom: 8rem;
  right: 1.5rem;
  z-index: 8400;
  width: 360px;
  max-height: 520px;
  background: #0d1311;
  border: 1px solid rgba(227, 162, 60, 0.22);
  border-radius: 8px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(227, 162, 60, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#gdma-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#gdma-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #0a0e0c;
  border-bottom: 1px solid rgba(238, 241, 238, 0.07);
  flex-shrink: 0;
}

#gdma-header-avatar {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

#gdma-header-info {
  flex: 1;
}

#gdma-header-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: #f0b75c;
  font-weight: 600;
}

#gdma-header-status {
  font-size: 0.62rem;
  color: #5fae9d;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.1rem;
  font-family: 'IBM Plex Mono', monospace;
}

#gdma-header-status .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #5fae9d;
  animation: gdma-pulse 2s ease-in-out infinite;
}

#gdma-close {
  background: none;
  border: none;
  color: #56655d;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.2s;
}

#gdma-close:hover {
  color: #eef1ee;
}

#gdma-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
  min-height: 170px;
}

#gdma-messages::-webkit-scrollbar {
  width: 3px;
}

#gdma-messages::-webkit-scrollbar-thumb {
  background: rgba(227, 162, 60, 0.3);
  border-radius: 2px;
}

.gdma-msg {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  animation: gdma-msgIn 0.2s ease;
}

.gdma-msg.user {
  flex-direction: row-reverse;
}

.gdma-bubble {
  max-width: 82%;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.6;
  font-family: 'Manrope', sans-serif;
  word-break: break-word;
  white-space: pre-wrap;
}

.gdma-msg.bot .gdma-bubble {
  background: #131a17;
  border: 1px solid rgba(238, 241, 238, 0.08);
  color: #d4ddd8;
  border-bottom-left-radius: 2px;
}

.gdma-msg.user .gdma-bubble {
  background: rgba(227, 162, 60, 0.18);
  border: 1px solid rgba(227, 162, 60, 0.25);
  color: #f0e6cc;
  border-bottom-right-radius: 2px;
}

.gdma-msg-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.gdma-typing .gdma-bubble {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0.6rem 0.85rem;
}

.gdma-typing .gdma-bubble span {
  width: 5px;
  height: 5px;
  background: #56655d;
  border-radius: 50%;
  animation: gdma-blink 1.2s infinite;
}

.gdma-typing .gdma-bubble span:nth-child(2) {
  animation-delay: 0.2s;
}

.gdma-typing .gdma-bubble span:nth-child(3) {
  animation-delay: 0.4s;
}

#gdma-footer {
  border-top: 1px solid rgba(238, 241, 238, 0.07);
  padding: 0.7rem 0.85rem;
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  background: #0a0e0c;
}

#gdma-input {
  flex: 1;
  background: #131a17;
  border: 1px solid rgba(238, 241, 238, 0.1);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  color: #eef1ee;
  font-size: 0.8rem;
  font-family: 'Manrope', sans-serif;
  outline: none;
  resize: none;
  max-height: 90px;
  line-height: 1.5;
  transition: border-color 0.2s;
}

#gdma-input:focus {
  border-color: rgba(227, 162, 60, 0.45);
}

#gdma-input::placeholder {
  color: #56655d;
}

#gdma-send {
  background: #e3a23c;
  border: none;
  border-radius: 4px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  align-self: flex-end;
  transition: background 0.2s, transform 0.15s;
  color: #14110a;
}

#gdma-send:hover {
  background: #f0b75c;
  transform: scale(1.07);
}

#gdma-send:disabled {
  background: #2a3530;
  color: #56655d;
  cursor: default;
  transform: none;
}

#gdma-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1rem 0.75rem;
  flex-shrink: 0;
}

.gdma-suggestion {
  font-size: 0.67rem;
  padding: 0.28rem 0.6rem;
  border-radius: 20px;
  border: 1px solid rgba(227, 162, 60, 0.22);
  color: rgba(227, 162, 60, 0.8);
  background: transparent;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  transition: all 0.18s;
  white-space: nowrap;
}

.gdma-suggestion:hover {
  background: rgba(227, 162, 60, 0.12);
  border-color: rgba(227, 162, 60, 0.5);
  color: #f0b75c;
}

/* El agente resalta una sección del portafolio */
.gdma-target-highlight {
  position: relative;
  z-index: 2;
  animation: gdma-target-glow 1.05s ease-in-out 3;
}

@keyframes gdma-target-glow {
  0%,
  100% {
    filter: none;
  }

  50% {
    filter:
      drop-shadow(0 0 16px rgba(227, 162, 60, 0.7))
      drop-shadow(0 0 32px rgba(227, 162, 60, 0.28));
  }
}

@keyframes gdma-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-7px);
  }
}

@keyframes gdma-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

@keyframes gdma-ping {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.3);
    opacity: 0.6;
  }
}

@keyframes gdma-blink {
  0%,
  80%,
  100% {
    transform: scale(1);
    opacity: 0.4;
  }

  40% {
    transform: scale(1.4);
    opacity: 1;
  }
}

@keyframes gdma-msgIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 480px) {
  #gdma-panel {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    bottom: 7rem;
    max-height: 440px;
  }

  #gdma-launcher {
    right: 1rem;
    bottom: 5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #gdma-avatar,
  #gdma-notif,
  #gdma-header-status .dot,
  .gdma-msg,
  .gdma-target-highlight {
    animation: none !important;
  }

  #gdma-panel {
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}
