body, #profitbuyz-widget { font-family: Tahoma, Arial, sans-serif; }

/* Chat Bubble - Base Styles */
#profitbuyz-bubble {
    position: fixed;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #030C18;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    z-index: 999999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Bubble Position Variants - Applied by JavaScript */
#profitbuyz-bubble.position-top {
    top: 20px;
    bottom: auto;
}

#profitbuyz-bubble.position-middle {
    top: 50%;
    transform: translateY(-50%);
    bottom: auto;
}

#profitbuyz-bubble.position-bottom {
    bottom: 20px;
    top: auto;
}

#profitbuyz-bubble:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0,0,0,0.35);
}

/* Middle position needs special hover */
#profitbuyz-bubble.position-middle:hover {
    transform: translateY(-50%) scale(1.05);
}

/* Widget Container - Base Styles */
#profitbuyz-widget {
    position: fixed;
    right: 20px;
    width: 320px;
    height: 420px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    z-index: 999999;
    font-family: Arial, sans-serif;
}

/* Widget Position Variants - Applied by JavaScript */
#profitbuyz-widget.position-top {
    top: 90px;
    bottom: auto;
}

#profitbuyz-widget.position-middle {
    top: 50%;
    transform: translateY(-50%);
    bottom: auto;
}

#profitbuyz-widget.position-bottom {
    bottom: 20px;
    top: auto;
}

/* Hidden state */
#profitbuyz-widget.hidden {
    display: none;
}

/* Header */
#profitbuyz-header {
    background: #030C18;
    color: #fff;
    padding: 12px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

#profitbuyz-close {
    cursor: pointer;
    font-size: 16px;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

#profitbuyz-close:hover {
    opacity: 1;
}

/* Messages */
#profitbuyz-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    font-size: 14px;
}

#profitbuyz-messages::-webkit-scrollbar {
    width: 6px;
}

#profitbuyz-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#profitbuyz-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

#profitbuyz-messages::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Input */
#profitbuyz-input {
    display: flex;
    border-top: 1px solid #ddd;
}

#profitbuyz-text {
    flex: 1;
    border: none;
    padding: 10px;
    outline: none;
    font-size: 14px;
}

#profitbuyz-send {
    background: #030C18;
    color: white;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

#profitbuyz-send:hover {
    opacity: 0.9;
}

#profitbuyz-send:active {
    opacity: 0.8;
}


/* ---------- WhatsApp-style message bubbles ---------- */
#profitbuyz-messages {
    display: flex;
    flex-direction: column;
    gap: 6px;
}


.phixtra-label{
    font-size: 11px;
    font-weight: 900;
    opacity: 0.65;
    margin-bottom: 4px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.phixtra-user .phixtra-label{
    text-align: right;
}
.phixtra-agent .phixtra-label{
    text-align: left;
}
.phixtra-body{
    white-space: normal;
}

.phixtra-msg {
    max-width: 85%;
    padding: 10px 12px;
    border-radius: 14px;
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
}

.phixtra-user {
    align-self: flex-end;
    background: rgba(3, 12, 24, 0.08);
    border-top-right-radius: 6px;
}

.phixtra-agent {
    align-self: flex-start;
    background: rgba(0, 0, 0, 0.04);
    border-top-left-radius: 6px;
}

.phixtra-agent strong {
    font-weight: 900;
}

.phixtra-typing {
    background: rgba(0, 0, 0, 0.03);
}


/* ══════════════════════════════════════════════════════════════
   PhiXtra Welcome Popup — First-Time Visitor
   All styles are tightly scoped to #phixtra-welcome-* IDs so
   they never conflict with the host theme.
══════════════════════════════════════════════════════════════ */

/* Overlay / backdrop */
#phixtra-welcome-overlay {
    position: fixed;
    inset: 0;                          /* covers full viewport */
    z-index: 1000001;                  /* above the chat widget (999999) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0);     /* starts transparent */
    transition: background 0.35s ease;
    box-sizing: border-box;
}

/* Visible state — triggered by JS adding the class */
#phixtra-welcome-overlay.phixtra-popup-visible {
    background: rgba(0, 0, 0, 0.55);
}

/* Hiding state — fade out */
#phixtra-welcome-overlay.phixtra-popup-hiding {
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
}

/* Modal box */
#phixtra-welcome-modal {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 480px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: Tahoma, Arial, sans-serif;

    /* Slide-up entrance animation */
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                opacity   0.35s ease;
}

#phixtra-welcome-overlay.phixtra-popup-visible #phixtra-welcome-modal {
    transform: translateY(0);
    opacity: 1;
}

#phixtra-welcome-overlay.phixtra-popup-hiding #phixtra-welcome-modal {
    transform: translateY(20px);
    opacity: 0;
}

/* Header bar */
#phixtra-welcome-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    gap: 12px;
    flex-shrink: 0;
}

#phixtra-welcome-title {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    flex: 1;
}

/* ✕ dismiss button in header */
#phixtra-welcome-dismiss {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
    padding: 0;
}

#phixtra-welcome-dismiss:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Scrollable body — where the admin's rich-text message lives */
#phixtra-welcome-body {
    padding: 20px 22px 16px;
    overflow-y: auto;
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
    color: #333333;
    /* Let the admin's HTML styles (colour, font, size) come through */
}

/* Ensure common rich-text elements look clean */
#phixtra-welcome-body p  { margin: 0 0 10px; }
#phixtra-welcome-body ul,
#phixtra-welcome-body ol { margin: 0 0 10px; padding-left: 22px; }
#phixtra-welcome-body li { margin-bottom: 5px; }
#phixtra-welcome-body a  { color: #1a73e8; text-decoration: underline; }
#phixtra-welcome-body strong { font-weight: 700; }

/* Scrollbar styling */
#phixtra-welcome-body::-webkit-scrollbar       { width: 5px; }
#phixtra-welcome-body::-webkit-scrollbar-track { background: #f1f1f1; }
#phixtra-welcome-body::-webkit-scrollbar-thumb { background: #cccccc; border-radius: 3px; }

/* Footer — CTA + skip */
#phixtra-welcome-footer {
    padding: 14px 22px 18px;
    border-top: 1px solid #eeeeee;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Primary CTA button */
#phixtra-welcome-cta {
    flex: 1;
    min-width: 140px;
    padding: 11px 20px;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-family: Tahoma, Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s, transform 0.15s;
    line-height: 1.2;
}

#phixtra-welcome-cta:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

#phixtra-welcome-cta:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

/* "Maybe later" skip link */
#phixtra-welcome-skip {
    background: none;
    border: none;
    color: #888888;
    font-family: Tahoma, Arial, sans-serif;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
    white-space: nowrap;
    transition: color 0.2s;
}

#phixtra-welcome-skip:hover {
    color: #444444;
}

/* Mobile adjustments */
@media (max-width: 520px) {
    #phixtra-welcome-modal  { border-radius: 10px; }
    #phixtra-welcome-header { padding: 12px 14px; }
    #phixtra-welcome-body   { padding: 16px 14px 12px; }
    #phixtra-welcome-footer { padding: 12px 14px 16px; }
    #phixtra-welcome-title  { font-size: 14px; }
}

