/* ==========================================================================
   Luxury Multi-Bot & Real-time Live Chat Widget Stylesheet
   ========================================================================== */

:root {
    --chat-primary-gold: #dfb76c;
    --chat-accent-gold: #c59b27;
    --chat-bg-dark: #090e1a;
    --chat-bg-surface: #0e1629;
    --chat-bg-card: #131c33;
    --chat-border: rgba(223, 183, 108, 0.2);
    --chat-border-glow: rgba(223, 183, 108, 0.4);
    --chat-text-light: #f8fafc;
    --chat-text-muted: #8e9db3;
    --chat-admin-gold: #fbbf24;
    --chat-bot-blue: #38bdf8;
}

/* Root Fixed Wrapper */
.luxury-chat-root {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999999;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-optical-sizing: auto;
}

/* Floating Launcher Button */
.luxury-chat-launcher {
    position: relative;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #131d35 0%, #090e1a 100%);
    border: 2px solid var(--chat-primary-gold);
    color: var(--chat-primary-gold);
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(223, 183, 108, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
}

.luxury-chat-launcher:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 28px rgba(223, 183, 108, 0.45);
    border-color: #f7d692;
    color: #f7d692;
}

.launcher-pulse {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid var(--chat-primary-gold);
    opacity: 0;
    animation: chatPulse 2.5s infinite;
    pointer-events: none;
}

@keyframes chatPulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.25); opacity: 0; }
    100% { transform: scale(1.25); opacity: 0; }
}

.launcher-icon-wrapper {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.launcher-close-icon {
    display: none;
}

.luxury-chat-root.is-open .launcher-main-icon {
    display: none;
}

.luxury-chat-root.is-open .launcher-close-icon {
    display: block;
}

.launcher-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
    border: 2px solid #090e1a;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.6);
}

/* Main Chat Window Card */
.luxury-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 395px;
    height: 590px;
    max-height: calc(100vh - 120px);
    background: var(--chat-bg-dark);
    border: 1px solid var(--chat-border);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    backdrop-filter: blur(16px);
}

@keyframes chatSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #10192e 0%, #0a0f1d 100%);
    padding: 16px 20px;
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-branding {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.7);
    flex-shrink: 0;
}

.header-titles {
    display: flex;
    flex-direction: column;
}

.chat-header-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--chat-text-light);
    margin: 0;
    letter-spacing: -0.2px;
}

.chat-header-sub {
    font-size: 0.75rem;
    color: var(--chat-primary-gold);
    opacity: 0.85;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-ctrl-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--chat-text-muted);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.2s ease;
}

.chat-ctrl-btn:hover {
    background: rgba(223, 183, 108, 0.15);
    border-color: var(--chat-primary-gold);
    color: var(--chat-primary-gold);
}

/* Tabs Bar */
.chat-tabs-bar {
    display: flex;
    background: #0b1120;
    border-bottom: 1px solid var(--chat-border);
    padding: 6px;
    gap: 6px;
}

.chat-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 10px;
    background: transparent;
    border: none;
    color: var(--chat-text-muted);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.chat-tab-btn i {
    font-size: 0.9rem;
}

.chat-tab-btn.active {
    background: linear-gradient(135deg, rgba(223, 183, 108, 0.2) 0%, rgba(223, 183, 108, 0.08) 100%);
    color: #fff;
    border: 1px solid rgba(223, 183, 108, 0.35);
}

.online-pill {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Tab Views Container */
.chat-tab-view {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.chat-tab-view.active {
    display: flex;
}

/* ==========================================================================
   TAB 1: AI Chatbots Styles
   ========================================================================== */
.bot-selector-bar {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    background: var(--chat-bg-surface);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    scrollbar-width: none;
}
.bot-selector-bar::-webkit-scrollbar {
    display: none;
}

.bot-chip {
    flex: 1;
    min-width: 105px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.bot-chip:hover {
    background: rgba(255, 255, 255, 0.07);
}

.bot-chip.active {
    background: rgba(223, 183, 108, 0.15);
    border-color: var(--chat-primary-gold);
}

.bot-avatar-emoji {
    font-size: 1.2rem;
}

.bot-chip-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bot-chip-name {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--chat-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bot-chip-role {
    font-size: 0.65rem;
    color: var(--chat-text-muted);
    white-space: nowrap;
}

/* Message Stream */
.chat-messages-stream {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: radial-gradient(circle at top right, rgba(223, 183, 108, 0.03) 0%, transparent 70%);
}

.chat-messages-stream::-webkit-scrollbar {
    width: 5px;
}
.chat-messages-stream::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Message Bubble */
.chat-bubble-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    animation: bubbleFade 0.25s ease forwards;
}

@keyframes bubbleFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-bubble-row.from-me {
    flex-direction: row-reverse;
}

.bubble-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--chat-bg-card);
    border: 1px solid var(--chat-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.bubble-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.bubble-content-box {
    max-width: 78%;
    display: flex;
    flex-direction: column;
}

.bubble-header-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.chat-bubble-row.from-me .bubble-header-info {
    justify-content: flex-end;
}

.bubble-sender-name {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--chat-text-light);
}

.bubble-role-badge {
    font-size: 0.62rem;
    padding: 1px 5px;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
}

.bubble-role-badge.admin {
    background: rgba(251, 191, 36, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.bubble-role-badge.member {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.bubble-role-badge.guest {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.bubble-role-badge.bot {
    background: rgba(223, 183, 108, 0.18);
    color: var(--chat-primary-gold);
    border: 1px solid rgba(223, 183, 108, 0.35);
}

.bubble-message-text {
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 0.84rem;
    line-height: 1.45;
    word-break: break-word;
}

.chat-bubble-row.from-bot .bubble-message-text,
.chat-bubble-row.from-other .bubble-message-text {
    background: var(--chat-bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
}

.chat-bubble-row.from-bot .bubble-message-text strong {
    color: var(--chat-primary-gold);
}

.chat-bubble-row.from-me .bubble-message-text {
    background: linear-gradient(135deg, #b88b20 0%, #dfb76c 100%);
    color: #0b1120;
    font-weight: 500;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(223, 183, 108, 0.25);
}

.bubble-time-stamp {
    font-size: 0.65rem;
    color: var(--chat-text-muted);
    margin-top: 3px;
}

.chat-bubble-row.from-me .bubble-time-stamp {
    text-align: right;
}

/* Bot Suggestions Chips */
.bot-suggestions-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(14, 22, 41, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.suggestion-chip-btn {
    background: rgba(223, 183, 108, 0.1);
    border: 1px solid rgba(223, 183, 108, 0.25);
    color: var(--chat-primary-gold);
    font-size: 0.72rem;
    font-weight: 500;
    padding: 4px 9px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-chip-btn:hover {
    background: rgba(223, 183, 108, 0.25);
    border-color: var(--chat-primary-gold);
    transform: translateY(-1px);
}

/* Typing Indicator */
.bot-typing-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: var(--chat-bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--chat-primary-gold);
    border-radius: 50%;
    animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-4px); opacity: 1; }
}

/* Input Form */
.chat-input-form {
    padding: 12px 14px;
    background: var(--chat-bg-surface);
    border-top: 1px solid var(--chat-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input-field {
    flex: 1;
    background: #090e1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--chat-text-light);
    font-size: 0.85rem;
    padding: 10px 14px;
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease;
}

.chat-input-field:focus {
    border-color: var(--chat-primary-gold);
    box-shadow: 0 0 10px rgba(223, 183, 108, 0.2);
}

.chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #c59b27 0%, #dfb76c 100%);
    color: #090e1a;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(223, 183, 108, 0.4);
}

/* ==========================================================================
   TAB 2: Real-time Live User Chat Styles
   ========================================================================== */
.live-channel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--chat-bg-surface);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.live-channel-info {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--chat-text-light);
}

.live-channel-info i {
    color: #38bdf8;
}

.roster-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--chat-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.roster-toggle-btn:hover {
    border-color: var(--chat-primary-gold);
    color: var(--chat-primary-gold);
}

/* Active Users Drawer */
.live-users-drawer {
    background: #090e1a;
    border-bottom: 1px solid var(--chat-border);
    padding: 10px 14px;
    max-height: 150px;
    overflow-y: auto;
    animation: drawerSlide 0.2s ease forwards;
}

@keyframes drawerSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--chat-primary-gold);
    margin-bottom: 8px;
}

.drawer-close-btn {
    background: none;
    border: none;
    color: var(--chat-text-muted);
    font-size: 1rem;
    cursor: pointer;
}

.users-list-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.75rem;
}

.user-row-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-online-bullet {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
}

.user-row-name {
    color: #e2e8f0;
    font-weight: 600;
}

.live-typing-indicator {
    padding: 4px 16px;
    font-size: 0.72rem;
    color: var(--chat-primary-gold);
    font-style: italic;
    background: transparent;
}

.live-user-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    background: #070c17;
    font-size: 0.72rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.user-handle-label {
    color: var(--chat-text-muted);
}

.user-handle-name {
    color: var(--chat-primary-gold);
    font-weight: 700;
}

.user-handle-edit-btn {
    background: none;
    border: none;
    color: var(--chat-text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 2px 4px;
}
.user-handle-edit-btn:hover {
    color: #fff;
}

/* Responsive Mobile Layout */
@media (max-width: 768px) {
    .luxury-chat-root {
        bottom: 18px;
        right: 14px;
    }
    .luxury-chat-launcher {
        width: 52px;
        height: 52px;
    }
}

@media (max-width: 480px) {
    .luxury-chat-root {
        bottom: 14px;
        right: 10px;
    }
    .luxury-chat-launcher {
        width: 46px;
        height: 46px;
    }
    .luxury-chat-window {
        bottom: 70px;
        right: 0;
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        border-radius: 16px;
    }
}
