/* ==== CHATBOT PALAZ - ULEPSZONE STYLE ==== */
/* Zachowane wszystkie oryginalne nazwy klas */

.palaz-chatbot {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 380px; /* zwiększona szerokość z 320px */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/*
.palaz-chatbot:hover {
    transform: translateY(-2px);
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.15));
}
*/
.palaz-chatbot #palaz-messages {
    max-height: 450px; /* zwiększona wysokość z 380px */
    overflow-y: auto;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
    border-radius: 16px 16px 0 0; /* bardziej zaokrąglone rogi */
    padding: 20px; /* zwiększony padding z 8px */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    scroll-behavior: smooth;
}

/* Stylizacja paska przewijania */
.palaz-chatbot #palaz-messages::-webkit-scrollbar {
    width: 6px;
}

.palaz-chatbot #palaz-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.palaz-chatbot #palaz-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.palaz-chatbot #palaz-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a42a0);
}

.palaz-chatbot form {
    display: flex;
    gap: 12px; /* dodany gap między elementami */
    padding: 15px; /* dodany padding */
    background: white;
    border-radius: 0 0 16px 16px;
    border: 1px solid #e9ecef;
    border-top: 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.palaz-chatbot input {
    flex: 1;
    padding: 14px 18px !important; /* zwiększony padding z 20px 8px */
    border: 2px solid #e9ecef !important;
    border-radius: 25px !important; /* zaokrąglone pole input */
    border-top: 2px solid #e9ecef !important; /* przywrócony border-top */
    font-size: 14px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    outline: none;
}

.palaz-chatbot input:focus {
    border-color: #667eea !important;
    background: white !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
    transform: translateY(-1px);
}

.palaz-chatbot input::placeholder {
    color: #6c757d;
    font-style: italic;
}

/* Przycisk wysyłania (jeśli istnieje) */
.palaz-chatbot button[type="submit"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.palaz-chatbot button[type="submit"]:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.palaz-chatbot button[type="submit"]:active {
    transform: scale(0.95);
}

.message {
    display: flex;
    gap: 12px; /* zwiększony gap z .5rem */
    margin-bottom: 18px; /* zwiększony margin z .5rem */
    align-items: flex-start;
    animation: messageSlide 0.5s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    flex-direction: row-reverse; /* wiadomości użytkownika po prawej */
}

.message.user .bubble {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-bottom-right-radius: 4px; /* mniejszy promień w rogu */
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}

.message.assistant .bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-left-radius: 4px; /* mniejszy promień w rogu */
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.25);
}

.bubble {
    padding: 14px 18px; /* zwiększony padding z .6rem 1rem */
    border-radius: 20px; /* bardziej zaokrąglone z 1rem */
    word-break: break-word;
    max-width: 75%; /* ograniczenie szerokości */
    position: relative;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Efekt shimmer dla wiadomości bota */

/*
.message.assistant .bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    border-radius: 20px;
    transform: translateX(-100%);
    animation: shimmer 3s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
*/
.avatar {
    width: 45px; /* zwiększony z 36px */
    height: 45px; /* zwiększony z 36px */
    border-radius: 50%;
    object-fit: cover;
    transition: all 0.3s ease;
    border: 3px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.avatar:hover {
    transform: scale(1.2); /* powiększenie o 20% */
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    z-index: 10;
}

/* Animacja pulsowania dla avatara bota */
.message.assistant .avatar {
    animation: avatarPulse 2s infinite;
}

@keyframes avatarPulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    }
}

.message.assistant .avatar:hover {
    animation: none; /* zatrzymanie pulsowania przy hover */
}

/* Status online dla avatara */
.avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #28a745;
    border-radius: 50%;
    border: 2px solid white;
    animation: onlinePulse 2s infinite;
}

@keyframes onlinePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* Wskaźnik pisania (jeśli potrzebny) */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    border-bottom-left-radius: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    animation: typingPulse 1.5s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.3s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes typingPulse {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    30% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Responsywność */
@media (max-width: 480px) {
    .palaz-chatbot {
        width: calc(100vw - 2rem);
        right: 1rem;
        left: 1rem;
    }
    
    .palaz-chatbot #palaz-messages {
        max-height: 300px;
        padding: 15px;
    }
    
    .avatar {
        width: 40px;
        height: 40px;
    }
    
    .avatar:hover {
        transform: scale(1.15); /* mniejsze powiększenie na mobile */
    }
    
    .bubble {
        max-width: 85%;
        padding: 12px 16px;
    }
}

/* Dodatkowe ulepszenia dla lepszej czytelności */
.palaz-chatbot #palaz-messages {
    /* Lepsze kontrasty dla tekstu */
    color: #2c3e50;
    line-height: 1.5;
}

.message.assistant .bubble {
    /* Zapewnienie dobrego kontrastu dla białego tekstu */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Animacja dla nowych wiadomości */
@keyframes newMessage {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    50% {
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message.new {
    animation: newMessage 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Subtelny gradient tła dla całego chatbota */
.palaz-chatbot::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 18px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.palaz-chatbot:hover::before {
    opacity: 0.1;
}
/*
.palaz-chatbot {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 320px;
    font-family: system-ui, sans-serif;
    z-index: 9999;
}

.palaz-chatbot #palaz-messages {
    max-height: 380px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px 8px 0 0;
    padding: 8px;
}

.palaz-chatbot form {
    display: flex;
}

.palaz-chatbot input {
    flex: 1;
    padding: 20px 8px !important;
    border: 1px solid #ccc !important;
      border-top-width: 1px;
      border-top-style: solid;
      border-top-color: rgb(204, 204, 204);
    border-top: 0 !important;
    border-radius: 0 0 8px 8px;
}

.message {
    display: flex;
    gap: .5rem;
    margin-bottom: .5rem;
    align-items: flex-start;
}

.message.user .bubble {
    background: #e0f0ff;
}

.message.assistant .bubble {
    background: #f4f4f4;
}

.bubble {
    padding: .6rem 1rem;
    border-radius: 1rem;
    word-break: break-word;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}