#ps-chat-bubble {
    position: fixed;
    bottom: 80px;
    right: 0;
    width: 70px;
    height: 60px;
    background-color: #40B0E6;
    border-radius: 15px 0 0 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    /* Usunęliśmy transition, ponieważ animacja przejmuje kontrolę nad transformacją. */
    /* transition: transform 0.2s ease-in-out; */
    z-index: 9998;

    /* --- NOWA LINIA --- */
    /* Aplikujemy naszą animację */
    animation: pulse 2.5s ease-in-out infinite;
}

#ps-chat-bubble:hover {
    transform: scale(1.1);
}

#ps-chat-window {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 350px;
    max-width: 90vw;
    height: 500px;
    max-height: 70vh;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s, transform 0.3s;
    transform-origin: bottom right;
    z-index: 9999;
}

#ps-chat-window.hidden {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}

.chat-header {
    background-color: #0073e6;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
}

#ps-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.chat-body {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f4f7f9;
}

#ps-chat-messages .message {
    margin-bottom: 10px;
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    word-wrap: break-word;
}

#ps-chat-messages .message.user {
    background-color: #0073e6;
    color: white;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

#ps-chat-messages .message.admin {
    background-color: #e5e5ea;
    color: black;
    border-bottom-left-radius: 4px;
    margin-right: auto;
}

.chat-footer {
    padding: 10px;
    border-top: 1px solid #ddd;
}

#ps-chat-form {
    display: flex;
}

#ps-chat-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
}

#ps-chat-form button {
    background-color: #0073e6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    min-width: 44px; /* Zapobiega kurczeniu się */
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}

#ps-chat-form button:hover {
    background-color: #005bb5;
}

#ps-chat-form button svg {
    margin-left: -2px; /* Drobna korekta wizualna */
}

/* Nowe style dla kontenera wiadomości */
#ps-chat-messages .message-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    max-width: 85%;
}

#ps-chat-messages .message-wrapper.user {
    align-self: flex-end;
    align-items: flex-end;
}

#ps-chat-messages .message-wrapper.admin {
    align-self: flex-start;
    align-items: flex-start;
}

#ps-chat-messages .message-content {
    padding: 10px 15px;
    border-radius: 18px;
    word-wrap: break-word;
}

#ps-chat-messages .message-wrapper.user .message-content {
    background-color: #0073e6;
    color: white;
    border-bottom-right-radius: 4px;
}

#ps-chat-messages .message-wrapper.admin .message-content {
    background-color: #e5e5ea;
    color: black;
    border-bottom-left-radius: 4px;
}

#ps-chat-messages .message-timestamp {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    padding: 0 8px;
}

/* Styl dla wiadomości powitalnej */
#ps-chat-messages .message-wrapper.welcome .message-content {
    background-color: #f0f8ff; /* Jasnoniebieskie tło */
    color: #333;
    border: 1px solid #d4e8f7;
    font-size: 13px;
    line-height: 1.5;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  }
  50% {
    transform: scale(1.07); /* Delikatne powiększenie o 7% */
    box-shadow: 0 6px 16px rgba(0,0,0,0.3); /* Cień staje się nieco większy i ciemniejszy */
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  }
}