/* ═══════════════════════════════════════════════════
   Copilot — Shared styles for both modules
   Module 1: AI Project (right panel)
   Module 2: Live Chat (floating popup)
   ═══════════════════════════════════════════════════ */

/* ─── Floating Popup (Live Chat) ─────────────── */
.copilot-panel {
    position: fixed;
    bottom: 150px;
    right: 20px;
    width: 370px;
    max-height: 500px;
    background: #1a1b2e;
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.copilot-panel.copilot-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.copilot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

.copilot-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.copilot-header-icon {
    font-size: 16px;
}

.copilot-header-title {
    font-size: 13px;
    font-weight: 600;
    color: #e0d6ff;
}

.copilot-close-btn {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
}

.copilot-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e4e6eb;
}

/* Messages (shared) */
.copilot-messages,
.ai-project-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 300px;
    min-height: 80px;
}

.copilot-msg {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    max-width: 88%;
    word-wrap: break-word;
}

.copilot-msg-user {
    background: rgba(99, 102, 241, 0.2);
    color: #c4b5fd;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.copilot-msg-bot {
    background: rgba(255, 255, 255, 0.05);
    color: #d1d5db;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* Load More */
.copilot-load-more {
    align-self: center;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #6b7085;
    font-size: 11px;
    cursor: pointer;
    margin-bottom: 4px;
}

.copilot-load-more:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
}

/* Quick Actions */
.copilot-quick-btn {
    padding: 4px 8px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    color: #a5b4fc;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.copilot-quick-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #c4b5fd;
}

/* Input Area */
.copilot-input-area,
.ai-project-input-area {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
}

.copilot-input,
.ai-project-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 7px 10px;
    color: #e4e6eb;
    font-size: 13px;
    outline: none;
}

.copilot-input:focus,
.ai-project-input:focus {
    border-color: rgba(99, 102, 241, 0.4);
}

.copilot-input::placeholder,
.ai-project-input::placeholder {
    color: #6b7085;
}

.copilot-send-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 7px 10px;
    cursor: pointer;
    font-size: 12px;
}

.copilot-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ─── FAB (Floating Action Button) ───────────── */
.livechat-fab {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    z-index: 9998;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.livechat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

.livechat-fab-active {
    background: rgba(99, 102, 241, 0.3) !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2) !important;
}

/* ─── AI Project Panel (right sidebar) ───────── */
.ai-project-header {
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

.ai-project-messages {
    max-height: none;
    flex: 1;
    min-height: 200px;
}

.ai-project-quickbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 6px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Mobile */
@media (max-width: 768px) {
    .copilot-panel {
        bottom: 210px;
        right: 8px;
        left: 8px;
        width: auto;
        max-height: 45vh;
    }

    .livechat-fab {
        bottom: 150px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 17px;
    }
}