﻿html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    font-family: "Segoe UI", Arial, sans-serif;
}

body {
    overflow: hidden;
}

.chatbot {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.chatbot__bubble,
.chatbot__panel {
    pointer-events: auto;
}

.chatbot__bubble {
    position: absolute;
    right: 15px;
    bottom: 115px;
    width: 68px;
    height: 68px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent !important;
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(39, 50, 0, 0.28);
    cursor: pointer;
    transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
    touch-action: manipulation;
}

.chatbot__bubble:hover {
    transform: translateY(-2px) scale(1.025);
    box-shadow: 0 18px 36px rgba(39, 50, 0, 0.34);
}

.chatbot__bubble:active {
    transform: scale(0.97);
}

.chatbot__bubble:focus-visible {
    outline: 3px solid #1f2a0a;
    outline-offset: 4px;
}

.chatbot__bubble-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.chatbot__bubble-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.chatbot__panel {
    position: absolute;
    right: 24px;
    bottom: 104px;
    width: 480px;
    height: 700px;
    min-width: 300px;
    min-height: 360px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 24px 50px rgba(34, 34, 34, 0.2);
    overflow: hidden;
    border: 1px solid #e0e3d4;
}

.chatbot__panel[hidden] {
    display: none !important;
}

.chatbot--full {
    pointer-events: auto;
}

.chatbot--full .chatbot__bubble,
.chatbot--full .chatbot__close,
.chatbot--full .chatbot__resize {
    display: none;
}

.chatbot--full .chatbot__panel {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.chatbot--full .chatbot__header {
    cursor: default;
}

.chatbot--wordpress {
    position: fixed;
    inset: 0;
    pointer-events: auto;
}

.chatbot--wordpress .chatbot__bubble {
    inset: 0;
    width: 68px;
    height: 68px;
}

.chatbot--wordpress .chatbot__panel {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
    box-sizing: border-box;
}

.chatbot__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: #222222;
    border-bottom: 4px solid #b2c100;
    cursor: move;
    user-select: none;
    touch-action: none;
}

.chatbot__header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.chatbot__header-logo {
    width: 42px;
    height: 42px;
    box-sizing: border-box;
    padding: 7px;
    border-radius: 999px;
    background: #ffffff;
    object-fit: contain;
    flex: 0 0 42px;
}

.chatbot__header strong {
    display: block;
    color: #ffffff;
}

.chatbot__header p {
    margin: 6px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
}

.chatbot__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    position: relative;
    z-index: 6;
    touch-action: manipulation;
}

.chatbot__close:hover {
    background: #b2c100;
    color: #222222;
}

.chatbot__messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8f8f4;
}

.chatbot__message-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 12px;
}

.chatbot__message-row--bot {
    justify-content: flex-start;
}

.chatbot__avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    flex: 0 0 32px;
    background: #ffffff;
    object-fit: cover;
    box-shadow: 0 6px 14px rgba(34, 34, 34, 0.14);
}

.chatbot__message {
    max-width: 85%;
    padding: 12px 14px;
    border-radius: 16px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.chatbot__message p {
    margin: 0 0 10px;
}

.chatbot__message p:last-child {
    margin-bottom: 0;
}

.chatbot__message ul,
.chatbot__message ol {
    margin: 0 0 10px;
    padding-left: 20px;
}

.chatbot__message ul:last-child,
.chatbot__message ol:last-child {
    margin-bottom: 0;
}

.chatbot__message code {
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(20, 50, 76, 0.1);
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9em;
}

.chatbot__message a {
    color: inherit;
    text-decoration: underline;
}

.chatbot__message--bot {
    border-left: 4px solid #b2c100;
    background: #ffffff;
    color: #293000;
}

.chatbot__message--user {
    margin-left: auto;
    background: #222222;
    color: #ffffff;
}

.chatbot__message--status {
    background: #eef0e7;
    color: #5a6247;
    font-style: italic;
}

.chatbot__composer {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 14px 16px;
    border-top: 1px solid #e0e3d4;
    background: #ffffff;
}

.chatbot__footer {
    flex: 0 0 auto;
    padding: 12px 16px 14px;
    border-top: 0;
    background: #ffffff;
    color: #6b7060;
    font-size: 12px;
    line-height: 1.45;
}

.chatbot__input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 52px;
    margin: 0;
    padding: 12px 14px;
    box-sizing: border-box;
    border: 1px solid #cfd5b9;
    border-radius: 14px;
    resize: none;
    font: inherit;
    user-select: text;
}

.chatbot__input:focus {
    border-color: #8d9a00;
    outline: 3px solid rgba(178, 193, 0, 0.2);
    outline-offset: 1px;
}

.chatbot__send {
    flex: 0 0 auto;
    min-width: 112px;
    min-height: 52px;
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    background: #b2c100;
    color: #222222;
    font-weight: 700;
    cursor: pointer;
}

.chatbot__send:hover:not(:disabled) {
    background: #a4b200;
}

.chatbot__send:focus-visible {
    outline: 3px solid #222222;
    outline-offset: 2px;
}

.chatbot__send:disabled,
.chatbot__input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.chatbot__resize {
    position: absolute;
    z-index: 5;
    background: transparent;
}

.chatbot__resize--top,
.chatbot__resize--bottom {
    left: 12px;
    right: 12px;
    height: 10px;
}

.chatbot__resize--top {
    top: -5px;
    cursor: ns-resize;
}

.chatbot__resize--bottom {
    bottom: -5px;
    cursor: ns-resize;
}

.chatbot__resize--left,
.chatbot__resize--right {
    top: 12px;
    bottom: 12px;
    width: 10px;
}

.chatbot__resize--left {
    left: -5px;
    cursor: ew-resize;
}

.chatbot__resize--right {
    right: -5px;
    cursor: ew-resize;
}

.chatbot__resize--top-left,
.chatbot__resize--top-right,
.chatbot__resize--bottom-left,
.chatbot__resize--bottom-right {
    width: 18px;
    height: 18px;
}

.chatbot__resize--top-left {
    top: -8px;
    left: -8px;
    cursor: nwse-resize;
}

.chatbot__resize--top-right {
    top: -8px;
    right: -8px;
    cursor: nesw-resize;
}

.chatbot__resize--bottom-left {
    bottom: -8px;
    left: -8px;
    cursor: nesw-resize;
}

.chatbot__resize--bottom-right {
    right: -8px;
    bottom: -8px;
    cursor: nwse-resize;
}

@media (max-width: 640px) {
    .chatbot {
        inset: 0;
    }

    .chatbot__bubble {
        right: 16px;
        bottom: 16px;
    }

    .chatbot__panel {
        right: 12px !important;
        left: 12px;
        bottom: 12px !important;
        top: 12px;
        width: auto !important;
        height: auto !important;
        max-width: none;
        max-height: none;
    }

    .chatbot__composer {
        align-items: stretch;
        flex-direction: column;
    }

    .chatbot__send {
        width: 100%;
    }

    .chatbot__resize {
        display: none;
    }

    .chatbot--full .chatbot__panel {
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
    }

    .chatbot--wordpress .chatbot__panel {
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: auto !important;
        height: auto !important;
    }

    .chatbot--wordpress .chatbot__resize {
        display: block;
    }

}

@media (prefers-reduced-motion: reduce) {
    .chatbot__bubble {
        transition: none;
    }

    .chatbot__bubble:hover,
    .chatbot__bubble:active {
        transform: none;
    }
}
