
/* Floating Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.chat-fab-group {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-fab-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform 0.3s ease, background 0.3s ease;
    animation: pulse-fab 2s ease-in-out infinite;
}

@keyframes pulse-fab {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.chat-fab-btn:hover {
    transform: scale(1.15) !important;
    background: var(--primary);
    color: #fff;
}

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    background: var(--primary-2);
}

.chat-popup {
    width: 380px;
    max-height: 560px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 16px;
    transition: all 0.35s cubic-bezier(.4,0,.2,1);
    transform-origin: bottom right;
}

.chat-popup.hidden {
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
    height: 0;
    margin-bottom: 0;
}

/* Expanded mode */
.chat-popup.expanded {
    width: 70vw;
    max-width: 900px;
    max-height: 80vh;
    border-radius: 16px;
}

@media (max-width: 768px) {
    .chat-popup.expanded {
        width: 95vw;
        max-height: 85vh;
    }
    .chat-popup {
        width: 90vw;
        max-height: 75vh;
    }
}

.chat-header {
    background: var(--primary);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-close-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
}

/* Tab Bar */
.chat-tab-bar {
    display: flex;
    background: #f5f0e8;
    border-bottom: 1px solid #e0d5c5;
}

.chat-tab {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: transparent;
    color: #888;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.chat-tab.active {
    color: var(--primary);
    background: #fff;
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.chat-tab:hover:not(.active) {
    color: var(--primary-2);
    background: #faf6f0;
}

/* Tab Content */
.chat-tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-tab-content:not(.active) {
    display: none !important;
}

.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Override existing chat interface styles for popup */
.chat-interface {
    border: none;
    border-radius: 0;
    box-shadow: none;
    height: 100%;
}

.chat-contact-form {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Widget file drop zone */
#wqaDropZone {
    transition: border-color 0.2s, background 0.2s;
}
#wqaDropZone.drag-over {
    border-color: var(--primary);
    background: #fef3e0;
}

/* Widget results scroll */
#widgetAnalysisResults {
    max-height: calc(80vh - 120px);
}
