:root {
    --cf-navy: #0a192f;
    --cf-gold: #c5a059;
    --cf-gold-light: #e0c283;
    --cf-white: #ffffff;
    --cf-text-dim: rgba(255, 255, 255, 0.7);
    --cf-radius: 1.25rem;
    --cf-glass: rgba(10, 25, 47, 0.85);
    --cf-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Floating Action Button */
#cf-chat-trigger {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--cf-gold), var(--cf-gold-light));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(197, 160, 89, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#cf-chat-trigger:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 12px 30px rgba(197, 160, 89, 0.6);
}

#cf-chat-trigger svg {
    width: 30px;
    height: 30px;
    fill: var(--cf-navy);
}

/* Chat Container */
#cf-chat-container {
    position: fixed;
    bottom: 6.5rem;
    right: 2rem;
    width: 400px;
    height: 600px;
    max-height: 80vh;
    background: var(--cf-glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--cf-radius);
    box-shadow: var(--cf-shadow);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

#cf-chat-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.cf-chat-header {
    background: var(--cf-navy);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.bot-avatar {
    width: 45px;
    height: 45px;
    background: var(--cf-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--cf-navy);
    font-size: 1.2rem;
}

.bot-info h3 {
    color: #fff;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.bot-status {
    font-size: 0.75rem;
    color: var(--cf-gold);
    display: flex;
    align-items: center;
    gap: 5px;
}

.bot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    display: inline-block;
}

/* Close Button */
#cf-chat-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--cf-text-dim);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
    transition: color 0.3s;
}

#cf-chat-close:hover {
    color: var(--cf-gold);
}

/* Messages Area */
#cf-chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: var(--cf-gold) transparent;
}

.msg {
    max-width: 85%;
    padding: 0.9rem 1.1rem;
    border-radius: 1.1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    font-family: 'Plus Jakarta Sans', sans-serif;
    animation: msgIn 0.3s ease-out;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msg-assistant {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    color: #fff;
    align-self: flex-start;
    border-bottom-left-radius: 0.2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.msg-user {
    background: linear-gradient(135deg, var(--cf-gold), var(--cf-gold-light));
    color: #000;
    align-self: flex-end;
    border-bottom-right-radius: 0.2rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.2);
}

/* Quick Actions */
.cf-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: -5px;
    margin-bottom: 10px;
    animation: msgIn 0.5s ease-out;
}

.qa-btn {
    background: rgba(197, 160, 89, 0.15);
    border: 1px solid var(--cf-gold);
    color: var(--cf-gold);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
}

.qa-btn:hover {
    background: var(--cf-gold);
    color: var(--cf-navy);
    transform: translateY(-2px);
}

/* Input Area */
.cf-chat-input-wrap {
    padding: 1.25rem 1.5rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 0.75rem;
}

#cf-chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    padding: 0.75rem 1.25rem;
    color: #fff;
    outline: none;
    transition: border-color 0.3s;
}

#cf-chat-input:focus {
    border-color: var(--cf-gold);
}

#cf-chat-send {
    background: var(--cf-gold);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#cf-chat-send:active {
    transform: scale(0.9);
}

/* Typing Indicator */
.typing {
    display: flex;
    gap: 5px;
    padding: 10px;
}

.typing span {
    width: 6px;
    height: 6px;
    background: var(--cf-gold);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* Premium Components */
.chat-link {
    color: var(--cf-gold);
    text-decoration: underline;
    font-weight: 600;
}

.phone-wrap {
    display: inline-block;
    margin: 5px 0;
    width: 100%;
}

.cta-links {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.cta-btn {
    flex: 1;
    padding: 6px 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s;
}

.cta-btn.call {
    background: var(--cf-gold);
    color: var(--cf-navy);
}

.cta-btn.wa {
    background: #25d366;
    color: #fff;
}

.cta-btn:active {
    transform: scale(0.95);
}

.chat-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.chat-gallery img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-calendar {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    margin-top: 10px;
    border: 1px solid var(--cf-gold);
}

.chat-calendar h4 {
    color: var(--cf-gold);
    margin: 0 0 8px;
    font-size: 0.9rem;
}

.chat-calendar input,
.chat-calendar select {
    width: 100%;
    padding: 8px;
    margin-bottom: 8px;
    background: #fff;
    border-radius: 6px;
    border: none;
}

#cal-confirm {
    width: 100%;
    background: var(--cf-gold);
    color: var(--cf-navy);
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
}

/* Tooltip / Invitation — Themed Chat Bubble */
#cf-chat-tooltip {
    position: fixed;
    bottom: 6.3rem;
    right: 2.5rem;
    background: linear-gradient(135deg, var(--cf-gold), var(--cf-gold-light));
    color: var(--cf-navy);
    padding: 0.7rem 1.15rem;
    border-radius: 20px 20px 4px 20px;
    font-size: 0.87rem;
    font-weight: 700;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.08);
    z-index: 9998;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(14px) scale(0.88);
    transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 38px;
}

#cf-chat-tooltip::after {
    content: '';
    position: absolute;
    bottom: -7px;
    right: 18px;
    border-left: 8px solid transparent;
    border-right: 0px solid transparent;
    border-top: 8px solid var(--cf-gold-light);
}

#cf-chat-tooltip.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@keyframes cfPulseTooltip {
    0%, 100% { transform: scale(1) translateY(0); }
    50%       { transform: scale(1.04) translateY(-2px); }
}

/* ── Typing dots inside tooltip ── */
.cf-tlp-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 2px;
}
.cf-tlp-typing span {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.55;
    animation: cfTlpDot 1.3s ease-in-out infinite;
}
.cf-tlp-typing span:nth-child(2) { animation-delay: 0.18s; }
.cf-tlp-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes cfTlpDot {
    0%, 100% { transform: translateY(0);    opacity: 0.35; }
    50%       { transform: translateY(-5px); opacity: 1;    }
}

/* ── Message text span ── */
.cf-tlp-msg {
    display: inline-block;
}

/* ── Per-theme tooltip colors ── */

/* Cyber */
#cf-chat-tooltip.cf-theme-cyber {
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    color: #fff;
    box-shadow: 0 6px 22px rgba(0, 212, 255, 0.38);
}
#cf-chat-tooltip.cf-theme-cyber::after { border-top-color: #7c3aed; }

/* Solar */
#cf-chat-tooltip.cf-theme-solar {
    background: linear-gradient(135deg, #ff6b35, #e63946);
    color: #fff;
    box-shadow: 0 6px 22px rgba(255, 107, 53, 0.38);
}
#cf-chat-tooltip.cf-theme-solar::after { border-top-color: #e63946; }

/* Matrix */
#cf-chat-tooltip.cf-theme-matrix {
    background: linear-gradient(135deg, #00ff88, #00b4d8);
    color: #0a192f;
    box-shadow: 0 6px 22px rgba(0, 255, 136, 0.32);
}
#cf-chat-tooltip.cf-theme-matrix::after { border-top-color: #00b4d8; }

/* Gold */
#cf-chat-tooltip.cf-theme-gold {
    background: linear-gradient(135deg, #f5c518, #ff8c00);
    color: #0a192f;
    box-shadow: 0 6px 22px rgba(245, 197, 24, 0.38);
}
#cf-chat-tooltip.cf-theme-gold::after { border-top-color: #ff8c00; }

/* Aurora */
#cf-chat-tooltip.cf-theme-aurora {
    background: linear-gradient(135deg, #ff006e, #8338ec, #3a86ff);
    background-size: 200% 200%;
    color: #fff;
    box-shadow: 0 6px 22px rgba(131, 56, 236, 0.38);
    animation: cfAuroraFlow 4s ease infinite !important;
}
#cf-chat-tooltip.cf-theme-aurora::after { border-top-color: #3a86ff; }

/* Titanio */
#cf-chat-tooltip.cf-theme-titanio {
    background: linear-gradient(135deg, #8d99ae, #dee2e6);
    color: #2b2d42;
    box-shadow: 0 6px 22px rgba(141, 153, 174, 0.32);
}
#cf-chat-tooltip.cf-theme-titanio::after { border-top-color: #dee2e6; }

@media (max-width: 480px) {
    #cf-chat-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        left: 0;
        border-radius: 0;
        max-height: 100vh;
    }
}

/* =========================================================
   BUBBLE THEMES — 6 Futuristic Styles
   ========================================================= */

/* Shared reset for themed triggers */
#cf-chat-trigger[class*="cf-theme-"] {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    overflow: hidden;
}

/* ──── Theme 1: Neon Cyber ──── */
#cf-chat-trigger.cf-theme-cyber {
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    box-shadow: 0 8px 28px rgba(0, 212, 255, 0.5), 0 0 0 0 rgba(0, 212, 255, 0.35);
    animation: cfCyberPulse 2.2s ease-in-out infinite;
}
#cf-chat-trigger.cf-theme-cyber svg { fill: #fff; filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.7)); }
#cf-chat-trigger.cf-theme-cyber:hover {
    box-shadow: 0 14px 40px rgba(0, 212, 255, 0.7), 0 0 50px rgba(124, 58, 237, 0.4);
    transform: scale(1.12) translateY(-5px);
}
@keyframes cfCyberPulse {
    0%, 100% { box-shadow: 0 8px 28px rgba(0, 212, 255, 0.5), 0 0 0 0 rgba(0, 212, 255, 0.35); }
    50%       { box-shadow: 0 8px 28px rgba(0, 212, 255, 0.6), 0 0 0 14px rgba(0, 212, 255, 0); }
}

/* ──── Theme 2: Solar Flare ──── */
#cf-chat-trigger.cf-theme-solar {
    background: linear-gradient(135deg, #ff6b35, #e63946);
    box-shadow: 0 8px 28px rgba(255, 107, 53, 0.5);
    animation: cfSolarPulse 1.9s ease-in-out infinite;
}
#cf-chat-trigger.cf-theme-solar svg { fill: #fff; }
#cf-chat-trigger.cf-theme-solar:hover {
    box-shadow: 0 14px 40px rgba(230, 57, 70, 0.7);
    transform: scale(1.12) translateY(-5px);
}
@keyframes cfSolarPulse {
    0%, 100% { box-shadow: 0 8px 28px rgba(255, 107, 53, 0.5), 0 0 0 0 rgba(255, 107, 53, 0.3); }
    50%       { box-shadow: 0 8px 28px rgba(255, 107, 53, 0.7), 0 0 0 16px rgba(255, 107, 53, 0); }
}

/* ──── Theme 3: Matrix Green ──── */
#cf-chat-trigger.cf-theme-matrix {
    background: linear-gradient(135deg, #00ff88, #00b4d8);
    box-shadow: 0 8px 28px rgba(0, 255, 136, 0.45);
    animation: cfMatrixPulse 2.5s ease-in-out infinite;
    position: fixed; /* already fixed — reinforce for pseudo-elements */
}
#cf-chat-trigger.cf-theme-matrix::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 4px,
        rgba(0, 255, 136, 0.07) 4px,
        rgba(0, 255, 136, 0.07) 5px
    );
    border-radius: 50%;
    animation: cfScanMove 2.5s linear infinite;
    pointer-events: none;
    z-index: 0;
}
#cf-chat-trigger.cf-theme-matrix svg { fill: #0a192f; position: relative; z-index: 1; }
#cf-chat-trigger.cf-theme-matrix:hover {
    box-shadow: 0 14px 40px rgba(0, 255, 136, 0.65);
    transform: scale(1.12) translateY(-5px);
}
@keyframes cfMatrixPulse {
    0%, 100% { box-shadow: 0 8px 28px rgba(0, 255, 136, 0.45), 0 0 0 0 rgba(0, 255, 136, 0.3); }
    50%       { box-shadow: 0 8px 28px rgba(0, 255, 136, 0.65), 0 0 0 12px rgba(0, 255, 136, 0); }
}
@keyframes cfScanMove {
    from { background-position: 0 0; }
    to   { background-position: 0 10px; }
}

/* ──── Theme 4: Royal Gold (enhanced) ──── */
#cf-chat-trigger.cf-theme-gold {
    background: linear-gradient(135deg, #f5c518, #ff8c00);
    box-shadow: 0 8px 28px rgba(245, 197, 24, 0.5);
    animation: cfGoldPulse 2.2s ease-in-out infinite;
}
#cf-chat-trigger.cf-theme-gold::before {
    content: '';
    position: absolute;
    top: -60%;
    left: -80%;
    width: 55%;
    height: 220%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
    transform: rotate(18deg);
    animation: cfGoldShine 3.2s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
#cf-chat-trigger.cf-theme-gold svg { fill: #0a192f; position: relative; z-index: 1; }
#cf-chat-trigger.cf-theme-gold:hover {
    box-shadow: 0 14px 40px rgba(245, 197, 24, 0.7);
    transform: scale(1.12) translateY(-5px);
}
@keyframes cfGoldPulse {
    0%, 100% { box-shadow: 0 8px 28px rgba(245, 197, 24, 0.5), 0 0 0 0 rgba(245, 197, 24, 0.3); }
    50%       { box-shadow: 0 8px 28px rgba(245, 197, 24, 0.7), 0 0 0 12px rgba(245, 197, 24, 0); }
}
@keyframes cfGoldShine {
    0%       { left: -80%; }
    40%, 100% { left: 140%; }
}

/* ──── Theme 5: Aurora ──── */
#cf-chat-trigger.cf-theme-aurora {
    background: linear-gradient(135deg, #ff006e, #8338ec, #3a86ff);
    background-size: 250% 250%;
    box-shadow: 0 8px 28px rgba(131, 56, 236, 0.5);
    animation: cfAuroraFlow 4s ease infinite, cfAuroraPulse 2.4s ease-in-out infinite;
}
#cf-chat-trigger.cf-theme-aurora svg { fill: #fff; filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5)); }
#cf-chat-trigger.cf-theme-aurora:hover {
    box-shadow: 0 14px 40px rgba(131, 56, 236, 0.75);
    transform: scale(1.12) translateY(-5px);
}
@keyframes cfAuroraFlow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes cfAuroraPulse {
    0%, 100% { box-shadow: 0 8px 28px rgba(131, 56, 236, 0.5), 0 0 0 0 rgba(131, 56, 236, 0.3); }
    50%       { box-shadow: 0 8px 28px rgba(131, 56, 236, 0.65), 0 0 0 14px rgba(131, 56, 236, 0); }
}

/* ──── Theme 6: Titanio ──── */
#cf-chat-trigger.cf-theme-titanio {
    background: linear-gradient(135deg, #6c757d, #adb5bd, #dee2e6, #adb5bd, #6c757d);
    background-size: 300% 300%;
    box-shadow: 0 8px 28px rgba(108, 117, 125, 0.45);
    animation: cfTitanioShine 4s ease-in-out infinite;
}
#cf-chat-trigger.cf-theme-titanio::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}
#cf-chat-trigger.cf-theme-titanio svg { fill: #2b2d42; position: relative; z-index: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25)); }
#cf-chat-trigger.cf-theme-titanio:hover {
    box-shadow: 0 14px 40px rgba(108, 117, 125, 0.65);
    transform: scale(1.12) translateY(-5px);
}
@keyframes cfTitanioShine {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* =========================================================
   BUBBLE POSITION — Left Side Support
   ========================================================= */

body.cf-pos-left #cf-chat-trigger {
    right: auto;
    left: 2rem;
}
body.cf-pos-left #cf-chat-container {
    right: auto;
    left: 2rem;
}
body.cf-pos-left #cf-chat-tooltip {
    right: auto;
    left: 2.5rem;
}
body.cf-pos-left #cf-chat-tooltip::after {
    right: auto;
    left: 20px;
}

/* =========================================================
   CTA TOOLTIP ANIMATION VARIANTS
   ========================================================= */

/* Bounce (default) */
#cf-chat-tooltip.cf-anim-bounce.visible {
    animation: cfTooltipBounce 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, cfPulseTooltip 2s 0.7s infinite !important;
}
@keyframes cfTooltipBounce {
    0%   { opacity: 0; transform: scale(0.5) translateY(12px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Slide */
#cf-chat-tooltip.cf-anim-slide.visible {
    animation: cfTooltipSlide 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards, cfPulseTooltip 2s 0.5s infinite !important;
}
@keyframes cfTooltipSlide {
    0%   { opacity: 0; transform: translateX(30px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* Fade */
#cf-chat-tooltip.cf-anim-fade.visible {
    animation: cfTooltipFade 0.5s ease forwards, cfPulseTooltip 2s 0.55s infinite !important;
}
@keyframes cfTooltipFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Pulse */
#cf-chat-tooltip.cf-anim-pulse.visible {
    animation: cfTooltipPulseIn 0.4s ease forwards, cfTooltipPulseAttention 1.2s 0.45s infinite !important;
}
@keyframes cfTooltipPulseIn {
    0%   { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes cfTooltipPulseAttention {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.06); }
}