/* public/assets/css/support-center.css */
/* Enterprise Support Center & Floating Widget (Zendesk & Intercom Design Standard) */

:root {
    --bh-supp-primary: #0057FF;
    --bh-supp-primary-hover: #0043C7;
    --bh-supp-primary-light: rgba(0, 87, 255, 0.08);
    --bh-supp-dark: #0B0F19;
    --bh-supp-card-dark: #111827;
    --bh-supp-surface: #1E293B;
    --bh-supp-border: rgba(255, 255, 255, 0.08);
    --bh-supp-text: #F8FAFC;
    --bh-supp-text-muted: #94A3B8;
    --bh-supp-bot-bubble: #F1F5F9;
    --bh-supp-agent-bubble: #EFF6FF;
    --bh-supp-user-bubble: #0057FF;
}

/* Floating Launcher */
.bh-support-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    left: auto;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0057FF, #0084FF);
    color: #FFFFFF;
    border: none;
    box-shadow: 0 10px 25px -5px rgba(0, 87, 255, 0.5), 0 8px 10px -6px rgba(0, 87, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[dir="rtl"] .bh-support-launcher {
    right: 24px !important;
    left: auto !important;
}

.bh-support-launcher:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(0, 87, 255, 0.6);
}

.bh-support-launcher .unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #EF4444;
    color: #FFF;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFF;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Floating Window (Intercom / Freshdesk style) */
.bh-support-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    left: auto;
    width: 390px;
    height: 620px;
    max-height: calc(100vh - 120px);
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 99999;
    font-family: inherit;
    animation: bhSupportPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

[dir="rtl"] .bh-support-window {
    right: 24px !important;
    left: auto !important;
}

@media (max-width: 576px) {
    .bh-support-window {
        bottom: 0;
        left: 0 !important;
        right: 0 !important;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .bh-support-launcher {
        bottom: 16px;
        right: 16px;
        left: auto;
    }
    [dir="rtl"] .bh-support-launcher {
        right: auto;
        left: 16px;
    }
}

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

/* Window Header */
.bh-support-header {
    background: linear-gradient(135deg, #0B0F19 0%, #1E293B 100%);
    color: #FFFFFF;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Chat Message Bubbles */
.bh-chat-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bh-bubble-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 82%;
    animation: bhMsgFadeIn 0.25s ease forwards;
}

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

.bh-bubble-wrapper.user {
    align-self: flex-end;
}

.bh-bubble-wrapper.bot,
.bh-bubble-wrapper.agent {
    align-self: flex-start;
}

.bh-bubble-sender {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748B;
    margin-bottom: 3px;
    padding: 0 4px;
}

.bh-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.bh-bubble-wrapper.user .bh-bubble {
    background: #0057FF;
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
}

[dir="rtl"] .bh-bubble-wrapper.user .bh-bubble {
    border-bottom-right-radius: 16px;
    border-bottom-left-radius: 4px;
}

.bh-bubble-wrapper.bot .bh-bubble {
    background: #FFFFFF;
    color: #1E293B;
    border: 1px solid #E2E8F0;
    border-bottom-left-radius: 4px;
}

[dir="rtl"] .bh-bubble-wrapper.bot .bh-bubble {
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 4px;
}

.bh-bubble-wrapper.agent .bh-bubble {
    background: #EFF6FF;
    color: #0F172A;
    border: 1px solid #BFDBFE;
    border-bottom-left-radius: 4px;
}

.bh-bubble.internal-note {
    background: #FEF3C7 !important;
    color: #92400E !important;
    border: 1px dashed #F59E0B !important;
}

.bh-bubble-time {
    font-size: 0.68rem;
    color: #94A3B8;
    margin-top: 3px;
    align-self: flex-end;
}

/* Quick Suggestion Chips */
.bh-suggest-chip {
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: right;
}

.bh-suggest-chip:hover {
    background: #0057FF;
    color: #FFFFFF;
    border-color: #0057FF;
    transform: translateY(-1px);
}

/* Typing Indicator Animation */
.bh-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #E2E8F0;
    border-radius: 16px;
    width: fit-content;
}

.bh-typing-dot {
    width: 6px;
    height: 6px;
    background: #64748B;
    border-radius: 50%;
    animation: bhDotBounce 1.2s infinite ease-in-out;
}

.bh-typing-dot:nth-child(1) { animation-delay: 0s; }
.bh-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.bh-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bhDotBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
}

/* Ticket Priority & Status Badges */
.badge-priority-urgent { background: #EF4444; color: #FFF; }
.badge-priority-high { background: #F97316; color: #FFF; }
.badge-priority-medium { background: #3B82F6; color: #FFF; }
.badge-priority-low { background: #64748B; color: #FFF; }

.badge-status-new { background: #8B5CF6; color: #FFF; }
.badge-status-open { background: #3B82F6; color: #FFF; }
.badge-status-assigned { background: #06B6D4; color: #FFF; }
.badge-status-waiting { background: #F59E0B; color: #FFF; }
.badge-status-resolved { background: #10B981; color: #FFF; }
.badge-status-closed { background: #475569; color: #FFF; }

/* Agent Workspace Custom Layout */
.agent-workspace-root {
    display: grid;
    grid-template-columns: 320px 1fr 300px;
    gap: 16px;
    height: calc(100vh - 120px);
    min-height: 600px;
}

@media (max-width: 1200px) {
    .agent-workspace-root {
        grid-template-columns: 300px 1fr;
    }
    .agent-sidebar-right {
        display: none;
    }
}

@media (max-width: 992px) {
    .agent-workspace-root {
        grid-template-columns: 1fr;
        height: auto;
    }
}
