/* ActoSync Shopify-style chat theme for WordPress */

.actosync-chat-container {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    pointer-events: none;
    font-family: Manrope, "Avenir Next", "Segoe UI", sans-serif;
}

.actosync-dock {
    position: absolute;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
}

.actosync-backdrop {
    position: absolute;
    inset: 0;
    appearance: none;
    -webkit-appearance: none;
    border: none;
    margin: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    background: rgba(10, 13, 30, 0.28);
    transition: opacity 0.2s ease;
    cursor: default;
    outline: none;
    box-shadow: none;
    color: transparent;
}

.actosync-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.actosync-backdrop:hover,
.actosync-backdrop:focus,
.actosync-backdrop:focus-visible,
.actosync-backdrop:active {
    background: rgba(10, 13, 30, 0.28);
    border: none;
    outline: none;
    box-shadow: none;
    color: transparent;
}

.actosync-panel {
    pointer-events: auto;
    display: none;
    flex-direction: column;
    width: min(370px, calc(100vw - 20px));
    height: min(740px, calc(100vh - 20px));
    max-height: calc(100vh - 20px);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: linear-gradient(180deg, #cde8ff 0%, #9cd1ff 100%);
    color: #000;
    box-shadow: 0 22px 50px rgba(15, 18, 42, 0.42);
    backdrop-filter: blur(10px);
    animation: actosync-panel-in 0.2s ease;
}

@keyframes actosync-panel-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.actosync-panel.open {
    display: flex;
}

.actosync-panel-head {
    padding: 14px 14px 10px;
    flex-shrink: 0;
}

.actosync-panel-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.actosync-panel-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.actosync-icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.16);
    color: #000;
    flex-shrink: 0;
}

.actosync-live-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.actosync-live-label {
    font-size: 14px;
    color: #000;
    white-space: nowrap;
}

.actosync-pill {
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 4px 10px;
    color: #000;
    font-size: 12px;
    line-height: 1;
    background: rgba(255, 255, 255, 0.08);
}

.actosync-ctrl-btn {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    cursor: pointer;
    color: #000;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.actosync-window {
    flex: 1;
    overflow-y: auto;
    padding: 0 14px 12px;
}

.actosync-window::-webkit-scrollbar {
    width: 4px;
}

.actosync-window::-webkit-scrollbar-track {
    background: transparent;
}

.actosync-window::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 4px;
}

.actosync-empty {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.actosync-empty-subtitle {
    font-size: 30px;
    line-height: 1.15;
    font-weight: 600;
    color: #000;
    margin: 4px 0 0;
    letter-spacing: -0.01em;
}

.actosync-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #000;
    font-size: 14px;
    font-weight: 500;
    margin-top: 4px;
}

.actosync-assistant-bubble {
    max-width: 88%;
    background: #9cb5cb;
    border: 1px solid rgba(214, 233, 255, 0.22);
    border-radius: 18px;
    padding: 14px 16px;
    color: #000;
    line-height: 1.45;
    font-size: 15px;
}

.actosync-messages {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.actosync-message-row {
    display: flex;
    align-items: flex-end;
}

.actosync-message-row.user {
    justify-content: flex-end;
}

.actosync-message-row.bot {
    justify-content: flex-start;
}

.actosync-message {
    padding: 11px 14px;
    max-width: 82%;
    font-size: 14px;
    line-height: 1.55;
    word-wrap: break-word;
    white-space: pre-wrap;
    border: 1px solid;
}

.actosync-message.user {
    border-radius: 16px 6px 16px 16px;
    background: #cedae5;
    color: #000;
    border-color: rgba(244, 250, 255, 0.25);
}

.actosync-message.bot {
    border-radius: 6px 16px 16px 16px;
    background: #9cb5cb;
    color: #000;
    border-color: rgba(223, 238, 255, 0.22);
}

@keyframes actosync-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.35;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.actosync-typing-bubble {
    padding: 12px 16px;
    background: #9cb5cb;
    border: 1px solid rgba(223, 238, 255, 0.22);
    border-radius: 6px 16px 16px 16px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.actosync-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.62);
    animation: actosync-bounce 1.2s infinite ease-in-out;
}

.actosync-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.actosync-dot:nth-child(3) {
    animation-delay: 0.4s;
}

.actosync-message.actosync-message-rich {
    max-width: 100%;
    width: 100%;
    padding: 0;
    background: transparent;
    border: none;
    white-space: normal;
    line-height: normal;
}

.actosync-rich-content {
    width: 100%;
    max-width: 100%;
    color: #000;
    line-height: 1.45;
    font-size: 14px;
    white-space: normal;
}

.actosync-rich-content * {
    box-sizing: border-box;
    max-width: 100%;
}

.actosync-rich-content > div {
    background: rgba(255, 255, 255, 0.38);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 8px 22px rgba(22, 40, 72, 0.12);
}

.actosync-rich-content b,
.actosync-rich-content strong {
    font-weight: 600;
}

.actosync-rich-content img {
    display: block;
    max-width: 100%;
    height: auto;
}

.actosync-rich-content a {
    color: inherit;
}

.actosync-panel-foot {
    flex-shrink: 0;
    padding: 10px 14px 14px;
}

.actosync-input-row {
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid rgba(20, 55, 105, 0.2);
    border-radius: 999px;
    padding: 8px 8px 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.actosync-input-row.is-focused {
    background: rgba(255, 255, 255, 0.42);
    border-color: rgba(27, 73, 140, 0.45);
    box-shadow: 0 0 0 3px rgba(42, 93, 206, 0.18);
}

.actosync-input {
    flex: 1;
    min-width: 0;
    padding: 2px 0;
    margin: 0;
    border: 0;
    outline: 0;
    box-shadow: none;
    background: transparent;
    font-size: 15px;
    color: #000;
    font-family: inherit;
}

.actosync-input::placeholder {
    color: rgba(0, 0, 0, 0.6);
}

.actosync-send {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border: 1px solid rgba(16, 45, 95, 0.35);
    border-radius: 50%;
    background: linear-gradient(145deg, #2a5dce 0%, #1e4aad 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 1;
    box-shadow: 0 4px 14px rgba(20, 52, 110, 0.35);
}

.actosync-send:disabled {
    opacity: 0.72;
    filter: grayscale(0.15);
    cursor: not-allowed;
}

.actosync-send svg {
    width: 17px;
    height: 17px;
}

.actosync-launcher {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-left: auto;
    border: none;
    border-radius: 50%;
    background: #c8e7ff;
    color: #2c78b8;
    box-shadow: 0 6px 24px rgba(30, 41, 59, 0.38);
    cursor: pointer;
}

@media (max-width: 640px) {
    .actosync-dock {
        right: 8px;
        bottom: 8px;
    }

    .actosync-panel {
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
        max-height: calc(100vh - 16px);
        border-radius: 20px;
    }

    .actosync-empty-subtitle {
        font-size: 24px;
    }
}
