/* ═══════════════════════════════════════════
   Global Chat — clean glass (matches Live Support)
   ═══════════════════════════════════════════ */

.gch-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(7, 11, 20, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: "Tajawal", "Cairo", system-ui, sans-serif;
}

.gch-shell {
    width: min(920px, 100%);
    height: min(86vh, 760px);
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    color: #e8edf5;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background:
        radial-gradient(800px 400px at 15% 0%, rgba(56, 189, 248, 0.1), transparent 60%),
        rgba(10, 15, 28, 0.94);
    backdrop-filter: blur(18px) saturate(140%);
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.5);
}

/* Top bar — same feel as lsc-chat__topbar */
.gch-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(10, 15, 28, 0.8);
    flex-shrink: 0;
}

.gch-topbar__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gch-topbar__title i {
    color: #38bdf8;
}

.gch-topbar__sub {
    margin: 3px 0 0;
    font-size: 0.82rem;
    color: #94a3b8;
}

.gch-topbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gch-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.gch-status-pill__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.gch-btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.15s, border-color 0.15s;
}

.gch-btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(56, 189, 248, 0.35);
    color: #f1f5f9;
}

.gch-btn-icon--on {
    color: #fcd34d;
    border-color: rgba(251, 191, 36, 0.35);
}

.gch-btn-me {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.gch-btn-me__ava {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
    overflow: hidden;
}

.gch-btn-me__ava img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gch-profile-card__ava-inner,
.gch-profile-card__ava-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}

/* Body: left rail + main */
.gch-layout {
    flex: 1;
    min-height: 0;
    display: flex;
}

.gch-rail {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(0, 0, 0, 0.2);
    min-height: 0;
}

.gch-rail__tabs {
    display: flex;
    padding: 10px;
    gap: 6px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.gch-rail__tab {
    flex: 1;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.gch-rail__tab--on {
    color: #e2e8f0;
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.25);
}

.gch-rail__badge {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
}

.gch-rail__search {
    padding: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.gch-rail__search input {
    width: 100%;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(0, 0, 0, 0.25);
    color: #f1f5f9;
    font-size: 0.84rem;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

.gch-rail__search input:focus {
    border-color: rgba(56, 189, 248, 0.4);
}

.gch-rail__list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.gch-rail__list::-webkit-scrollbar,
.gch-feed::-webkit-scrollbar {
    width: 5px;
}

.gch-rail__list::-webkit-scrollbar-thumb,
.gch-feed::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 999px;
}

.gch-rail__label {
    padding: 6px 10px 8px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
}

.gch-person {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #e2e8f0;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    margin-bottom: 2px;
    transition: background 0.12s;
}

.gch-person:hover,
.gch-person--on {
    background: rgba(255, 255, 255, 0.06);
}

.gch-person__ava {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    display: grid;
    place-items: center;
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
    overflow: hidden;
}

.gch-person__ava img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gch-person__body {
    min-width: 0;
    flex: 1;
}

.gch-person__name {
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gch-person__sub {
    font-size: 0.74rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gch-person__live {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}

.gch-rail__empty {
    padding: 16px 12px;
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.5;
    text-align: center;
}

/* Main chat column */
.gch-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.gch-thread-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(10, 15, 28, 0.5);
    flex-shrink: 0;
}

.gch-thread-bar__back {
    display: none;
}

.gch-feed {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px;
}

.gch-feed__inner {
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gch-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.gch-empty p {
    margin: 8px 0 0;
    font-size: 0.9rem;
}

/* Messages — lsc-msg style */
.gch-msg {
    display: flex;
    gap: 12px;
    max-width: 82%;
}

.gch-msg--mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.gch-msg__ava {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    overflow: hidden;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    background: linear-gradient(135deg, #0ea5e9, #10b981);
}

.gch-msg__ava img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gch-avatar-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: inherit;
    font-weight: 800;
    color: #fff;
}

.gch-msg--mine .gch-msg__ava {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    cursor: default;
}

.gch-msg__who {
    font-size: 0.78rem;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 4px;
}

.gch-msg__who button {
    background: none;
    border: none;
    padding: 0;
    color: #7dd3fc;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.gch-msg__who button:hover {
    text-decoration: underline;
}

.gch-msg__bubble {
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.55;
    font-size: 0.95rem;
    word-break: break-word;
    position: relative;
}

.gch-msg--other .gch-msg__bubble {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-bottom-left-radius: 6px;
}

.gch-msg--mine .gch-msg__bubble {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(139, 92, 246, 0.25));
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-bottom-right-radius: 6px;
}

.gch-msg__meta {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 4px;
}

.gch-msg__img {
    max-width: 100%;
    border-radius: 12px;
    margin-bottom: 6px;
    cursor: pointer;
    display: block;
}

.gch-msg__del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.85);
    color: #fff;
    font-size: 0.6rem;
    cursor: pointer;
    opacity: 0;
}

.gch-msg__bubble:hover .gch-msg__del { opacity: 1; }

/* Composer — lsc-composer style */
.gch-composer {
    padding: 14px 20px 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(10, 15, 28, 0.85);
    flex-shrink: 0;
}

.gch-composer__inner {
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

.gch-composer__attach {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(0, 0, 0, 0.25);
    color: #94a3b8;
    cursor: pointer;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.gch-composer input {
    flex: 1;
    padding: 13px 18px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(0, 0, 0, 0.3);
    color: #e2e8f0;
    font-size: 0.95rem;
    outline: none;
    min-width: 0;
    font-family: inherit;
}

.gch-composer input:focus {
    border-color: rgba(56, 189, 248, 0.45);
}

.gch-send {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.gch-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.gch-cooldown {
    max-width: 780px;
    margin: 0 auto 10px;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.25);
    color: #fcd34d;
    font-size: 0.84rem;
    text-align: center;
}

.gch-error {
    padding: 10px 18px;
    background: rgba(239, 68, 68, 0.1);
    border-bottom: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    font-size: 0.88rem;
}

.gch-ban {
    padding: 24px;
    text-align: center;
    color: #fca5a5;
    border-top: 1px solid rgba(239, 68, 68, 0.2);
}

.gch-ban h4 {
    margin: 8px 0 10px;
}

.gch-ban__reason {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: #fecaca;
    line-height: 1.5;
}

.gch-ban__meta {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(252, 165, 165, 0.75);
}

/* Profile — simple centered card */
.gch-profile-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    background: rgba(0, 0, 0, 0.55);
    display: grid;
    place-items: center;
    padding: 20px;
}

.gch-profile-card {
    width: min(340px, 100%);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background:
        radial-gradient(600px 300px at 50% 0%, rgba(56, 189, 248, 0.1), transparent 60%),
        rgba(10, 15, 28, 0.96);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    text-align: center;
    position: relative;
}

.gch-profile-card__close {
    position: absolute;
    top: 12px;
    right: 12px;
}

.gch-profile-card__ava {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    overflow: hidden;
}

.gch-profile-card__ava img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gch-profile-card__name {
    margin: 0 0 4px;
    font-size: 1.15rem;
    font-weight: 800;
}

.gch-profile-card__user {
    margin: 0 0 14px;
    color: #64748b;
    font-size: 0.88rem;
}

.gch-profile-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 14px;
}

.gch-tag {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
}

.gch-tag--green {
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.1);
}

.gch-profile-card__bio {
    margin: 0 0 18px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    font-size: 0.88rem;
    line-height: 1.55;
    color: #cbd5e1;
    text-align: left;
}

.gch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 18px;
    border-radius: 999px;
    border: none;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.gch-btn--primary {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff;
}

.gch-btn--ghost {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.2);
    margin-top: 8px;
}

.gch-rail-toggle { display: none; }

@media (max-width: 720px) {
    .gch-shell {
        height: 92vh;
        border-radius: 16px;
    }

    .gch-rail {
        display: none;
        position: absolute;
        left: 0;
        top: 57px;
        bottom: 0;
        z-index: 10;
        width: min(280px, 85%);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4);
    }

    .gch-rail--open { display: flex; }

    .gch-rail-toggle { display: grid; }

    .gch-thread-bar__back { display: grid; }

    .gch-msg { max-width: 90%; }
}

@media (prefers-reduced-motion: reduce) {
    .gch-overlay { animation: none; }
}
