/* ============================================
   LIVE CHAT WIDGET — client-facing floating chat
   Loaded on every page via partials/header.php
============================================ */
#gc-launcher {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6c63ff, #5a52d5);
    box-shadow: 0 8px 26px rgba(108,99,255,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99998;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#gc-launcher:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 12px 32px rgba(108,99,255,0.55); }
#gc-launcher .gc-launcher-badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 999px;
    background: #ff4757;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid #0a0a0f;
    font-family: 'Inter', Arial, sans-serif;
}
#gc-launcher .gc-launcher-badge.show { display: flex; }
#gc-launcher .gc-icon-chat { display: block; }
#gc-launcher .gc-icon-close { display: none; }
#gc-launcher.gc-open .gc-icon-chat { display: none; }
#gc-launcher.gc-open .gc-icon-close { display: block; }

#gc-panel {
    position: fixed;
    right: 22px;
    bottom: 96px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 140px);
    background: #16162a;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    border: 1px solid rgba(108,99,255,0.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 99999;
    font-family: 'Inter', Arial, sans-serif;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
#gc-panel.gc-visible { display: flex; }
#gc-panel.gc-shown { opacity: 1; transform: translateY(0); }

.gc-header {
    background: linear-gradient(135deg, #6c63ff, #5a52d5);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.gc-header-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.05rem; font-weight: 800; flex-shrink: 0;
    position: relative;
}
.gc-header-avatar .gc-dot {
    position: absolute; bottom: -1px; right: -1px;
    width: 11px; height: 11px; border-radius: 50%;
    background: #43e97b; border: 2px solid #5a52d5;
}
.gc-header-text { flex: 1; min-width: 0; }
.gc-header-title { color: #fff; font-weight: 700; font-size: 0.95rem; }
.gc-header-sub { color: rgba(255,255,255,0.8); font-size: 0.75rem; margin-top: 1px; }
.gc-header-close {
    background: none; border: none; color: rgba(255,255,255,0.85);
    font-size: 1.1rem; cursor: pointer; padding: 6px; line-height: 1;
    flex-shrink: 0;
}
.gc-header-close:hover { color: #fff; }
.gc-header-expand {
    background: none; border: none; color: rgba(255,255,255,0.75);
    font-size: 0.9rem; cursor: pointer; padding: 6px; line-height: 1;
    flex-shrink: 0;
}
.gc-header-expand:hover { color: #fff; }
.gc-header-notify {
    background: none; border: none; color: rgba(255,255,255,0.75);
    font-size: 0.9rem; cursor: pointer; padding: 6px; line-height: 1;
    flex-shrink: 0;
}
.gc-header-notify:hover { color: #fff; }
.gc-header-notify.on { color: #43e97b; }

.gc-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #101020;
}
.gc-body::-webkit-scrollbar { width: 6px; }
.gc-body::-webkit-scrollbar-thumb { background: rgba(108,99,255,0.35); border-radius: 3px; }

.gc-bubble-row { display: flex; }
.gc-bubble-row.gc-mine { justify-content: flex-end; }
.gc-bubble {
    max-width: 78%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 0.86rem;
    line-height: 1.45;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.gc-bubble-row.gc-mine .gc-bubble {
    background: linear-gradient(135deg, #6c63ff, #5a52d5);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.gc-bubble-row.gc-theirs .gc-bubble {
    background: #1f1f36;
    color: #e8e8f5;
    border: 1px solid rgba(108,99,255,0.15);
    border-bottom-left-radius: 4px;
}
.gc-meta {
    font-size: 0.68rem;
    color: #6a6a8a;
    margin-top: 3px;
    padding: 0 4px;
}
.gc-bubble-row.gc-mine + .gc-meta, .gc-meta.gc-mine { text-align: right; }

.gc-empty-state {
    margin: auto;
    text-align: center;
    color: #7a7a94;
    font-size: 0.85rem;
    padding: 20px;
}
.gc-empty-state i { font-size: 2rem; color: #4a4a68; margin-bottom: 10px; display: block; }

.gc-login-state {
    margin: auto;
    text-align: center;
    padding: 30px 24px;
    color: #c8c8dc;
}
.gc-login-state i.gc-discord-icon { font-size: 2.4rem; color: #5865F2; margin-bottom: 14px; display: block; }
.gc-login-state p { font-size: 0.88rem; margin-bottom: 18px; line-height: 1.5; }
.gc-login-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: linear-gradient(135deg, #5865F2, #4752c4);
    color: #fff; text-decoration: none;
    padding: 11px 22px; border-radius: 8px; font-size: 0.85rem; font-weight: 700;
    box-shadow: 0 4px 15px rgba(88,101,242,0.35);
}

.gc-footer {
    flex-shrink: 0;
    border-top: 1px solid rgba(108,99,255,0.14);
    padding: 10px 12px;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background: #16162a;
}
.gc-input {
    flex: 1;
    resize: none;
    background: #101020;
    border: 1px solid rgba(108,99,255,0.2);
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 0.86rem;
    padding: 9px 12px;
    max-height: 90px;
    line-height: 1.4;
    outline: none;
}
.gc-input:focus { border-color: rgba(108,99,255,0.55); }
.gc-input::placeholder { color: #5c5c7a; }
.gc-send-btn {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, #6c63ff, #5a52d5);
    border: none; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem;
    transition: opacity 0.15s ease;
}
.gc-send-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.gc-send-btn:not(:disabled):hover { opacity: 0.88; }

.gc-typing-hint { font-size: 0.68rem; color: #6a6a8a; padding: 2px 4px 0; }

@media (max-width: 480px) {
    #gc-panel {
        right: 12px; left: 12px; bottom: 86px;
        width: auto; height: calc(100vh - 150px);
    }
    #gc-launcher { right: 16px; bottom: 16px; }
}
