/* Główny kontener chatbota */
#chatbot-container {
    position: fixed;      
    bottom: 20px;         
    right: 20px;          
    width: 380px;         
    max-height: 500px;   
    min-height: 20vh; 
    border-radius: 1.2rem;  
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    font-family: 'Poppins', sans-serif;
    z-index: 9999;
    overflow: hidden;
    font-size: 0.9rem;
    background-image: url(/plugins/system/chatbot/assets/img/tlo-czatbot.webp);
}


/* Nagłówek okna */
#chatbot-container .chat-header {
color: #fff;
  padding: 10px;
  font-weight: 300;
  text-align: center;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  justify-content: space-between;
}

#chatbot-container .chat-header span:nth-child(1){
  display: flex;
  margin-left: 0.5rem;
  gap: 0.5rem;
  align-items: center;
}

#chatbot-container .chat-header span:nth-child(1)::before{
content: "";    
display: block;
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;          /* zielony */
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse 1.5s ease-in-out infinite;
  margin-top: 6px;
}

@keyframes pulse {
  0% {
    transform: translateY(-50%) scale(1);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  }
  70% {
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
  100% {
    transform: translateY(-50%) scale(1);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status::before { animation: none; }
}

/* Okno wiadomości */
#chatbot-container .chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

/* Wiadomość użytkownika */
#chatbot-container .chat-message.user {
color: #f7f5f9;
  padding: 8px 12px;
  border-radius: 12px 12px 0 12px;
  margin: 6px 0;
    margin-top: 6px;
  margin-top: 6px;
  align-self: flex-end;
  max-width: 80%;
  margin-top: 2rem;
  position: relative;
  border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(100deg,#9432f3, #8041f1);
  box-shadow: 0 0 20px rgba(0,246,255,.08), inset 0 0 20px rgba(118,85,47,.07);
  font-size: 0.8rem;
  margin-left: auto;
}

/* Wiadomość bota */
#chatbot-container .chat-message.bot {
    color: #fff;
    padding: 8px 12px;
    border-radius: 12px 12px 12px 0;
    margin: 6px 0;
    align-self: flex-start;
    max-width: 80%;
    font-size: 0.8rem;


    border: 1px solid rgba(255,255,255,.16);
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
    box-shadow: 0 0 20px rgba(0,246,255,.08), inset 0 0 20px rgba(168,85,247,.07);


}

/* Formularz do wpisywania pytania */
#chatbot-container .chat-input {
    display: flex;
    border-top: 1px solid #1c1717;




}

/* Pole tekstowe */
#chatbot-container .chat-input input {

    padding: 1rem;
    border: none;
    outline: none;
font-size: 0.85rem;
  font-family: "poppins";


      background: var(--panel);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 0 30px rgba(0,246,255,.25), inset 0 0 50px rgba(168,85,247,.08);
  color: #fff;



}

/* Przycisk wyślij */
#chatbot-container .chat-input button {
    color: #fff;
    border: none;
    padding: 0 16px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
    background-color: transparent;
}

#chatbot-container .chat-input button img{
height: 20px;
  width: 20px;
}


#chatbot-container .chat-input button:hover {
    background-color: #ff0150;
}

/* Pasek przewijania w oknie wiadomości */
#chatbot-container .chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chatbot-container .chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 3px;
}

/* === RESPONSYWNOŚĆ - URZĄDZENIA MOBILNE === */
@media (max-width: 768px) {
    #chatbot-container {
width: 50%;
    max-height: 50%;
    bottom: 0;
    right: 1%;
    left: 1%;
    }

    #chatbot-container .chat-messages {
        padding: 8px;
    }

    #chatbot-container .chat-input input {
        font-size: 0.85rem;
        padding: 10px;
        padding-left: 20px;
    }

    #chatbot-container .chat-input button {
        padding: 0 12px;
        font-size: 0.85rem;
    }
}



@media (max-width: 500px) {

  #chatbot-container {
    width: 84%;
    max-height: 50%;
    bottom: 70px;
    right: 1%;
    left: 15%;
    z-index: 2;
  }
  
}


.chatbot-wrapper {
    width: 350px;
    border: 1px solid #036aae;
    border-radius: 8px;
    font-family: Arial, sans-serif;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    overflow: hidden;
    z-index: 9999;
}

.chatbot-header {
    background: #036aae;
    color: #fff;
    padding: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.chatbot-content {
    padding: 10px;
    max-height: 400px;
    overflow-y: auto;
    display: block;
}



#minimalizuj_oknobota{
display: inline-block;
  width: 15px;
  height: 15px;
  margin-left: 20px;
  margin-bottom: 4px;
  margin-right: 0.5rem;
  align-self: center;
  background-image: url(/plugins/system/chatbot/assets/img/zminimalizuj.svg);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom;
}


.zminimalizowany #minimalizuj_oknobota{
  background-image: url(/plugins/system/chatbot/assets/img/zmaksymalizuj.svg);
}


/* Typing indicator (3 kropki) */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.typing-indicator .dot {
  width: 6px;
  height: 6px;
  background: rgba(255,255,255,0.8);
  border-radius: 50%;
  animation: bounce 1s infinite ease-in-out;
}

.typing-indicator .dot:nth-child(2) {
  animation-delay: .2s;
}

.typing-indicator .dot:nth-child(3) {
  animation-delay: .4s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}



/* Animacja pojawiania się wiadomości */
.chat-message {
  opacity: 0;
  transform: translateY(6px);
  animation: messageIn 0.35s ease forwards;
}

@keyframes messageIn {
  0% {
    opacity: 0;
    transform: translateY(6px);
    background-color: rgba(0, 246, 255, 0.08); /* delikatne podświetlenie */
  }
  70% {
    opacity: 1;
    transform: translateY(0);
    background-color: rgba(0, 246, 255, 0.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    background-color: transparent; /* wraca do normalnego */
  }
}


/* Animacja pojawiania się wiadomości */
.chat-message {
  opacity: 0;
  transform: translateY(6px);
  animation: messageIn 0.35s ease forwards;
}

@keyframes messageIn {
  0% {
    opacity: 0;
    transform: translateY(6px);
    background-color: rgba(0, 246, 255, 0.08); /* delikatne podświetlenie */
  }
  70% {
    opacity: 1;
    transform: translateY(0);
    background-color: rgba(0, 246, 255, 0.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    background-color: transparent; /* wraca do normalnego */
  }
}


#chatbot-container .typing-indicator { display:inline-flex; gap:6px; }
#chatbot-container .typing-indicator .status-hint { opacity:0; transition:opacity 160ms ease; white-space:nowrap; }
#chatbot-container .typing-indicator .status-hint.visible { opacity:.7; font-style: italic;font-size:0.7rem;}


.chat-message a{
  color: #d8ff82;
}
