/* ── GameCRM AI Chat Widget ──────────────────────────── */
#gcc-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Toggle button */
.gcc-chat__toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6c63ff, #a78bfa);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(108,99,255,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s, box-shadow .2s;
    position: relative;
}
.gcc-chat__toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 32px rgba(108,99,255,.65);
}
.gcc-chat__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Window */
.gcc-chat__window {
    position: absolute;
    bottom: 68px;
    right: 0;
    width: 340px;
    background: #0f0f1e;
    border: 1px solid #2a2a4a;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity .2s, transform .2s;
    transform-origin: bottom right;
}
.gcc-chat--closed .gcc-chat__window {
    opacity: 0;
    pointer-events: none;
    transform: scale(.95) translateY(8px);
}
.gcc-chat--open .gcc-chat__window {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
}

/* Header */
.gcc-chat__header {
    background: linear-gradient(135deg, #1a1a3e, #14142b);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #2a2a4a;
}
.gcc-chat__header-info { display: flex; align-items: center; gap: 10px; }
.gcc-chat__avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg,#6c63ff,#a78bfa);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}
.gcc-chat__title { font-size: .9rem; font-weight: 700; color: #f1f5f9; }
.gcc-chat__status { font-size: .72rem; color: #8b8fa8; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.gcc-chat__dot {
    width: 6px; height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: gcc-pulse 2s infinite;
}
@keyframes gcc-pulse {
    0%,100% { opacity:1; }
    50%      { opacity:.4; }
}
.gcc-chat__close-btn {
    background: none;
    border: none;
    color: #8b8fa8;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.gcc-chat__close-btn:hover { color: #fff; }

/* Messages */
.gcc-chat__messages {
    flex: 1;
    height: 320px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: #2a2a4a transparent;
}
.gcc-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: .84rem;
    line-height: 1.5;
    word-break: break-word;
}
.gcc-msg--bot {
    background: #1a1a3e;
    border: 1px solid #2a2a4a;
    color: #c0c0e0;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}
.gcc-msg--user {
    background: linear-gradient(135deg,#6c63ff,#8b5cf6);
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

/* Typing indicator */
.gcc-chat__typing {
    padding: 10px 16px;
    display: flex;
    gap: 4px;
    align-items: center;
}
.gcc-chat__typing span {
    width: 6px; height: 6px;
    background: #6c63ff;
    border-radius: 50%;
    animation: gcc-bounce .9s infinite;
}
.gcc-chat__typing span:nth-child(2) { animation-delay: .15s; }
.gcc-chat__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes gcc-bounce {
    0%,60%,100% { transform: translateY(0); }
    30%          { transform: translateY(-6px); }
}

/* Input */
.gcc-chat__input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #1e1e3a;
}
.gcc-chat__input {
    flex: 1;
    background: #0d0d1a;
    border: 1px solid #2a2a4a;
    border-radius: 10px;
    padding: 9px 12px;
    color: #e0e0f0;
    font-size: .84rem;
    resize: none;
    outline: none;
    max-height: 100px;
    font-family: inherit;
    transition: border-color .2s;
}
.gcc-chat__input:focus { border-color: #6c63ff; }
.gcc-chat__send {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg,#6c63ff,#8b5cf6);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity .2s;
}
.gcc-chat__send:hover { opacity: .85; }
.gcc-chat__send:disabled { opacity: .5; cursor: not-allowed; }

/* Footer */
.gcc-chat__footer {
    text-align: center;
    font-size: .68rem;
    color: #3a3a5a;
    padding: 6px;
    border-top: 1px solid #1a1a2e;
}

@media (max-width: 400px) {
    .gcc-chat__window { width: calc(100vw - 48px); right: -12px; }
}
