/* ─── Enzo Chatbot Frontend — Premium Pink Gradient Theme ─── */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

/* Scoped reset */
.enzo-chatbot-container *,
.enzo-chatbot-container *::before,
.enzo-chatbot-container *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ════════════════════════════════
   ROOT — fixed width, never shifts
════════════════════════════════ */
.enzo-chatbot-container {
    --pink:    #E94B8A;
    --pink-a:  #FF6FA5;
    --pink-d:  #c7356e;
    --pink-l:  #fef0f5;
    --pink-m:  #fddee9;
    --dark:    #1A1A1A;
    --dark-m:  #2a2a2a;
    --text:    #1e1e1e;
    --muted:   #7a7a7a;
    --white:   #ffffff;
    --bg:      #faf7f9;
    --bg-warm: #fdf9fb;
    --border:  #f3e8ee;
    --r:       20px;
    --rs:      10px;

    font-family: 'DM Sans', sans-serif;
    width: 380px;
    min-width: 380px;
    max-width: 380px;
    /* Safari: prevent vw-based overflow */
    box-sizing: border-box;
    max-height: calc(100vh - 110px);
    height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overflow-x: hidden;
    border-radius: var(--r);
    background: var(--white);
    box-shadow:
        0 24px 80px rgba(233,75,138,.15),
        0 8px 32px rgba(0,0,0,.12),
        0 2px 8px rgba(0,0,0,.06);
}

/* ════════════════════════════════
   HEADER — dark-to-pink gradient
════════════════════════════════ */
.enzo-w-head {
    background: linear-gradient(135deg, #1A1A1A 0%, #2a2020 40%, #E94B8A 100%);
    padding: 15px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
/* Subtle shine overlay */
.enzo-w-head::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.06) 0%, transparent 60%);
    pointer-events: none;
}
.enzo-w-avatar {
    width: 40px; height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--pink), var(--pink-a));
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
    color: #fff;
    box-shadow: 0 4px 14px rgba(233,75,138,.4);
    position: relative; z-index: 1;
}
.enzo-w-head-info { position: relative; z-index: 1; }
.enzo-w-head-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -.2px;
    line-height: 1.2;
}
.enzo-w-head-info p {
    font-size: 10.5px;
    color: rgba(255,255,255,.6);
    margin-top: 3px;
    letter-spacing: .15px;
}
.enzo-online {
    width: 8px; height: 8px;
    background: #34d399;
    border-radius: 50%;
    margin-left: auto; flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(52,211,153,.25), 0 0 8px rgba(52,211,153,.4);
    animation: enzo-blink 2.5s ease infinite;
    position: relative; z-index: 1;
}
@keyframes enzo-blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ════════════════════════════════
   3 QUICK TABS
════════════════════════════════ */
.enzo-quick-tabs {
    display: flex;
    gap: 7px;
    padding: 11px 14px 9px;
    background: var(--white);
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}
.enzo-qtab {
    flex: 1;
    padding: 9px 6px 8px;
    border-radius: 10px;
    border: 1.5px solid var(--pink-m);
    background: var(--bg-warm);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all .2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: .1px;
}
.enzo-qtab-icon {
    font-size: 18px;
    line-height: 1;
}
.enzo-qtab:hover {
    border-color: var(--pink);
    color: var(--pink-d);
    background: var(--pink-l);
    box-shadow: 0 2px 10px rgba(233,75,138,.12);
}
.enzo-qtab.active {
    background: linear-gradient(135deg, var(--pink), var(--pink-a));
    border-color: transparent;
    color: var(--white);
    box-shadow: 0 4px 16px rgba(233,75,138,.3);
}

/* ════════════════════════════════
   PROGRESS BAR
════════════════════════════════ */
.enzo-w-prog {
    display: flex;
    gap: 3px;
    padding: 8px 14px 0;
    background: var(--white);
    flex-shrink: 0;
}
.enzo-pd {
    height: 3px; flex: 1;
    border-radius: 3px;
    background: var(--pink-m);
    transition: background .3s, box-shadow .3s;
}
.enzo-pd.on {
    background: linear-gradient(90deg, var(--pink), var(--pink-a));
    box-shadow: 0 0 6px rgba(233,75,138,.25);
}

/* ════════════════════════════════
   SMART BACK — single "← Main Menu" button
════════════════════════════════ */
.enzo-nav-bar {
    display: flex;
    align-items: center;
    padding: 7px 14px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.enzo-smartback-btn {
    background: var(--bg-warm);
    border: 1.5px solid var(--pink-m);
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--pink);
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: all .2s ease;
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 2px;
}
.enzo-smartback-btn:hover {
    border-color: var(--pink);
    background: var(--pink-l);
    color: var(--pink-d);
    box-shadow: 0 2px 10px rgba(233,75,138,.15);
}

/* ════════════════════════════════
   MESSAGES
════════════════════════════════ */
.enzo-w-msgs {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}
.enzo-w-msgs::-webkit-scrollbar { width: 3px; }
.enzo-w-msgs::-webkit-scrollbar-thumb { background: var(--pink-m); border-radius: 3px; }

.enzo-msg { display: flex; flex-direction: column; gap: 4px; animation: enzo-mIn .25s ease; }
@keyframes enzo-mIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }
.enzo-msg.bot  { align-items: flex-start; }
.enzo-msg.user { align-items: flex-end; }

.enzo-bubble {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.55;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.enzo-msg.bot .enzo-bubble {
    background: var(--white);
    color: var(--text);
    border-radius: 4px 16px 16px 16px;
    box-shadow: 0 2px 12px rgba(233,75,138,.06), 0 1px 4px rgba(0,0,0,.04);
    border: 1px solid var(--border);
}
.enzo-msg.user .enzo-bubble {
    background: linear-gradient(135deg, var(--pink), var(--pink-a));
    color: #fff;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 4px 16px rgba(233,75,138,.25);
}
.enzo-mtime { font-size: 9px; color: var(--muted); padding: 0 4px; }

/* Typing */
.enzo-typing {
    display: flex; gap: 4px;
    padding: 10px 14px;
    background: var(--white);
    border-radius: 4px 16px 16px 16px;
    box-shadow: 0 2px 12px rgba(233,75,138,.06), 0 1px 4px rgba(0,0,0,.04);
    border: 1px solid var(--border);
    width: fit-content;
}
.enzo-tdot {
    width: 5px; height: 5px;
    background: linear-gradient(135deg, var(--pink), var(--pink-a));
    border-radius: 50%;
    animation: enzo-td 1.2s infinite;
}
.enzo-tdot:nth-child(2) { animation-delay: .2s; }
.enzo-tdot:nth-child(3) { animation-delay: .4s; }
@keyframes enzo-td { 0%,80%,100%{transform:scale(1);opacity:.4} 40%{transform:scale(1.4);opacity:1} }

/* Service chips */
.enzo-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.enzo-chip {
    display: inline-flex; align-items: center;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--pink-l);
    border: 1px solid var(--pink);
    color: var(--pink-d);
    font-size: 11.5px;
    font-weight: 500;
}

/* ════════════════════════════════
   OPTIONS
════════════════════════════════ */
.enzo-w-opts {
    flex-shrink: 0;
    max-height: 46%;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--white);
    border-top: 1px solid var(--border);
}
.enzo-w-opts::-webkit-scrollbar { width: 3px; }
.enzo-w-opts::-webkit-scrollbar-thumb { background: var(--pink-m); border-radius: 3px; }

.enzo-opts-list { display: flex; flex-direction: column; width: 100%; }
.enzo-obtn {
    width: 100%;
    padding: 11px 14px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: var(--white);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: all .18s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'DM Sans', sans-serif;
}
.enzo-obtn:last-child { border-bottom: none; }
.enzo-obtn:hover {
    background: var(--pink-l);
    color: var(--pink-d);
    padding-left: 18px;
}
.enzo-obtn .enzo-oi {
    font-size: 16px;
    width: 22px;
    flex-shrink: 0;
    text-align: center;
    /* Full color icons — no filter, no gray */
}
.enzo-obtn .enzo-ol {
    flex: 1;
    line-height: 1.35;
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.enzo-obtn .enzo-oprice {
    font-size: 10px;
    color: var(--pink);
    margin-left: auto;
    white-space: nowrap;
    font-weight: 600;
    padding-left: 6px;
    flex-shrink: 0;
}
.enzo-obtn:hover .enzo-oprice { color: var(--pink-d); }
.enzo-obtn .enzo-oa {
    font-size: 11px;
    color: var(--pink-m);
    flex-shrink: 0;
    transition: color .18s, transform .18s;
}
.enzo-obtn:hover .enzo-oa { color: var(--pink); transform: translateX(2px); }

/* Info bubble */
.enzo-info-bubble {
    background: var(--pink-l);
    border: 1px solid var(--pink-m);
    border-radius: var(--rs);
    padding: 10px 13px;
    font-size: 12px;
    color: var(--pink-d);
    line-height: 1.5;
}
.enzo-info-bubble strong { display: block; margin-bottom: 3px; font-size: 12.5px; color: var(--pink); }

/* Pricing strip */
.enzo-pricing-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 0 14px 8px;
}
.enzo-ptier {
    border: 1.5px solid var(--pink-m);
    border-radius: var(--rs);
    padding: 10px 6px;
    text-align: center;
    background: var(--bg-warm);
    transition: border-color .2s, box-shadow .2s;
}
.enzo-ptier:hover { border-color: var(--pink); box-shadow: 0 2px 12px rgba(233,75,138,.1); }
.enzo-ptier.best {
    border-color: var(--pink);
    background: var(--pink-l);
    box-shadow: 0 4px 16px rgba(233,75,138,.15);
}
.enzo-ptier h4 { font-size: 9px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 3px; }
.enzo-ptier .price { font-family: 'DM Serif Display', serif; font-size: 18px; color: var(--dark); }
.enzo-ptier .price span { font-size: 9px; font-weight: 400; color: var(--muted); font-family: 'DM Sans', sans-serif; }
.enzo-ptier .hrs { font-size: 9px; color: var(--muted); margin-top: 2px; }
.enzo-ptier.best h4 { color: var(--pink); }
.enzo-ptier.best .price { color: var(--pink-d); }

/* Form */
.enzo-w-form { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.enzo-w-form input {
    width: 100%; padding: 11px 13px;
    border: 1.5px solid var(--pink-m);
    border-radius: var(--rs);
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    color: var(--text); background: var(--bg-warm);
    transition: border-color .2s, box-shadow .2s; outline: none;
}
.enzo-w-form input:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 3px rgba(233,75,138,.1);
    background: var(--white);
}
.enzo-w-form input::placeholder { color: #bbb; }
.enzo-sbtn {
    width: 100%; padding: 13px;
    background: linear-gradient(135deg, var(--pink), var(--pink-a));
    color: #fff; border: none;
    border-radius: var(--rs);
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    box-shadow: 0 4px 18px rgba(233,75,138,.3);
    transition: transform .18s, box-shadow .18s;
    letter-spacing: .1px;
}
.enzo-sbtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(233,75,138,.4);
}
.enzo-sbtn-dark {
    background: var(--dark);
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.enzo-sbtn-dark:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

/* ════════════════════════════════
   FOOTER — "Powered by Enzo"
════════════════════════════════ */
.enzo-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 8px 14px;
    background: var(--white);
    border-top: 1px solid var(--border);
    font-size: 10.5px;
    color: var(--muted);
    letter-spacing: .1px;
}
.enzo-footer a {
    color: var(--pink);
    text-decoration: none;
    font-weight: 600;
    transition: color .15s;
}
.enzo-footer a:hover { color: var(--pink-d); text-decoration: underline; }

/* ════════════════════════════════
   FLOATING WIDGET
════════════════════════════════ */
.enzo-chatbot-fab {
    position: fixed;
    bottom: 24px; right: 24px;
    width: 62px; height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1A1A1A 0%, #2a1520 45%, #E94B8A 100%);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow:
        0 8px 24px rgba(233,75,138,.38),
        0 4px 12px rgba(0,0,0,.22),
        inset 0 1px 0 rgba(255,255,255,.08);
    z-index: 99999;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.enzo-chatbot-fab:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
    box-shadow:
        0 12px 32px rgba(233,75,138,.5),
        0 6px 16px rgba(0,0,0,.25),
        inset 0 1px 0 rgba(255,255,255,.1);
}
.enzo-chatbot-fab:active { transform: scale(.97); filter: brightness(.95); }
.enzo-fab-icon { font-size: 26px; color: #ffffff; line-height: 1; font-weight: 700; }

/* Popup bubble */
.enzo-fab-popup {
    position: fixed;
    bottom: 94px; right: 24px;
    background: #ffffff;
    opacity: 1;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    padding: 12px 16px;
    border-radius: 12px 12px 4px 12px;
    box-shadow: 0 8px 30px rgba(233,75,138,.12), 0 4px 16px rgba(0,0,0,.08);
    z-index: 99999;
    max-width: 230px;
    cursor: pointer;
    animation: enzo-popIn .35s ease;
    border: 1px solid var(--pink-m);
}
.enzo-fab-popup::after {
    content: '';
    position: absolute;
    bottom: -5px; right: 24px;
    width: 10px; height: 10px;
    background: #ffffff;
    transform: rotate(45deg);
    border-right: 1px solid var(--pink-m);
    border-bottom: 1px solid var(--pink-m);
}
.enzo-fab-popup-close {
    position: absolute;
    top: -8px; left: -8px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--pink-l);
    border: 1px solid var(--pink-m);
    font-size: 12px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--pink); line-height: 1;
    transition: background .15s;
}
.enzo-fab-popup-close:hover { background: var(--pink-m); color: var(--pink-d); }
@keyframes enzo-popIn { from{opacity:0;transform:translateY(12px) scale(.93)} to{opacity:1;transform:translateY(0) scale(1)} }

.enzo-chatbot-floating {
    position: fixed;
    bottom: 96px; right: 24px;
    z-index: 99998;
    animation: enzo-slideUp .28s ease;
}
@keyframes enzo-slideUp { from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:translateY(0)} }

.enzo-hidden { display: none !important; }

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */
@media (max-height: 720px) {
    .enzo-chatbot-container {
        max-height: calc(100vh - 100px);
        height: calc(100vh - 100px);
    }
}
@media (max-height: 600px) {
    .enzo-chatbot-container {
        max-height: calc(100vh - 90px);
        height: calc(100vh - 90px);
        border-radius: 14px;
    }
    .enzo-chatbot-floating { bottom: 78px; }
    .enzo-chatbot-fab { bottom: 14px; right: 14px; width: 52px; height: 52px; }
    .enzo-fab-popup { bottom: 74px; right: 14px; }
    .enzo-w-head { padding: 11px 14px; }
}

@media (max-width: 480px) {
    /* Floating panel: centered card with side margins, above FAB */
    .enzo-chatbot-floating {
        bottom: 90px;
        right: 0;
        left: 0;
        width: 100%;
        display: flex;
        justify-content: center;
        padding: 0 16px;
        box-sizing: border-box;
    }
    /* Container: fluid width with max-width cap, fully rounded */
    .enzo-chatbot-floating .enzo-chatbot-container {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 420px !important;
        border-radius: 20px !important;
        max-height: 78vh;
        height: 78vh;
        /* Prevent any Safari overflow */
        overflow-x: hidden;
        box-sizing: border-box;
    }
    .enzo-fab-popup {
        right: 20px;
        max-width: 210px;
        font-size: 12.5px;
    }
    .enzo-chatbot-fab {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 360px) {
    .enzo-chatbot-floating {
        padding: 0 12px;
    }
    .enzo-chatbot-floating .enzo-chatbot-container {
        border-radius: 18px !important;
    }
    .enzo-bubble { font-size: 12.5px; }
    .enzo-obtn { font-size: 12px; padding: 10px 12px; }
    .enzo-qtab { font-size: 9.5px; padding: 7px 3px; }
}
