/* ===== MIDOMEDIA TYPEBOT WIDGET ===== */

#midomedia-chatbot-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.midomedia-chat-bubble {
    position: fixed;
    right: 20px;
    bottom: 20px;
    min-width: 182px;
    height: 56px;
    border: none;
    border-radius: 999px;
    padding: 0 9px 0 17px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.2) 0, transparent 36%),
        linear-gradient(135deg, #111827 0%, #27235c 52%, #6a00f4 100%);
    box-shadow: 0 10px 30px rgba(42, 24, 95, 0.34);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 999;
}

.midomedia-chat-bubble:hover {
    transform: translateY(-1px) scale(1.06);
    box-shadow: 0 14px 34px rgba(42, 24, 95, 0.42);
}

.midomedia-chat-bubble:active {
    transform: scale(0.95);
}

.bubble-label {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
}

.bubble-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.midomedia-chat-bubble .chat-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.midomedia-chat-bubble .bubble-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #ff6b6b;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.18);
    }
}

.midomedia-chat-window {
    position: fixed;
    right: 20px;
    bottom: 92px;
    width: 390px;
    height: min(680px, 82vh);
    background: linear-gradient(180deg, #ffffff 0%, #f6f8ff 100%);
    border-radius: 20px;
    border: 1px solid rgba(120, 133, 190, 0.2);
    box-shadow: 0 24px 60px rgba(17, 24, 39, 0.22);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 998;
    animation: chat-slide-up 0.25s ease;
}

.midomedia-chat-window[hidden] {
    display: none !important;
}

@keyframes chat-slide-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.22) 0, transparent 30%),
        linear-gradient(135deg, #111827 0%, #2c2466 55%, #5b2eea 100%);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.chat-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.chat-brand-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8fd3ff 0%, #ffffff 100%);
    box-shadow: 0 0 18px rgba(143, 211, 255, 0.75);
}

.chat-header-text {
    flex: 1;
    min-width: 0;
}

.chat-header-text h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.chat-header-text p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.86;
}

.chat-status-pill {
    display: inline-flex;
    margin-top: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f8fbff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.close-btn {
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.18s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.close-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.25;
}

.chat-body {
    flex: 1;
    min-height: 0;
    background:
        radial-gradient(circle at top right, rgba(103, 116, 247, 0.08) 0, transparent 30%),
        linear-gradient(180deg, #f8faff 0%, #eef3ff 100%);
}

.typebot-shell {
    width: 100%;
    height: 100%;
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(246, 248, 255, 0.96) 100%);
}

.typebot-shell-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 8%, rgba(124, 92, 255, 0.12) 0, transparent 26%),
        radial-gradient(circle at 86% 0%, rgba(89, 199, 255, 0.12) 0, transparent 24%);
    z-index: 0;
}

.typebot-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(248, 250, 255, 0.9);
    z-index: 2;
}

.typebot-loader.is-visible {
    display: flex;
}

.typebot-loader::before {
    content: "";
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(106, 0, 244, 0.18);
    border-top-color: #6a00f4;
    animation: typebot-spin 0.8s linear infinite;
}

@keyframes typebot-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.typebot-standard-host {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    background: transparent;
}

.typebot-standard-host::part(container) {
    background: transparent;
}

.typebot-standard-host::part(iframe) {
    border: 0;
    border-radius: 0 0 20px 20px;
}

/* Hide Typebot branding badge in host when exposed through parts/selectors. */
.typebot-standard-host::part(branding),
.typebot-standard-host::part(powered-by),
.typebot-standard-host::part(footer),
.typebot-standard-host::part(made-with-typebot) {
    display: none !important;
    visibility: hidden !important;
}

.typebot-standard-host a[href*='typebot.com'],
.typebot-standard-host a[href*='typebot.io'] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.chat-fallback {
    height: 100%;
    padding: 22px;
    overflow-y: auto;
    color: #1f2740;
    background:
        radial-gradient(circle at top right, rgba(104, 96, 255, 0.12) 0, transparent 28%),
        linear-gradient(180deg, #fff 0%, #f6f8ff 100%);
}

.chat-fallback h4 {
    margin: 0 0 8px;
    font-size: 16px;
}

.chat-fallback p {
    margin: 0 0 8px;
    line-height: 1.45;
    color: #36405e;
}

.chat-fallback ul {
    margin: 0 0 14px;
    padding-left: 20px;
    color: #3a4668;
    font-size: 14px;
}

.chat-fallback-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.chat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid #dbe1f2;
    background: rgba(255, 255, 255, 0.92);
    color: #1f2740;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(63, 77, 120, 0.08);
}

.chat-btn.secondary:hover {
    border-color: #a7b2d7;
    background: #f4f7ff;
}

@media (max-width: 768px) {
    .midomedia-chat-bubble {
        right: 14px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 84px);
    }

    .midomedia-chat-window {
        width: min(360px, calc(100vw - 20px));
        height: min(460px, calc(100dvh - 170px));
        right: 10px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 152px);
        border-radius: 14px;
    }
}

@media (max-width: 480px) {
    .midomedia-chat-bubble {
        padding: 0;
        width: 56px;
        min-width: 56px;
        border-radius: 50%;
        justify-content: center;
    }

    .midomedia-chat-window {
        width: calc(100vw - 20px);
        height: min(420px, calc(100dvh - 170px));
        right: 10px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 148px);
        border-radius: 12px;
    }

    .bubble-label {
        display: none;
    }

    .chat-btn {
        font-size: 12px;
        padding: 12px;
    }
}

@media (max-width: 360px) {
    .midomedia-chat-window {
        width: calc(100vw - 16px);
        right: 8px;
        height: min(390px, calc(100dvh - 164px));
    }
}
