/**
 * Expert Chat Embed Styles - LinkedIn-Style Floating Panel
 * 
 * Floating chat panel that slides in from right
 * Similar to LinkedIn messaging experience
 */

/* Backdrop Overlay */
#expert-chat-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 300ms ease, visibility 300ms ease;
}

#expert-chat-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Floating Chat Panel Container */
#expert-chat-embed {
    position: fixed;
    top: 0;
    right: -480px; /* Hidden off-screen */
    width: 450px;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 400ms cubic-bezier(0.4, 0.0, 0.2, 1);
}

#expert-chat-embed.active {
    right: 0; /* Slide in */
}

/* Chat Header */
.expert-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.expert-chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

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

.expert-chat-header-info {
    flex: 1;
    min-width: 0;
}

.expert-chat-header-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expert-chat-header-status {
    font-size: 13px;
    color: #6b7280;
    margin: 2px 0 0 0;
}

/* Chat Iframe Container */
.expert-chat-body {
    flex: 1;
    overflow: hidden;
    background: #f9fafb;
}

/* Chat Iframe */
#expert-chat-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* Close Button in Header */
.expert-chat-close-btn {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 200ms ease;
    flex-shrink: 0;
}

.expert-chat-close-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.expert-chat-close-btn i {
    width: 20px;
    height: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #expert-chat-embed {
        width: 100%;
        right: -100%;
    }
    
    #expert-chat-embed.active {
        right: 0;
    }
}

/* Loading State */
#expert-chat-embed.loading .expert-chat-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

#expert-chat-embed.loading .expert-chat-body::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Accessibility */
.expert-chat-close-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    #expert-chat-embed,
    #expert-chat-backdrop {
        display: none !important;
    }
}
