/* ============== Base ============== */
*{ margin:0; padding:0; box-sizing:border-box; }
html, body { height: 100%; }
body{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 400;
  background: #000;
  overflow: hidden;
}

/* ============== Launcher ============== */
.eniq-launcher{
  position: fixed;
  right: calc(var(--eniq-right) + var(--eniq-safe-right));
  bottom: calc(var(--eniq-bottom) + var(--eniq-safe-bottom));
  width: 96px;
  height: 96px;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index: 998;
  animation: softBounce 3.2s ease-in-out infinite;
  transition: all 0.2s;
}

.eniq-launcher.hidden{
  opacity: 1;
  pointer-events: auto;
}

@keyframes softBounce{
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.eniq-launcher:hover{
  animation: none;
  transform: translateY(0) scale(1.1);
}
.eniq-launcher:active{
  transform: scale(0.95);
}

.eniq-launcher-avatar{
  width: 100%;
  height: 100%;
  border-radius: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow: hidden;
  background: transparent;
}

.bot-img{
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.eniq-badge{
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 18px rgba(239, 68, 68, 0.35);
}
.eniq-badge.show{ display:flex; }

/* ============== Panel ============== */
.eniq-panel{
  position: fixed;
  right: calc(var(--eniq-right) + var(--eniq-safe-right));
  bottom: calc(var(--eniq-panel-bottom) + var(--eniq-safe-bottom));
  width: 340px;
  height: 520px;
  max-width: 92vw;
  background: #121212;
  border: 1px solid rgba(168, 85, 247, 0.22);
  border-radius: 24px;
  overflow: hidden;
  display: none;
  flex-direction: column;
  z-index: 999;
  box-shadow: 0 26px 80px rgba(0,0,0,0.65);
}
.eniq-panel.open{
  display:flex;
  animation: scaleIn .25s ease-out;
}
@keyframes scaleIn{
  from { opacity:0; transform: translateY(16px) scale(0.96); }
  to { opacity:1; transform: translateY(0) scale(1); }
}

/* ============== Header ============== */
.chat-header{
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: #fff;
  padding: 12px 14px;
  display:flex;
  align-items:center;
  gap: 10px;
}
.chat-header-left{
  display:flex;
  align-items:center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.chat-header-avatar{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: transparent;
  display:flex;
  align-items:center;
  justify-content:center;
  flex: 0 0 auto;
  overflow: hidden;
}
.chat-header-avatar .bot-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-header-info{
  min-width: 0;
}
.chat-header-title{
  font-weight: 700;
  font-size: 14px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-header-status{
  margin-top: 2px;
  display:flex;
  align-items:center;
  gap: 6px;
  font-size: 10px;
  font-weight: 400;
  opacity: 0.95;
}
.status-dot{
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  opacity: 0.95;
}
.close-btn{
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 18px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.close-btn:hover{ background: rgba(255,255,255,0.28); }

/* ============== Language dropdown ============== */
.lang-dropdown{
  position: relative;
  flex: 0 0 auto;
}

.lang-current{
  display:flex;
  align-items:center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.30);
  background: rgba(0,0,0,0.12);
  color: #fff;
  font-weight: 600;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}
.lang-current:hover{
  background: rgba(255,255,255,0.15);
}

#langLabel{
  min-width: 20px;
  text-align: center;
}

.lang-arrow{
  font-size: 8px;
  opacity: 0.7;
  transition: transform 0.2s;
}
.lang-dropdown.open .lang-arrow{
  transform: rotate(180deg);
}

.lang-menu{
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: #1e1e1e;
  border: 1px solid rgba(168, 85, 247, 0.30);
  border-radius: 12px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6);
  z-index: 10;
}
.lang-dropdown.open .lang-menu{
  display: flex;
}

.lang-option{
  padding: 10px 12px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}
.lang-option:hover{
  background: rgba(124, 58, 237, 0.20);
}
.lang-option.active{
  background: rgba(124, 58, 237, 0.35);
}

/* ============== Chat box ============== */
.chat-box{
  flex: 1;
  padding: 16px 14px;
  background: #070707;
  overflow-y: auto;
}
.chat-box::-webkit-scrollbar { width: 6px; }
.chat-box::-webkit-scrollbar-thumb { background: #2b2b2b; border-radius: 6px; }

/* ============== Messages ============== */
.message{
  display:flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  animation: fadeInUp .25s ease-out;
}
@keyframes fadeInUp{
  from { opacity:0; transform: translateY(8px); }
  to { opacity:1; transform: translateY(0); }
}

.message-avatar{
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display:flex;
  align-items:center;
  justify-content:center;
  flex: 0 0 auto;
  overflow: hidden;
}

.message.bot{ align-items: flex-start; }
.message.bot .message-avatar{
  background: transparent;
}
.message.bot .message-avatar .bot-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message.user{
  flex-direction: row-reverse;
  margin-left: auto;
  max-width: 85%;
}
.message.user .message-avatar{
  background: transparent;
  color: #fff;
  font-size: 14px;
}

.message-content{
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.message.bot .message-content{
  background: rgba(124, 58, 237, 0.14);
  border: 1px solid rgba(124, 58, 237, 0.28);
  color: #e5e7eb;
  border-bottom-left-radius: 6px;
}
.message.user .message-content{
  background: rgba(55, 65, 81, 0.62);
  border: 1px solid rgba(75, 85, 99, 0.50);
  color: #f3f4f6;
  text-align: right;
  border-bottom-right-radius: 6px;
}

/* ============== Searching row (typing animácia) ============== */
.searching-row{
  display:flex;
  gap: 10px;
  align-items: flex-start;
  margin: -2px 0 12px 0;
}
.searching-row .message-avatar{
  background: transparent;
}
.searching-row .message-avatar .bot-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.searching-bubble{
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.26);
  color: #d8b4fe;
  padding: 10px 12px;
  border-radius: 16px;
  border-bottom-left-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  min-height: 34px;
  display:flex;
  align-items:center;
  gap: 2px;
}

.typing-text{
  font-weight: 400;
}

.typing-cursor{
  font-weight: 300;
  animation: blink 0.8s step-end infinite;
  margin-left: 1px;
}

@keyframes blink{
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ============== Quick actions INLINE ============== */
.quick-actions-inline{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 16px 0;
  padding-left: 40px;
  animation: fadeInUp .35s ease-out;
}

.quick-action-btn{
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(124, 58, 237, 0.14);
  border: 1px solid rgba(124, 58, 237, 0.30);
  color: #e9d5ff;
  transition: all 0.2s;
}
.quick-action-btn:hover{
  background: rgba(124, 58, 237, 0.25);
  transform: translateY(-1px);
}

/* ============== Input ============== */
.input-area{
  padding: 12px 14px;
  background: #121212;
  border-top: 1px solid rgba(168, 85, 247, 0.16);
  display:flex;
  gap: 10px;
  align-items:center;
}
#message-input{
  flex: 1;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(168, 85, 247, 0.28);
  background: rgba(0,0,0,0.45);
  color: #f3f4f6;
  font-weight: 400;
  outline: none;
}
#message-input:focus{
  border-color: rgba(168, 85, 247, 0.60);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}
.send-btn{
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 18px;
}
.send-btn:disabled{ opacity: 0.55; cursor: not-allowed; }

/* ============== Mobile ============== */
@media (max-width: 480px){
  .eniq-panel{
    width: 92vw;
    height: 70vh;
    max-height: 620px;
  }
}
