/* CrossFire V3 Tactical HUD: Floating Community & Live Support Panel */
.cf-community-float {
    position: fixed;
    right: 20px;
    bottom: 22px;
    z-index: 8900;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
}

.cf-float-button {
    pointer-events: auto;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    height: 42px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(13, 18, 26, 0.94);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    color: #f1f5f9;
    text-decoration: none;
    font: 800 12px/1 'Be Vietnam Pro', sans-serif;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.cf-float-button i {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    font-size: 15px;
}

.cf-float-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.7), 0 0 16px rgba(255, 157, 43, 0.3);
}

.cf-float-discord {
    border-color: rgba(88, 101, 242, 0.4);
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.16), rgba(13, 18, 26, 0.96));
}

.cf-float-discord i {
    color: #5865F2;
}

.cf-float-discord:hover {
    border-color: #5865F2;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.7), 0 0 18px rgba(88, 101, 242, 0.45);
}

.cf-float-chat {
    border-color: rgba(255, 157, 43, 0.4);
    background: linear-gradient(135deg, rgba(255, 107, 0, 0.16), rgba(13, 18, 26, 0.96));
}

.cf-float-chat i {
    color: #ff9d2b;
}

.cf-float-chat:hover {
    border-color: #ff9d2b;
}

.cf-chat-online-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2.5px rgba(34, 197, 94, 0.25);
}

/* Master Live Chat Window (HUD Glassmorphism) */
.cf-live-chat-panel {
    position: fixed;
    right: 20px;
    bottom: 120px;
    z-index: 8901;
    display: flex;
    flex-direction: column;
    width: min(400px, calc(100vw - 32px));
    height: min(580px, calc(100vh - 160px));
    overflow: hidden;
    border: 1px solid rgba(255, 157, 43, 0.35);
    border-radius: 4px;
    background: rgba(10, 14, 21, 0.97);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    color: #f1f5f9;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85), inset 0 2px 0 #ff9d2b, 0 0 24px rgba(255, 107, 0, 0.2);
    animation: cf-chat-panel-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.cf-live-chat-panel[hidden] {
    display: none !important;
}

.cf-live-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(20, 26, 38, 0.98);
    flex: 0 0 auto;
    box-sizing: border-box;
}

.cf-live-chat-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid rgba(255, 157, 43, 0.35);
    border-radius: 4px;
    background: rgba(255, 157, 43, 0.12);
    color: #ff9d2b;
    font-size: 16px;
}

.cf-live-chat-header > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.cf-live-chat-header strong {
    font-size: 13px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.cf-live-chat-header small {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-size: 11px;
}

.cf-live-chat-header > button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cf-live-chat-header > button:hover {
    color: #ffffff;
    background: rgba(255, 107, 0, 0.2);
    border-color: #ff9d2b;
}

.cf-live-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 157, 43, 0.3) transparent;
}

.cf-chat-message {
    max-width: 86%;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.045);
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    box-sizing: border-box;
}

.cf-chat-message > span {
    display: block;
    margin-bottom: 5px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.cf-chat-message p {
    margin: 0;
    color: #e2e8f0;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.cf-chat-message-admin {
    align-self: flex-start;
    border-left: 2px solid #ff9d2b;
    border-color: rgba(255, 157, 43, 0.3);
    background: rgba(255, 157, 43, 0.06);
}

.cf-chat-message-visitor {
    align-self: flex-end;
    border-right: 2px solid #38bdf8;
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.08);
}

.cf-chat-message-visitor > span {
    color: #38bdf8;
    font-weight: 800;
}

.cf-chat-message-system {
    align-self: center;
    max-width: 100%;
    padding: 4px 8px;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 11px;
    text-align: center;
}

.cf-live-chat-user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 157, 43, 0.25);
    border-radius: 4px;
    background: rgba(255, 157, 43, 0.08);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 600;
}

.cf-live-chat-user-badge i {
    color: #ff9d2b;
    font-size: 12px;
}

.cf-live-chat-user-badge strong {
    color: #ff9d2b;
    font-weight: 800;
}

.cf-live-chat-form {
    flex: 0 0 auto;
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(14, 18, 26, 0.98);
    box-sizing: border-box;
}

.cf-live-chat-guest-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.cf-live-chat-form input,
.cf-live-chat-compose textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    outline: none;
    background: rgba(0, 0, 0, 0.45);
    color: #ffffff;
    font: 500 12px/1.5 'Be Vietnam Pro', sans-serif;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.cf-live-chat-form input {
    height: 38px;
    padding: 0 12px;
}

.cf-live-chat-form input:focus,
.cf-live-chat-compose textarea:focus {
    border-color: #ff9d2b;
    box-shadow: 0 0 10px rgba(255, 157, 43, 0.3);
}

.cf-live-chat-form input::placeholder,
.cf-live-chat-compose textarea::placeholder {
    color: #64748b;
}

.cf-live-chat-compose {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.cf-live-chat-compose textarea {
    resize: vertical;
    min-height: 44px;
    max-height: 120px;
    padding: 10px 12px;
}

.cf-live-chat-compose button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 1px solid #ff9d2b;
    border-radius: 4px;
    background: linear-gradient(135deg, #ff9d2b, #ff6b00);
    color: #0b0c0e;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 107, 0, 0.35);
    transition: all 0.15s ease;
}

.cf-live-chat-compose button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(255, 107, 0, 0.5);
    background: linear-gradient(135deg, #ffaa40, #ff7a1a);
}

.cf-live-chat-compose button:disabled {
    opacity: 0.5;
    cursor: wait;
    transform: none;
}

.cf-live-chat-status {
    min-height: 16px;
    margin-top: 6px;
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.5;
}

.cf-live-chat-status.is-error {
    color: #ef4444;
}

.cf-live-chat-status.is-success {
    color: #22c55e;
}

@keyframes cf-chat-panel-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 600px) {
    .cf-community-float {
        right: 12px;
        bottom: 14px;
        gap: 8px;
    }
    .cf-float-chat {
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        border-radius: 4px;
    }
    .cf-float-chat span,
    .cf-float-chat .cf-chat-online-dot {
        display: none;
    }
    .cf-float-discord {
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        border-radius: 4px;
    }
    .cf-float-discord span {
        display: none;
    }
    .cf-live-chat-panel {
        right: 8px;
        bottom: 70px;
        width: calc(100vw - 16px);
        height: min(540px, calc(100vh - 90px));
        border-radius: 4px;
    }
    .cf-live-chat-guest-fields {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cf-float-button,
    .cf-live-chat-panel {
        transition: none;
        animation: none;
    }
}
