: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 */
#cf-chat-tooltip {
    position: fixed;
    bottom: 6rem;
    right: 2.5rem;
    background: var(--cf-gold);
    color: var(--cf-navy);
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
    pointer-events: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

#cf-chat-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--cf-gold);
}

#cf-chat-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
    animation: cfPulseTooltip 2s infinite;
}

@keyframes cfPulseTooltip {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@media (max-width: 480px) {
    #cf-chat-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        left: 0;
        border-radius: 0;
        max-height: 100vh;
    }
}