/* =====================================================
   STACEY CHAT V3
   ===================================================== */

.chat-root {
    position: relative;
    z-index: 5000;
}

.chat-clear {
    background: transparent;
    border: none;
    cursor: pointer;
}

.chat-header-actions {
    display: flex;
    gap: 8px;
    margin-right: 8px;
}

.chat-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(219, 39, 119, 0.05);
    border: 1px solid rgba(219, 39, 119, 0.1);
    color: #db2777;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-action-btn:hover {
    background: rgba(219, 39, 119, 0.1);
    transform: translateY(-1px);
}

/* =====================================================
   DRAGGABLE BUBBLE
   ===================================================== */

.chat-bubble {
    position: fixed;

    right: 20px;
    bottom: 120px;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px 16px;

    border: none;
    border-radius: 999px;

    background: rgba(255,255,255,0.94);

    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);

    box-shadow:
        0 12px 40px rgba(0,0,0,.12),
        0 10px 20px rgba(219,39,119,.18);

    cursor: grab;

    user-select: none;
    touch-action: none;

    z-index: 9999;

    transition:
        left 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28),
        top 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28),
        transform 0.3s ease;

    animation: bubbleFloat 4s ease-in-out infinite;
}

.chat-bubble:hover {
    transform: scale(1.05);
}

.chat-bubble.docked-right {
    right: -70px;
}

.chat-bubble.docked-right:hover {
    right: 12px;
}

/* =====================================================
   AVATAR
   ===================================================== */

.chat-avatar {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            #ec4899,
            #db2777
        );

    color: white;
    font-size: 18px;

    flex-shrink: 0;

    position: relative;
}

/* unread pulse */

.chat-avatar::after {
    content: "";

    position: absolute;

    width: 10px;
    height: 10px;

    right: 4px;
    top: 4px;

    border-radius: 50%;

    background: #10b981;

    box-shadow:
        0 0 0 0 rgba(16,185,129,.7);

    animation: pulse 2s infinite;
}

/* =====================================================
   PREVIEW
   ===================================================== */

.chat-preview {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.chat-preview-name {
    font-size: 14px;
    font-weight: 700;
    color: #be185d;
}

.chat-preview-message {
    font-size: 13px;
    color: #6b7280;
}

/* =====================================================
   CHAT PANEL
   ===================================================== */

.chat-panel {
    position: fixed;

    /* Always fullscreen */
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    left: 0 !important;
    top: 0 !important;
    border-radius: 0 !important;

    display: none;
    flex-direction: column;

    background:
        rgba(255,255,255,.98);

    backdrop-filter: blur(24px);

    border-radius: 0;

    overflow: hidden;

    box-shadow:
        0 30px 80px rgba(0,0,0,.18);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: scale(0.95);

    transition:
        opacity .3s ease,
        transform .3s ease,
        visibility .3s ease;

    z-index: 10000;
}

.chat-panel.active{
    display: flex;
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transform: scale(1);
}

/* =====================================================
   HEADER
   ===================================================== */

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px;

    border-bottom:
        1px solid rgba(0,0,0,.06);

    background:
        linear-gradient(
            135deg,
            #fff7fb,
            #ffffff
        );
}

.chat-header-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-header-avatar {
    width: 44px;
    height: 44px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            135deg,
            #ec4899,
            #db2777
        );

    color: white;
}

.chat-header-name {
    font-size: 15px;
    font-weight: 700;
}

.chat-header-status {
    font-size: 12px;
    color: #10b981;
}

.chat-close {
    background: transparent;
    border: none;

    font-size: 22px;

    cursor: pointer;
}

/* =====================================================
   MESSAGES
   ===================================================== */

.chat-messages {
    flex: 1;

    overflow-y: auto;

    padding: 18px;

    display: flex;
    flex-direction: column;
    gap: 12px;

    background:
        linear-gradient(
            to bottom,
            #ffffff,
            #fff8fb
        );
}

.message-bubble {
    max-width: 80%;

    padding: 12px 14px;

    border-radius: 18px;

    font-size: 14px;
    line-height: 1.5;

    word-break: break-word;
}

.message-bubble.stacey {
    align-self: flex-start;

    background: white;

    border:
        1px solid rgba(0,0,0,.06);
}

.message-bubble.user {
    align-self: flex-end;

    color: white;

    background:
        linear-gradient(
            135deg,
            #ec4899,
            #db2777
        );
}

/* =====================================================
   SUGGESTIONS
   ===================================================== */

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    padding: 16px;

    background: white;

    border-top:
        1px solid rgba(0,0,0,.06);
}

.suggestion-chip {
    border: none;

    padding: 10px 14px;

    border-radius: 999px;

    background: #fdf2f8;
    color: #be185d;

    cursor: pointer;

    font-size: 13px;
    font-weight: 600;

    transition:
        transform .2s ease,
        background .2s ease;
}

.suggestion-chip:hover {
    background: #fbcfe8;
    transform: translateY(-2px);
}

/* =====================================================
   ANIMATIONS
   ===================================================== */

.typing-dot {

    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: #db2777;

    display: inline-block;

    margin-right: 4px;

    animation: typingBounce 1s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: .15s;
}

.typing-dot:nth-child(3) {
    animation-delay: .3s;
}

@keyframes typingBounce {

    0%, 80%, 100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-4px);
    }
}

@keyframes bubbleFloat {
    0% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}

@keyframes pulse {
    0% {
        box-shadow:
        0 0 0 0 rgba(16,185,129,.7);
    }

    100% {
        box-shadow:
        0 0 0 12px rgba(16,185,129,0);
    }
}

/* =====================================================
   MOBILE
   ===================================================== */

/* =====================================================
   FULLSCREEN PANEL
   ===================================================== */

.chat-offer-card {

    animation: offerReveal .4s ease;
}

@keyframes offerReveal {

    from {

        opacity: 0;
        transform: translateY(20px);
    }

    to {

        opacity: 1;
        transform: translateY(0);
    }
}

.chat-panel.fullscreen .chat-messages {

    padding-top: 24px;
    padding-bottom: 24px;

    font-size: 15px;
}

.chat-panel.fullscreen .chat-cta-area {

    padding: 16px;
}

.special-card {

    max-width: 100% !important;

    background: transparent !important;

    border: none !important;

    padding: 0 !important;
}

.chat-promo {

    background:
        linear-gradient(
            135deg,
            #ec4899,
            #db2777
        );

    color: white;

    border-radius: 18px;

    padding: 18px;
}

.chat-promo-title {

    font-size: 16px;

    font-weight: 700;

    margin-bottom: 8px;
}

.chat-promo-text {

    opacity: .95;

    margin-bottom: 14px;

    line-height: 1.5;
}

.chat-promo-button {

    display: inline-block;

    padding: 12px 18px;

    border-radius: 999px;

    background: white;

    color: #db2777;

    text-decoration: none;

    font-weight: 700;
}

.chat-inline-options{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-top:12px;
}

.chat-inline-option{
    border:none;
    border-radius:999px;
    padding:10px 14px;
    cursor:pointer;

    background:#fdf2f8;
    color:#be185d;

    font-weight:600;
}

.chat-inline-option:hover{
    background:#fbcfe8;
}

.chat-inline-option.back {
    background: white;
    border: 1px solid #fce7f3;
    color: #db2777;
    opacity: 0.8;
}

.chat-cta-message{

    margin-top:12px;

    background:white;

    border-radius:20px;

    padding:18px;

    border:1px solid
    rgba(219,39,119,.15);

    box-shadow:
    0 10px 25px
    rgba(219,39,119,.08);
}

.chat-cta-message h4{

    margin:0 0 8px;

    color:#be185d;
}

.chat-cta-message p{

    margin:0 0 14px;

    color:#6b7280;
}

.chat-cta-message a{

    display:inline-flex;

    padding:12px 18px;

    border-radius:999px;

    text-decoration:none;

    color:white;

    background:
    linear-gradient(
        135deg,
        #ec4899,
        #db2777
    );