@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500&family=Barlow+Condensed:wght@500;600&display=swap');

#jtsu-chat-widget {
    all: initial;
    position: fixed;
    z-index: 999999;
    right: 20px;
    bottom: 20px;
    font-family: "Barlow", Arial, Helvetica, sans-serif;
}

#jtsu-chat-widget * {
    box-sizing: border-box;
    font-family: inherit;
}

#jtsu-chat-widget .jtsu-chat-bubble {
    position: relative;
    width: 58px;
    height: 58px;
    border: none;
    border-radius: 50%;
    background: #1769d2;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 150ms ease;
}

#jtsu-chat-widget .jtsu-chat-bubble:hover {
    transform: scale(1.06);
}

#jtsu-chat-widget .jtsu-chat-bubble-icon {
    width: 26px !important;
    height: 26px !important;
    max-width: 26px !important;
    display: block;
}

#jtsu-chat-widget .jtsu-chat-bubble-icon path,
#jtsu-chat-widget .jtsu-chat-send path {
    fill: #ffffff !important;
    stroke: none !important;
}

#jtsu-chat-widget .jtsu-chat-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e23434;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #ffffff;
}

#jtsu-chat-widget .jtsu-chat-bubble.is-open .jtsu-chat-bubble-icon {
    display: none;
}

#jtsu-chat-widget .jtsu-chat-bubble.is-open::after {
    content: "×";
    font-size: 30px;
    line-height: 1;
}

#jtsu-chat-widget .jtsu-chat-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(340px, calc(100vw - 40px));
    height: min(480px, calc(100vh - 140px));
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(17, 24, 39, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

#jtsu-chat-widget .jtsu-chat-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

#jtsu-chat-widget .jtsu-chat-logo {
    height: 22px !important;
    width: auto !important;
    max-width: none !important;
    display: block;
    justify-self: center;
}

#jtsu-chat-widget .jtsu-chat-header-title {
    justify-self: center;
    text-align: center;
    white-space: nowrap;
    font-family: "Barlow Condensed", "Barlow", Arial, sans-serif;
    font-weight: 500;
    font-size: 15px;
    line-height: 1;
    letter-spacing: 0.01em;
    color: #111827;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
}

#jtsu-chat-widget .jtsu-chat-header-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
}

#jtsu-chat-widget .jtsu-chat-close {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

#jtsu-chat-widget .jtsu-chat-close:hover {
    color: #111827;
}

#jtsu-chat-widget .jtsu-chat-lang-switch {
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    flex-shrink: 0;
}

#jtsu-chat-widget .jtsu-chat-lang-option {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #6b7280;
    line-height: 1.4;
}

#jtsu-chat-widget .jtsu-chat-lang-option.is-active {
    background: #111827;
    color: #ffffff;
}

#jtsu-chat-widget .jtsu-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f7f8fa;
}

#jtsu-chat-widget .jtsu-chat-message {
    display: flex;
    max-width: 82%;
}

#jtsu-chat-widget .jtsu-chat-message p {
    margin: 0;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    min-width: 0;
}

#jtsu-chat-widget .jtsu-chat-message.from-visitor {
    align-self: flex-end;
}

#jtsu-chat-widget .jtsu-chat-message.from-visitor p {
    background: #1769d2;
    color: #fff;
    border-bottom-right-radius: 3px;
}

#jtsu-chat-widget .jtsu-chat-message.from-staff {
    align-self: flex-start;
}

#jtsu-chat-widget .jtsu-chat-message.from-staff p {
    background: #ffffff;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 3px;
}

#jtsu-chat-widget .jtsu-chat-message p a {
    color: #1663bc;
    text-decoration: underline;
    word-break: break-all;
}

#jtsu-chat-widget .jtsu-chat-message.from-visitor p a {
    color: #ffffff;
}

#jtsu-chat-widget .jtsu-chat-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

#jtsu-chat-widget .jtsu-chat-input {
    flex: 1;
    resize: none;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 9px 11px;
    font-size: 14px;
    line-height: 1.3;
    max-height: 90px;
    color: #111827;
}

#jtsu-chat-widget .jtsu-chat-input:focus {
    outline: none;
    border-color: #1769d2;
}

#jtsu-chat-widget .jtsu-chat-send {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border: none;
    border-radius: 10px;
    background: #1769d2;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#jtsu-chat-widget .jtsu-chat-send svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    display: block;
    transform: translateX(-1px);
}

#jtsu-chat-widget .jtsu-chat-send:hover {
    background: #0f4fa8;
}

#jtsu-chat-widget [hidden] {
    display: none !important;
}

@media (max-width: 480px) {
    #jtsu-chat-widget {
        right: 12px;
        bottom: 12px;
    }

    #jtsu-chat-widget .jtsu-chat-panel {
        bottom: 68px;
        width: calc(100vw - 24px);
    }
}
