/************************
* PODSTAWOWE STYLE CHATBOTA 
*************************/

#simple-chatbot-icon {
    position: fixed;
    bottom: 60px;
    right: 60px;
    z-index: 99;
    transition: transform 0.3s ease;
}

#simple-chatbot-icon:hover {
    transform: scale(1.1);
}

#simple-chatbot-icon .dashicons {
    font-size: 60px;
    color: #286fa1;
    cursor: pointer;
    transition: color 0.3s ease;
}

#simple-chatbot-icon:hover .dashicons {
    color: #1d5a8a;
}

#simple-chatbot-window {
    position: fixed;
    bottom: 120px;
    right: 30px;
    width: 360px;
    height: 520px;
    background: #fff;
    border: 1px solid #e1e5e8;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    z-index: 100;
    overflow: hidden;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    transform: translateY(8px);
    opacity: 0;
    animation: fadeInUp 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#simple-chatbot-window .chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, #0077C8 0%, #003057 100%);
    color: white;
    position: relative;
}

#simple-chatbot-window .chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
}

#simple-chatbot-window .chat-header-text {
    color: white;
    font-weight: 600;
    font-size: 17px;
    margin: 0;
    letter-spacing: 0.3px;
}

#simple-chatbot-window .close-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    border-radius: 50%;
    width: 32px;
    height: 32px;
}

#simple-chatbot-window .close-button:hover {
    transform: scale(1.5);
}

#simple-chatbot-window .close-button .dashicons {
    font-size: 18px;
    padding-top: 3px;
    color: white;
    transition: transform 0.25s ease;
}

#simple-chatbot-window .chat-body {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background-color: #f8fafc;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}

/************************
* STYLE KONWERSACJI
*************************/

.chat-conversation {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 14px;
}

.message-bubble {
    max-width: 82%;
    padding: 0px 18px;
    margin-bottom: 10px;
    border-radius: 20px;
    line-height: 1.5;
    position: relative;
    animation: fadeIn 0.35s ease-out;
    word-wrap: break-word;
    font-size: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    scroll-margin: 20px;
}

.bot-message {
    background: white;
    align-self: flex-start;
    border-radius: 20px 20px 20px 6px;
    border: 1px solid #e8ecf0;
    color: #333;
}

.bot-message::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 20px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-top-color: white;
    border-left: 0;
    margin-left: -10px;
    margin-bottom: -10px;
}

.user-message {
    background: #286fa1;
    color: white;
    align-self: flex-end;
    border-radius: 20px 20px 6px 20px;
}

.user-message::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 20px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-top-color: #286fa1;
    border-right: 0;
    margin-right: -10px;
    margin-bottom: -10px;
}

/************************
* PRZYCISKI PYTAŃ
*************************/

.questions-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    transition: opacity 0.3s ease;
}

.chat-question-button {
    background: rgba(40, 111, 161, 0.08);
    color: #286fa1;
    border: none;
    border-radius: 20px;
    padding: 14px 18px;
    cursor: pointer;
    text-align: left;
    transition: all 0.25s ease;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chat-question-button:hover {
    background: rgba(40, 111, 161, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.end-conversation-button {
    background: transparent;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 14px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.25s ease;
    font-size: 15px;
    font-weight: 500;
}

.end-conversation-button:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: #d0d0d0;
    color: #444;
}

/************************
* ANIMACJE
*************************/

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typingDot {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.6;
    }

    50% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/************************
* RESPONSYWNOŚĆ
*************************/

@media (max-width: 480px) {
    #simple-chatbot-window {
        width: calc(100% - 50px);
        height: 70vh;
        bottom: 90px;
        right: 25px;
        border-radius: 16px;
    }

    .message-bubble {
        max-width: 88%;
        padding: 12px 16px;
        font-size: 14px;
    }

    .chat-question-button,
    .end-conversation-button {
        padding: 12px 16px;
        font-size: 14px;
    }
}