#ama { background-color: rgba(240, 242, 250, 0.85); padding: 12px; padding-bottom: 0px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); border-radius: 10px; height: 650px; overflow-y: scroll; display: flex; flex-direction: column; justify-content: space-between; margin-top: -44px; margin-bottom: 48px; position: relative; }
#ama::-webkit-scrollbar { width: 6px}
#ama::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.05); border-radius: 10px; }
#ama::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.3); border-radius: 10px; }
#ama::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.5); }

.ama-header { display: flex; align-items: center; gap: 10px; padding: 10px; background-color: rgba(240, 242, 250, 1); border-bottom: 1px solid #eee; width: auto!important; position: sticky; top: -12px; width: 100%; margin: -12px -12px 0 -12px; z-index: 10; }
.ama-header-avatar { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.ama-header-dot { width: 10px; height: 10px; border-radius: 50%; background-color: #0f0; animation: pulse 1.5s infinite; }
.ama-header-name { font-size: 1rem; font-weight: bold; color: #333; }

.top-content { flex: 1;}

.ama-message { margin: 0.8rem 0; display: flex; align-items: end; }
.ama-message-role-assistant { justify-content: left; position: relative; }
.ama-message-role-user { justify-content: right; position: relative; }
.ama-message-role-assistant::before { content: ''; display: block; width: 32px; height: 32px; background-image: url('/wp-content/uploads/2025/07/kopernik-avatar-2.png'); background-size: cover; background-position: center; border-radius: 7px; margin-right: 10px; }
.ama-message-role-user::after { content: ''; display: block; width: 32px; height: 32px; background-image: url('/wp-content/uploads/2024/12/1000_F_331699188_lRpvqxO5QRtwOM05gR50ImaaJgBx68vi.jpg'); background-size: cover; background-position: center; border-radius: 7px; margin-left: 10px; }
.ama-message-text { font-size: 1rem; padding: 0.5rem 0.7rem; border-radius: 0.5em; background: #eee; max-width: 80%; border: 1px solid #ddd; }
.ama-message-text p { margin: 0!important; }
.ama-message-text p + p { margin-top: 0.5em; }
.ama-message-role-assistant .ama-message-text { background: #bdc5fd; color: #2a2a2a; }

.ama-form { position: sticky; bottom: 0; left: 0; width: 100%; background-color: rgba(240, 242, 250, 1); padding-bottom: 12px;}
.ama-form-submit { 
    position: absolute; 
    right: 10px; 
    top: 6px;  
    background-color: #4a90e2; 
    color: white;
    padding: 5px 16px;
    border-radius: 8px;
    outline: none; 
    border: none; 
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.ama-form-submit:hover {
    background-color: #357abd;
}

.ama-form-submit:active {
    background-color: #2a5f9e;
}

.ama-form-control { width: 100%; display: block; padding: 0.5rem 1rem; padding-right: 44px; border: 1px solid #EEE; box-sizing: border-box; font: inherit; border-radius: 12px; outline: none; font-size: 0.8rem; padding-right: 95px;}

.ama-intro { text-align: center; margin-top: 2rem; }
.ama-intro img { width: 200px; border-radius: 12px; }
.ama-intro p { font-weight: bold; margin: 0.5rem 0!important; }

.ama-status { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 0.8rem; }
.ama-status-dot { width: 10px; height: 10px; border-radius: 50%; background-color: #0f0; animation: pulse 1.5s infinite; }

.ama-spinner { border-radius: 0.5em; padding-top: 1rem; padding-bottom: 1rem; display: flex; align-items: center; gap: 16px; }
.ama-spinner-status { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 15px; }
.ama-spinner-status-loader { width: 20px; height: 20px; border: 3px solid rgba(0, 0, 0, 0.2); border-top-color: #0f0; border-radius: 50%; animation: spin 1s linear infinite; }
.ama-spinner-status-text { font-size: 14px; color: #333; font-style: italic; }

.ama-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

.ama-typing { display: flex; gap: 5px; }
.ama-typing span { width: 8px; height: 8px; background-color: #000; border-radius: 50%; animation: typing 1.5s infinite ease-in-out; }
.ama-typing span:nth-child(1) { animation-delay: 0s; }
.ama-typing span:nth-child(2) { animation-delay: 0.2s; }
.ama-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 100% {
      transform: scale(0.5);
      opacity: 0.5;
  }
  50% {
      transform: scale(1);
      opacity: 1;
  }
}

@keyframes spin {
  to {
      transform: rotate(360deg);
  }
}


@keyframes pulse {
  0%, 100% {
      opacity: 1;
  }
  50% {
      opacity: 0.3;
  }
}