/* ChillByte Support-Widget Styles */

.cb-launch {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(74, 144, 226, 0.45);
    cursor: pointer;
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cb-launch:hover { transform: scale(1.06); box-shadow: 0 10px 30px rgba(74, 144, 226, 0.6); }
.cb-launch:active { transform: scale(0.96); }
.cb-launch-active { transform: rotate(15deg) scale(0.9); }

.cb-launch-pulse {
    position: absolute;
    top: -2px; right: -2px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #5cb85c;
    border: 2px solid #fff;
    animation: cb-pulse 2s infinite;
}
@keyframes cb-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(92,184,92,0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(92,184,92,0); }
    100% { box-shadow: 0 0 0 0 rgba(92,184,92,0); }
}

.cb-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 130px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.25);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    animation: cb-slide-up 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.cb-window.cb-hidden { display: none; }

@keyframes cb-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cb-hdr {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.cb-hdr-avatar {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cb-hdr-text { flex: 1; min-width: 0; }
.cb-hdr-name { font-weight: 600; font-size: 15px; }
.cb-hdr-status { font-size: 12px; opacity: 0.9; margin-top: 2px; }
.cb-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #5cb85c;
    margin-right: 4px;
}
.cb-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.85;
    transition: opacity 0.15s;
}
.cb-close:hover { opacity: 1; }

.cb-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f7f9fc;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cb-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}
.cb-bubble-bot {
    background: #fff;
    color: #2d3748;
    border-top-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.cb-bubble-user {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: #fff;
    border-top-right-radius: 4px;
    align-self: flex-end;
}

.cb-anim-in {
    animation: cb-bubble-in 0.25s ease-out;
}
@keyframes cb-bubble-in {
    from { opacity: 0; transform: translateY(8px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cb-typing {
    display: inline-flex;
    gap: 4px;
    padding: 14px 16px;
    align-items: center;
}
.cb-typing span {
    width: 7px; height: 7px;
    background: #b8c4d3;
    border-radius: 50%;
    animation: cb-bounce 1.2s infinite ease-in-out;
}
.cb-typing span:nth-child(2) { animation-delay: 0.15s; }
.cb-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes cb-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.cb-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 6px 0;
    align-self: flex-start;
    max-width: 100%;
}
.cb-quick-btn {
    background: #fff;
    border: 1px solid #d6e0ee;
    color: #2d3748;
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.cb-quick-btn:hover:not(:disabled) {
    background: #4a90e2;
    border-color: #4a90e2;
    color: #fff;
    transform: translateY(-1px);
}
.cb-quick-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.cb-input-wrap {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    background: #fff;
    border: 1px solid #d6e0ee;
    border-radius: 24px;
    padding: 4px 4px 4px 14px;
    margin-top: 6px;
    transition: border-color 0.15s;
}
.cb-input-wrap:focus-within { border-color: #4a90e2; }
.cb-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 8px 0;
    font-size: 14px;
    font-family: inherit;
    color: #2d3748;
    resize: none;
    min-height: 22px;
    max-height: 120px;
}
.cb-input-send {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border: none;
    color: #fff;
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.1s;
}
.cb-input-send:hover:not(:disabled) { transform: scale(1.08); }
.cb-input-send:disabled { opacity: 0.5; cursor: default; }
.cb-input-skip {
    background: transparent;
    border: none;
    color: #6c7a89;
    font-size: 13px;
    padding: 0 12px;
    cursor: pointer;
    text-decoration: underline;
}
.cb-input-skip:hover { color: #4a90e2; }

.cb-shake { animation: cb-shake 0.35s; }
@keyframes cb-shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-6px); }
    75%      { transform: translateX(6px); }
}

.cb-foot {
    text-align: center;
    padding: 8px;
    color: #95a3b6;
    background: #fff;
    border-top: 1px solid #e8eef5;
    font-size: 11px;
}

/* ===== Mobile ===== */
@media (max-width: 480px) {
    .cb-launch {
        bottom: 16px; right: 16px;
        width: 54px; height: 54px;
    }
    .cb-window {
        bottom: 0; right: 0; left: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}
