/* Container, joka pitää sisällään koko chatin ja antaa sille kiinteän sijainnin */
#oma-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: inherit;
}

/* Chat-painike, jolla avataan ja suljetaan chat */
#oma-chatbot-button {
    background-color: #28a52d;
    color: #f9f9f9;
    padding: 15px 25px;
    border-radius: 9999px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    text-align: center;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

#oma-chatbot-button:hover {
    background-color: #238a27;
}

/* Itse chat-ikkunan kontaineri */
#oma-chatbot-box {
    width: 350px;
    height: 500px;
    background-color: #111111;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 0;
    right: 0;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    transform: translateY(0);
    opacity: 1;
    max-width: calc(100vw - 40px);
}

/* Minimoitu tila */
#oma-chatbot-box.minimized {
    transform: translateY(100%) scale(0.5);
    opacity: 0;
    pointer-events: none;
}

/* Piilota chat-nappi, kun chat-ikkuna on auki */
#oma-chatbot-box:not(.minimized)+#oma-chatbot-button {
    transform: translateY(100%) scale(0.5);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* Chat-ikkunan yläpalkki */
#oma-chatbot-header {
    background-color: #111111;
    color: #f9f9f9;
    padding: 15px;
    font-weight: bold;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Sulje-napin tyyli */
#oma-chatbot-close-button {
    font-size: 1.8em;
    cursor: pointer;
    line-height: 1;
    margin-right: 5px;
}

/* "Yhteys ihmiseen" -napin tyyli */
#human-handover-button {
    background-color: inherit;
    color: inherit;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    font-weight: bold;
}

#human-handover-button:hover {
    color: #28a52d;
}

/* Viestien näyttöalue */
#oma-chatbot-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #f9f9f9;
}

/* Vierityspalkin tyyli */
#oma-chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

#oma-chatbot-messages::-webkit-scrollbar-thumb {
    background-color: #A4A4A4;
    border-radius: 10px;
}

/* Yksittäisen viestin kontaineri */
.chat-message {
    padding: 10px 15px;
    border-radius: 20px;
    max-width: 80%;
    word-wrap: break-word;
}

/* Käyttäjän viestin tyyli */
.user-message {
    align-self: flex-end;
    background-color: #b1c5a4;
    color: #111111;
}

/* Botin viestin tyyli */
.bot-message {
    align-self: flex-start;
    background-color: #e5e5e5;
    color: #111111;
}

/* Kirjoitus- ja lähetysalueen kontaineri */
#oma-chatbot-input-area {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 10px;
    background-color: #f9f9f9;
    border-top: 1px solid #ddd;
}

/* Lähetyslomakkeen tyyli */
#oma-chatbot-form {
    display: flex;
    width: 100%;
    gap: 10px;
}

/* Syöttökenttä */
#oma-chatbot-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 15px;
    outline: none;
    font-size: 14px;
}

/* Lähetysnappi */
#oma-chatbot-send-button {
    background-color: #28a52d;
    color: #f9f9f9;
    border: none;
    border-radius: 15px;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

#oma-chatbot-send-button:hover {
    background-color: #238a27;
}

/* Offline-lomakkeen syöttökenttien ja nappien yhteinen tyyli */
#offline-contact-form input,
#offline-contact-form textarea,
#offline-contact-form button {
    border-radius: 15px;
    padding: 10px 15px;
    font-size: medium;
    font-family: unset;
    border: none;
    color: #111111;
}

/* Offline-lomakkeen syöttökenttien tyylit */
#offline-contact-form input,
#offline-contact-form textarea {
    background-color: #e5e5e5;
    max-width: 80%;
}

/* Offline-lomakkeen nappien tyylit */
#offline-contact-form button {
    background-color: #28a52d;
    max-width: 90%;
}

#cancel-offline-form {
    background-color: #e5e5e5 !important;
}

/* Animaation tyylit */
#typing-indicator {
    padding: 10px 15px;
    display: inline-block;
}

#typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 1px;
    background-color: #666;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

#typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

#typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

#typing-indicator span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}