/* DressMe FAQ assistant - see templates/includes/chat_widget.html and js/chat.js */
.dmc {
    --dmc-teal: #13a794;
    --dmc-teal-dark: #0e8778;
    --dmc-ink: #141414;
    --dmc-paper: #faf8f5;
    --dmc-line: #e7e2da;
    --dmc-muted: #8d877e;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.dmc [hidden] {
    display: none !important;
}

/* ---------- launcher (left of the WhatsApp bubble, which keeps right: 30px) ---------- */
.dmc-launcher {
    position: fixed;
    right: 104px;
    bottom: 30px;
    z-index: 10000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid rgba(19, 167, 148, 0.65);
    background: radial-gradient(circle at 30% 25%, #2a2a2a 0%, #0b0b0b 70%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 4px rgba(19, 167, 148, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    padding: 0;
}

.dmc-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 0 6px rgba(19, 167, 148, 0.18);
}

.dmc-launcher:focus-visible,
.dmc-chip:focus-visible,
.dmc-action:focus-visible,
.dmc-icon-btn:focus-visible,
.dmc-send:focus-visible {
    outline: 2px solid var(--dmc-teal);
    outline-offset: 2px;
}

.dmc-launcher svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dmc-icon-dress .dmc-icon-soft {
    stroke: var(--dmc-teal);
}

.dmc-icon-close {
    display: none;
    width: 22px !important;
    height: 22px !important;
    stroke-width: 1.8 !important;
}

.dmc.is-open .dmc-icon-dress,
.dmc.is-open .dmc-spark {
    display: none;
}

.dmc.is-open .dmc-icon-close {
    display: block;
}

/* small four-point sparkle */
.dmc-spark {
    position: absolute;
    top: 9px;
    right: 10px;
    width: 9px;
    height: 9px;
    background: var(--dmc-teal);
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
    animation: dmc-twinkle 3.2s ease-in-out infinite;
}

@keyframes dmc-twinkle {
    0%, 100% { transform: scale(0.8); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
}

/* ---------- teaser ---------- */
.dmc-teaser {
    position: fixed;
    right: 176px;
    bottom: 42px;
    z-index: 10000;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 30px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
    animation: dmc-rise 0.35s ease-out;
}

.dmc-teaser-text {
    border: 0;
    background: none;
    padding: 9px 4px 9px 16px;
    font-size: 0.85rem;
    color: var(--dmc-ink);
    cursor: pointer;
    white-space: nowrap;
}

.dmc-teaser-close {
    border: 0;
    background: none;
    color: var(--dmc-muted);
    font-size: 1.1rem;
    line-height: 1;
    padding: 6px 12px 6px 6px;
    cursor: pointer;
}

/* ---------- panel ---------- */
.dmc-panel {
    position: fixed;
    right: 30px;
    bottom: 104px;
    z-index: 10001;
    width: 380px;
    height: min(620px, calc(100vh - 140px));
    display: flex;
    flex-direction: column;
    background: var(--dmc-paper);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    animation: dmc-rise 0.3s ease-out;
}

@keyframes dmc-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.dmc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 14px 16px;
    background: linear-gradient(135deg, #0b0b0b 0%, #1d1d1d 100%);
    color: #fff;
    border-bottom: 1px solid rgba(19, 167, 148, 0.35);
}

.dmc-avatar {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(19, 167, 148, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
}

.dmc-avatar svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #fff;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dmc-title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.dmc-title strong {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.3px;
}

.dmc-title span {
    font-size: 0.75rem;
    color: #b9b9b9;
}

.dmc-online {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--dmc-teal);
    box-shadow: 0 0 0 3px rgba(19, 167, 148, 0.25);
}

.dmc-icon-btn {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.15rem;
    transition: background 0.2s;
    padding: 0;
}

.dmc-icon-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.dmc-wa-btn {
    color: #25d366;
}

.dmc-icon-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* ---------- conversation ---------- */
.dmc-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}

.dmc-row {
    display: flex;
    animation: dmc-rise 0.25s ease-out;
}

.dmc-row-user {
    justify-content: flex-end;
}

.dmc-bubble {
    max-width: 86%;
    padding: 10px 14px;
    font-size: 0.9rem;
    line-height: 1.45;
    white-space: pre-line;
    word-wrap: break-word;
}

.dmc-bubble-bot {
    background: #fff;
    color: #2a2a2a;
    border: 1px solid var(--dmc-line);
    border-radius: 4px 16px 16px 16px;
}

.dmc-bubble-user {
    background: var(--dmc-ink);
    color: #fff;
    border-radius: 16px 4px 16px 16px;
}

.dmc-typing {
    display: flex;
    gap: 5px;
    padding: 14px 16px;
}

.dmc-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #b5ada2;
    animation: dmc-dot 1.1s infinite ease-in-out;
}

.dmc-typing span:nth-child(2) { animation-delay: 0.15s; }
.dmc-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dmc-dot {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40% { transform: translateY(-4px); opacity: 1; }
}

/* links: WhatsApp, booking, maps, catalogs */
.dmc-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 86%;
    animation: dmc-rise 0.3s ease-out;
}

.dmc-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--dmc-line);
    background: #fff;
    color: var(--dmc-ink) !important;
    text-decoration: none !important;
    font-size: 0.86rem;
    font-weight: 500;
    transition: border-color 0.2s, transform 0.2s;
}

.dmc-action:hover {
    border-color: var(--dmc-teal);
    transform: translateX(2px);
}

.dmc-action i {
    width: 16px;
    text-align: center;
    color: var(--dmc-teal);
}

.dmc-action-whatsapp i {
    color: #25d366;
    font-size: 1.05rem;
}

.dmc-action-primary {
    background: var(--dmc-teal);
    border-color: var(--dmc-teal);
    color: #fff !important;
    font-weight: 600;
}

.dmc-action-primary i {
    color: #fff;
}

.dmc-action-primary:hover {
    background: var(--dmc-teal-dark);
    border-color: var(--dmc-teal-dark);
}

/* quick replies */
.dmc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 2px 0 6px;
    animation: dmc-rise 0.3s ease-out;
}

.dmc-chip {
    border: 1px solid #d8d1c6;
    background: transparent;
    color: #3a3a3a;
    border-radius: 18px;
    padding: 7px 13px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.dmc-chip:hover {
    border-color: var(--dmc-teal);
    color: var(--dmc-teal-dark);
    background: rgba(19, 167, 148, 0.06);
}

/* ---------- input ---------- */
.dmc-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--dmc-line);
    background: #fff;
    margin: 0;
}

.dmc-input {
    flex: 1;
    min-width: 0;
    border: 1px solid transparent;
    background: #f3efe9;
    border-radius: 22px;
    padding: 11px 16px;
    font-size: 16px; /* 16px avoids the iPhone zoom on focus */
    color: var(--dmc-ink);
    outline: none;
    font-family: inherit;
}

.dmc-input:focus {
    border-color: rgba(19, 167, 148, 0.5);
    background: #fff;
}

.dmc-send {
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 0;
    background: var(--dmc-teal);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.dmc-send:hover {
    background: var(--dmc-teal-dark);
}

.dmc-send svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.dmc-note {
    margin: 0;
    padding: 0 12px 10px;
    background: #fff;
    text-align: center;
    font-size: 0.68rem;
    color: var(--dmc-muted);
    letter-spacing: 0.2px;
}

/* ---------- phones: full-screen conversation ---------- */
@media (max-width: 767px) {
    .dmc-launcher {
        right: 102px;
        bottom: 33px;
        width: 54px;
        height: 54px;
    }

    /* above both bubbles, clear of the back button */
    .dmc-teaser {
        right: 30px;
        bottom: 104px;
    }

    .dmc-panel {
        inset: 0;
        width: 100%;
        height: 100%;
        height: 100dvh;
        border-radius: 0;
        border: 0;
    }

    .dmc.is-open .dmc-launcher {
        display: none;
    }

    .dmc-header {
        padding-top: max(14px, env(safe-area-inset-top));
    }

    .dmc-note {
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .dmc-bubble,
    .dmc-actions {
        max-width: 92%;
    }
}

html.dmc-lock,
html.dmc-lock body {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .dmc *,
    .dmc *::before {
        animation: none !important;
        transition: none !important;
    }
}
