/* 🔹 Pozycjonowanie chat icon */
.chat-icon-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1100; /* Wyżej niż chat */
}

.chat-icon {
    width: 50px;
    height: 50px;
    cursor: pointer;
    border: none;
    background: none;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease-in-out;
}

/* Efekt hover na ikonie */
.chat-icon:hover {
    transform: scale(1.1);
}

/* 🔹 Okno chatu */
.chat-window {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 300px;
    max-height: 400px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden; /* Zapobiega wyjściu elementów poza granice */
}

/* 🔹 Nagłówek chatu */
.chat-header {
    background: #007BFF;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

/* Przycisk zamykania chatu */
.close-chat {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

/* 🔹 Wiadomości */
.chat-messages {
    flex-grow: 1;
    padding: 10px;
    overflow-y: auto; /* Możliwość przewijania */
    max-height: 280px; /* Utrzymuje przewijanie, ale zostawia miejsce na input */
}

/* Każda wiadomość */
.chat-message {
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 5px;
    background: #F1F1F1;
    font-size: 14px;
    display: flex;
    flex-direction: column;
}

.chat-message strong {
    font-weight: bold;
}

.chat-message small {
    font-size: 10px;
    color: #777;
    margin-top: 3px;
}

/* Wiadomości użytkownika */
.chat-message.user {
    background: #DCF8C6;
    text-align: right;
    align-self: flex-end;
}

/* 🔹 Input i przycisk */
.chat-input {
    display: flex;
    padding: 10px;
    background: #f9f9f9;
    align-items: center;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

/* Styl inputa */
.chat-input input {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    color: black !important;
    font-size: 14px;
}

/* Placeholder na czarny */
.chat-input input::placeholder {
    color: black !important;
    opacity: 1;
}

/* Styl przycisku wysyłania */
.chat-input button {
    background: #007BFF;
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 5px;
    margin-left: 5px;
}

/* Efekt hover na przycisku */
.chat-input button:hover {
    background: #0056b3;
}

.chat-counter {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgb(255, 183, 0);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 7px;
    border-radius: 50%;
    display: none; /* Ukryty, jeśli nie ma nowych wiadomości */
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Efekt pulsowania, ale tylko gdy są nowe wiadomości */
.chat-icon.pulsing {
    animation: pulse 1s infinite;
}
/* 🔹 Responsywność dla telefonów */
@media (max-width: 400px) {
    .chat-window {
        width: 90%;
        right: 5%;
    }

    .chat-messages {
        max-height: 250px;
    }
}
/* Ukrywanie ikony domyślnie */
.chat-icon {
    display: none;
}