/* assets/css/chatbot.css */

:root {
    --farita-grey: #f5f5f5;
    --farita-blue: #EB268F;
    --farita-black: #303030;
}

body.farita-chat-open .farita-chat-window {
    display: flex;
}

.farita-chat-button {
    position: fixed;
    bottom: 60px;
    right: 20px;
    z-index: 998;
    background-color: var(--farita-black);
    color: white;
    height: 80px;
    width: 80px;
    border-radius: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    animation: farita-popupBounce 2s ease-in-out infinite;
}

.farita-chat-button img {
    width: 80px;
    pointer-events: none;
}

.farita-chat-button::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--farita-blue);
    animation: farita-pulseRing 2s ease-out infinite;
}

.farita-chat-button::after {
    content: '1';
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    animation: farita-badgePulse 1.5s ease-in-out infinite;
}

.farita-chat-button:hover {
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
    transform: scale(1.1);
    animation: none;
}

body.farita-chat-open .farita-chat-button::after {
    display: none;
}

.farita-chat-helper-text {
    position: fixed;
    bottom: 80px;
    right: 110px;
    background: white;
    color: var(--farita-black);
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-family: "Montserrat", sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell;
    z-index: 997;
    max-width: 200px;
    animation: farita-slideInFade 0.5s ease-out, farita-floatText 3s ease-in-out infinite;
}

.farita-chat-helper-text::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid white;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

body.farita-chat-open .farita-chat-helper-text {
    display: none;
}

@keyframes farita-slideInFade {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes farita-floatText {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes farita-popupBounce {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    10% {
        transform: translateY(-10px) scale(1.05);
    }

    20% {
        transform: translateY(0) scale(1);
    }

    30% {
        transform: translateY(-5px) scale(1.02);
    }

    40% {
        transform: translateY(0) scale(1);
    }
}

@keyframes farita-pulseRing {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

@keyframes farita-badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.farita-chat-window {
    font-family: "Montserrat", sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell;
    display: none;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
    background-color: white;
    border-radius: 20px;
    position: fixed;
    z-index: 999;
    bottom: 60px;
    right: 20px;
    height: 500px;
    width: 360px;
    flex-direction: column;
    justify-content: space-between;
    animation: farita-slideUp 0.3s ease-out;
}

.farita-chat-window * {
    font-family: "Montserrat", sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell;
}

.farita-close {
    border: none;
    padding: 8px 0;
    background-color: var(--farita-black);
    color: white;
    border-radius: 20px 20px 0 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.farita-close:hover {
    opacity: 0.8;
}

.farita-chat {
    flex: 1;
    padding: 0 8px;
    overflow-y: scroll;
}

.farita-chat p {
    border-radius: 20px;
    width: 80%;
    margin: 8px 0;
    font-size: 16px;
    padding: 16px;
}

.farita-chat div.farita-model p {
    background-color: var(--farita-grey);
}

.farita-chat div.farita-user {
    display: flex;
    justify-content: flex-end;
}

.farita-chat div.farita-user p {
    background-color: var(--farita-blue);
    color: white;
}

.farita-chat div.farita-error p {
    font-size: 14px;
    text-align: center;
    color: red;
}

.farita-input-area {
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 8px;
    border-top: 1px solid lightgray;
}

.farita-input-area input {
    height: 40px;
    flex: 1;
    border: none;
    background-color: var(--farita-grey);
    border-radius: 20px;
    padding-left: 20px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.farita-input-area input:focus {
    box-shadow: 0 0 0 2px var(--farita-blue);
}

.farita-input-area button {
    height: 40px;
    width: 40px;
    border-radius: 100%;
    border: none;
    margin-left: 12px;
    background-color: var(--farita-blue);
    padding: 0;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.farita-input-area button:hover {
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
    transform: translateY(-2px);
}

@keyframes farita-slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.farita-loader {
    width: 40px;
    opacity: 0.4;
    aspect-ratio: 4;
    background: radial-gradient(circle closest-side, #000 90%, #0000) 0/calc(100%/3) 100% space;
    clip-path: inset(0 100% 0 0);
    animation: farita-loader 1.5s steps(4) infinite;
    margin: 8px;
}

@keyframes farita-loader {
    to {
        clip-path: inset(0 -34% 0 0)
    }
}

.farita-chat label {
    display: block;
    margin: 5px 0;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.farita-chat label:hover {
    background-color: rgba(235, 38, 143, 0.1);
}

.farita-chat input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

@media (max-width: 480px) {
    .farita-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 60px;
        right: 20px;
    }

    .farita-chat-button {
        width: 70px;
        height: 70px;
    }

    .farita-chat-button img {
        width: 70px;
    }

    .farita-chat-helper-text {
        bottom: 70px;
        right: 95px;
        max-width: 150px;
        font-size: 12px;
        padding: 10px 12px;
    }
}