/* chatbot-style.css */

/* ... (reszta stylów bez zmian na początku) ... */

#chat-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #ff772d; /* ZMIANA KOLORU */
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s ease-out;
    z-index: 99998;
    /* NOWA ANIMACJA - domyślnie subtelne pulsowanie */
    animation: pulseBubble 2s infinite ease-in-out;
}

#chat-bubble.has-notification {
    /* Mocniejsza animacja, gdy jest powiadomienie */
    animation: pulseNotificationBubble 1.5s infinite ease-in-out;
}


#chat-bubble:hover {
    transform: scale(1.1);
    animation-play-state: paused; /* Zatrzymaj animację pulsowania przy najechaniu */
}

/* NOWE KEYFRAMES ANIMACJI */
@keyframes pulseBubble {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
}

@keyframes pulseNotificationBubble {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 119, 45, 0.7); /* Kolor #ff772d z przezroczystością */
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(255, 119, 45, 0); /* Rozszerzający się cień */
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 119, 45, 0);
    }
}


#chat-bubble svg {
    width: 30px;
    height: 30px;
}

#chat-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: red; /* Ten kolor może pozostać czerwony dla kontrastu */
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

/* ----- STYLE GŁÓWNEGO KONTENERA CZATU ----- */
#chat-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 360px;
    max-width: calc(100% - 40px);
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    z-index: 99999;
    overflow: hidden;
    transform-origin: bottom right;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55), opacity 0.3s ease-out;
}

#chat-container.minimized {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* ----- NAGŁÓWEK CZATU ----- */
#chat-header {
    background-color: #ff772d; /* ZMIANA KOLORU */
    color: white;
    padding: 10px 15px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0601a; /* Ciemniejszy odcień #ff772d */
}

#chat-header-title {
    /* Styl dla tytułu nagłówka */
}

#chat-close-button {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    opacity: 0.8;
}

#chat-close-button:hover {
    opacity: 1;
}

/* ----- OKNO WIADOMOŚCI ----- */
#chat-window {
    height: 320px;
    overflow-y: auto;
    padding: 15px;
    border-bottom: 1px solid #eeeeee;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 0.9rem;
}

.user-message {
    background-color: #ff772d; /* ZMIANA KOLORU */
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
}

.ai-message {
    background-color: #eef1f5;
    color: #333333;
    align-self: flex-start;
    border-bottom-left-radius: 6px;
}

.ai-message a {
    color: #e0601a; /* Ciemniejszy odcień #ff772d */
    text-decoration: underline;
}
.ai-message a:hover {
    text-decoration: none;
}

.ai-message.typing-indicator {
    font-style: italic;
    color: #555;
    background-color: transparent;
    padding-top: 5px;
    padding-bottom: 5px;
}

.ai-message.typing-indicator .dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    background-color: #777;
    border-radius: 50%;
    margin-left: 2px;
    animation: typingDots 1.4s infinite ease-in-out both;
}
.ai-message.typing-indicator .dot:nth-child(1) { animation-delay: -0.32s; }
.ai-message.typing-indicator .dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingDots { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }

/* ----- SUGESTIE ----- */
#chat-suggestions {
    padding: 5px 15px 10px 15px;
    border-bottom: 1px solid #eeeeee;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-suggestion-btn {
    background-color: #f0f0f0;
    border: 1px solid #dcdcdc;
    color: #333;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.chat-suggestion-btn:hover {
    background-color: #e0e0e0;
    border-color: #c0c0c0;
}

/* ----- OBSZAR WPISYWANIA ----- */
#input-area {
    display: flex;
    padding: 10px 15px;
    background-color: #ffffff;
    align-items: center;
}

#message-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #dcdcdc;
    border-radius: 20px;
    margin-right: 10px;
    font-size: 0.9rem;
    outline: none;
    resize: none;
    line-height: 1.4;
}

#message-input:focus {
    border-color: #ff772d; /* ZMIANA KOLORU */
    box-shadow: 0 0 0 1px #ff772d; /* ZMIANA KOLORU */
}

#send-button {
    padding: 10px 15px;
    background-color: #ff772d; /* ZMIANA KOLORU */
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#send-button:hover {
    background-color: #e0601a; /* Ciemniejszy odcień #ff772d */
}

#send-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}