/* --- LAUNCHER --- */
#pcg-launcher {
    position: fixed; bottom: 20px; right: 20px; width: 60px; height: 60px;
    background: var(--pcg-primary);
    color: white; border-radius: 50%;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 999999; transition: transform 0.2s ease;
}
#pcg-launcher:hover { transform: scale(1.05); }

/* --- CONTAINER --- */
#pcg-chatbot-container {
    position: fixed; bottom: 90px; right: 20px; width: 360px; height: 520px;
    background: #ffffff; border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    display: flex; flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    z-index: 999999; border: 1px solid #f0f0f0; overflow: hidden;
}
.pcg-hidden { display: none !important; }

/* --- HEADER --- */
#pcg-header {
    background: var(--pcg-primary);
    color: white; padding: 12px 16px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pcg-header-left {
    display: flex; align-items: center; gap: 12px;
}

.pcg-avatar-head {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.25);
    background: white;
}

.pcg-header-info {
    line-height: 1.2;
}

.pcg-bot-name {
    font-weight: 700; font-size: 15px;
}

.pcg-bot-status {
    font-size: 12px; opacity: 0.9;
    display: flex; align-items: center; gap: 5px;
}

.pcg-dot {
    width: 8px; height: 8px;
    background-color: #4ade80; /* Bright Green */
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(74, 222, 128, 0.6);
}

#pcg-close-btn { 
    background: transparent; border: none; color: white; 
    font-size: 24px; cursor: pointer; line-height: 1; padding: 0 5px;
}

/* --- MESSAGES AREA --- */
#pcg-messages { 
    flex: 1; padding: 20px; overflow-y: auto; 
    background: #f8fafc; font-size: 14px; 
}

/* --- MESSAGE ROWS (Flex Layout for Avatars) --- */
.pcg-msg-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: flex-end; /* Align avatar to bottom of bubble */
}

/* AI Row */
.pcg-ai-row {
    justify-content: flex-start;
}

.pcg-avatar-chat {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-bottom: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background: white;
}

.pcg-ai { 
    background: #ffffff; color: #1e293b; 
    border-radius: 16px 16px 16px 2px; /* Point bottom-left */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); 
    border: 1px solid #e2e8f0; 
    padding: 12px 16px;
    max-width: 80%;
}

/* User Row */
.pcg-user-row {
    justify-content: flex-end;
}

.pcg-user { 
    background: var(--pcg-primary);
    color: white; 
    border-radius: 16px 16px 2px 16px; /* Point bottom-right */
    padding: 10px 15px;
    max-width: 80%;
    text-align: left;
}

/* Links inside AI */
.pcg-ai a { color: var(--pcg-primary); text-decoration: none; font-weight: 600; }
.pcg-ai a:hover { text-decoration: underline; }

/* --- INPUT --- */
#pcg-input-area { 
    padding: 15px; background: white; 
    border-top: 1px solid #f1f5f9; 
    display: flex; gap: 10px; align-items: center; 
}
#pcg-input { 
    flex: 1; border: 1px solid #e2e8f0; 
    padding: 12px 15px; border-radius: 24px; 
    outline: none; font-size: 14px; 
}
#pcg-input:focus { border-color: var(--pcg-primary); }

#pcg-send-btn { 
    background: var(--pcg-primary); color: white; border: none; 
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer; 
    display: flex; align-items: center; justify-content: center; 
    transition: background 0.2s;
}
#pcg-send-btn:hover { background: var(--pcg-primary-dark); }

/* --- LEAD FORM --- */
.pcg-lead-form-container {
    border-top: 3px solid var(--pcg-primary);
    background: var(--pcg-primary-light);
}

.pcg-form-input {
    width: 100%; margin-bottom: 8px; padding: 8px;
    border: 1px solid #ddd; border-radius: 6px;
    font-size: 13px;
}
.pcg-form-input:focus { border-color: var(--pcg-primary); outline: none; }

.pcg-form-btn {
    width: 100%; background: var(--pcg-primary); color: white;
    border: none; padding: 10px; border-radius: 8px;
    font-weight: 600; cursor: pointer; font-size: 13px;
    transition: background 0.2s;
}
.pcg-form-btn:hover { background: var(--pcg-primary-dark); }
/* --- TRIAGE OPTION BUTTONS --- */
.pcg-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}
.pcg-option-btn {
    background: #ffffff;
    color: var(--pcg-primary);
    border: 2px solid var(--pcg-primary);
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s, transform 0.1s;
}
.pcg-option-btn:hover:not(:disabled) {
    background: var(--pcg-primary);
    color: #ffffff;
    transform: translateX(3px);
}
.pcg-option-btn:disabled {
    pointer-events: none;
}
