/* Wingezz AI assistant (Wingy). Standalone CSS so it works on portal + public layouts. */
.wz-ai {
    --wz-red: #e4101d;
    --wz-red-700: #b91c1c;
    --wz-red-50: #fef2f2;
    --wz-ink: #0f172a;
    --wz-muted: #64748b;
    --wz-border: #e2e8f0;
    position: fixed;
    left: 14px;
    bottom: 10px;
    z-index: 95;
    font-family: 'Cairo', ui-sans-serif, system-ui, sans-serif;
}

.wz-ai-launcher {
    position: relative;
    display: block;
    width: 78px;
    height: 86px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    transition: transform .2s ease;
    filter: drop-shadow(0 10px 14px rgba(228, 16, 29, .28));
}

.wz-ai-launcher:hover { transform: scale(1.07); }
.wz-ai-launcher:focus-visible { outline: 3px solid rgba(228, 16, 29, .35); outline-offset: 4px; border-radius: 18px; }
.wz-ai[data-open="true"] .wz-ai-launcher { transform: scale(.86); }

.wz-ai-bot { width: 100%; height: 100%; overflow: visible; }
.wz-ai-bot--mini { width: 34px; height: 38px; }

.wz-ai-launcher::before {
    content: '';
    position: absolute;
    inset: 12px 6px 14px;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 45, 58, .35) 0%, rgba(255, 45, 58, 0) 70%);
    animation: wz-ai-halo 3.2s ease-in-out infinite;
    pointer-events: none;
}

.wz-ai-float { animation: wz-ai-float 3.2s ease-in-out infinite; transform-origin: 60px 60px; }
.wz-ai-shadow { animation: wz-ai-shadow 3.2s ease-in-out infinite; transform-origin: 60px 126px; }
.wz-ai-eyes { animation: wz-ai-blink 4.6s infinite; transform-origin: 51px 58px; }
.wz-ai-plane { animation: wz-ai-rock 3.2s ease-in-out infinite; transform-origin: 60px 66px; }
.wz-ai-trails path { stroke-dasharray: 14 30; animation: wz-ai-trail 1.4s linear infinite; }
.wz-ai-trails path:nth-child(2) { animation-delay: -.5s; }
.wz-ai-trails path:nth-child(3) { animation-delay: -.9s; }
.wz-ai-launcher:hover .wz-ai-trails path { animation-duration: .6s; }
.wz-ai-bot--mini .wz-ai-float,
.wz-ai-bot--mini .wz-ai-plane { animation: none; }

@keyframes wz-ai-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes wz-ai-shadow { 0%, 100% { transform: scaleX(1); opacity: .22; } 50% { transform: scaleX(.8); opacity: .14; } }
@keyframes wz-ai-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes wz-ai-rock { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes wz-ai-trail { from { stroke-dashoffset: 44; } to { stroke-dashoffset: 0; } }
@keyframes wz-ai-halo { 0%, 100% { transform: scale(.92); opacity: .8; } 50% { transform: scale(1.06); opacity: 1; } }

.wz-ai-bubble {
    position: absolute;
    bottom: 24px;
    left: 84px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    white-space: nowrap;
    padding: 7px 14px;
    border: 1px solid rgba(228, 16, 29, .14);
    border-radius: 14px 14px 14px 4px;
    background: #fff;
    text-align: start;
    line-height: 1.3;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .14);
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity .35s ease, transform .35s ease;
    pointer-events: none;
}
.wz-ai-bubble strong { color: var(--wz-red); font-size: 13.5px; font-weight: 800; }
.wz-ai-bubble span { color: var(--wz-muted); font-size: 11.5px; font-weight: 600; }
.wz-ai-bubble.is-visible { opacity: 1; transform: translateX(0); pointer-events: auto; }
.wz-ai-launcher:hover .wz-ai-bubble.is-visible { border-color: rgba(228, 16, 29, .4); }
.wz-ai[data-open="true"] .wz-ai-bubble { display: none; }

.wz-ai-panel {
    position: absolute;
    left: 0;
    bottom: 94px;
    display: flex;
    flex-direction: column;
    width: min(370px, calc(100vw - 28px));
    height: min(560px, calc(100dvh - 130px));
    overflow: hidden;
    border: 1px solid var(--wz-border);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .35);
    transform-origin: bottom left;
    animation: wz-ai-pop .22s ease-out;
}
.wz-ai-panel[hidden] { display: none; }
@keyframes wz-ai-pop { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }

.wz-ai-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 12px 14px;
    color: #fff;
    background: linear-gradient(135deg, #ff4b55 0%, var(--wz-red) 45%, #9f0b14 100%);
}
.wz-ai-head-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: radial-gradient(circle at 35% 30%, #ffffff 0%, #fff1f2 100%);
    box-shadow: 0 4px 10px -2px rgba(90, 5, 10, .45), inset 0 -2px 0 rgba(228, 16, 29, .12);
}
.wz-ai-head-text { flex: 1; min-width: 0; line-height: 1.25; }
.wz-ai-head-text strong { display: block; font-size: 15px; }
.wz-ai-head-text span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; opacity: .9; }
.wz-ai-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .25); }
.wz-ai-icon-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    cursor: pointer;
}
.wz-ai-icon-btn:hover { background: rgba(255, 255, 255, .26); }

.wz-ai-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 12px 6px;
    background: linear-gradient(180deg, #fff7f7 0%, #f8fafc 60%);
    overscroll-behavior: contain;
}

.wz-ai-msg { display: flex; gap: 8px; margin-bottom: 10px; align-items: flex-end; }
.wz-ai-msg--user { flex-direction: row-reverse; }
.wz-ai-msg-avatar { flex: 0 0 28px; width: 28px; height: 30px; }
.wz-ai-msg-avatar .wz-ai-bot--mini { width: 28px; height: 30px; }
.wz-ai-msg-content { max-width: 84%; }
.wz-ai-text {
    padding: 9px 12px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--wz-ink);
    background: #fff;
    border: 1px solid var(--wz-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    word-break: break-word;
    white-space: pre-line;
}
.wz-ai-msg--bot .wz-ai-text { border-end-start-radius: 4px; }
.wz-ai-msg--user .wz-ai-text {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #ff3b46, var(--wz-red));
    border-end-end-radius: 4px;
}

.wz-ai-lang {
    margin-top: 4px;
    padding: 0 6px;
    border: 0;
    background: none;
    color: var(--wz-muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}
.wz-ai-lang:hover { color: var(--wz-red); }

.wz-ai-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.wz-ai-stat { padding: 8px 10px; border-radius: 12px; background: #fff; border: 1px solid var(--wz-border); }
.wz-ai-stat b { display: block; font-size: 17px; line-height: 1.2; color: var(--wz-ink); }
.wz-ai-stat span { font-size: 11px; color: var(--wz-muted); }
.wz-ai-stat--success b { color: #16a34a; }
.wz-ai-stat--danger b { color: var(--wz-red); }
.wz-ai-stat--warning b { color: #d97706; }

.wz-ai-bars { margin-top: 8px; padding: 10px; border-radius: 12px; background: #fff; border: 1px solid var(--wz-border); }
.wz-ai-bars-title { margin-bottom: 6px; font-size: 11.5px; font-weight: 700; color: var(--wz-muted); }
.wz-ai-bar { margin-bottom: 7px; font-size: 12px; }
.wz-ai-bar:last-child { margin-bottom: 0; }
.wz-ai-bar-row { display: flex; justify-content: space-between; gap: 8px; color: var(--wz-ink); }
.wz-ai-bar-row b { flex: 0 0 auto; }
.wz-ai-bar-track { height: 6px; margin-top: 3px; border-radius: 99px; background: var(--wz-red-50); overflow: hidden; }
.wz-ai-bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ff6b73, var(--wz-red)); }

.wz-ai-list { margin: 8px 0 0; padding: 0; list-style: none; }
.wz-ai-list li {
    margin-bottom: 5px;
    padding: 7px 10px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--wz-border);
    font-size: 12.5px;
    line-height: 1.5;
}
.wz-ai-steps { counter-reset: wz-step; }
.wz-ai-steps li { position: relative; padding-inline-start: 34px; counter-increment: wz-step; }
.wz-ai-steps li::before {
    content: counter(wz-step);
    position: absolute;
    inset-inline-start: 8px;
    top: 7px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: var(--wz-red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
}
.wz-ai-ticket { display: grid; gap: 7px; margin-top: 8px; padding: 10px; border: 1px solid var(--wz-border); border-radius: 12px; background: #fff; }
.wz-ai-ticket-field {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--wz-border);
    border-radius: 9px;
    background: #fff;
    color: var(--wz-ink);
    font: inherit;
    font-size: 12.5px;
    resize: vertical;
}
.wz-ai-ticket-field:focus { outline: none; border-color: var(--wz-red); box-shadow: 0 0 0 3px rgba(228, 16, 29, .12); }
.wz-ai-ticket-send {
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: var(--wz-red);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.wz-ai-ticket-send:disabled, .wz-ai-ticket-field:disabled { opacity: .6; cursor: default; }
.wz-ai-ticket-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.wz-ai-ticket-edit[hidden] { display: none; }
.wz-ai-ticket-edit-item { display: grid; gap: 3px; font-size: 11px; font-weight: 600; color: var(--wz-muted); }
.wz-ai-ticket-status:empty { display: none; }
.wz-ai-ticket-status { font-size: 12px; font-weight: 600; }
.wz-ai-ticket-status.is-ok { color: #15803d; }
.wz-ai-ticket-status.is-error { color: var(--wz-red-700); }
.wz-ai-list a { color: var(--wz-ink); text-decoration: none; }
.wz-ai-list a:hover { color: var(--wz-red); }

.wz-ai-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wz-ai-links a {
    padding: 5px 11px;
    border-radius: 99px;
    border: 1px solid rgba(228, 16, 29, .35);
    color: var(--wz-red);
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.wz-ai-links a:hover { background: var(--wz-red-50); }

.wz-ai-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.wz-ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: #f87171; animation: wz-ai-typing 1s infinite ease-in-out; }
.wz-ai-typing i:nth-child(2) { animation-delay: .15s; }
.wz-ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes wz-ai-typing { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }

.wz-ai-suggestions { display: flex; gap: 6px; padding: 6px 12px; overflow-x: auto; scrollbar-width: none; }
.wz-ai-suggestions::-webkit-scrollbar { display: none; }
.wz-ai-suggestions:empty { display: none; }
.wz-ai-chip {
    flex: 0 0 auto;
    padding: 5px 11px;
    border-radius: 99px;
    border: 1px solid var(--wz-border);
    background: #fff;
    color: var(--wz-ink);
    font-size: 12px;
    cursor: pointer;
}
.wz-ai-chip:hover { border-color: var(--wz-red); color: var(--wz-red); }

.wz-ai-form { display: flex; gap: 8px; padding: 8px 12px 6px; border-top: 1px solid var(--wz-border); }
.wz-ai-input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--wz-border);
    border-radius: 14px;
    background: #f8fafc;
    color: var(--wz-ink);
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
}
.wz-ai-input:focus { border-color: var(--wz-red); background: #fff; box-shadow: 0 0 0 3px rgba(228, 16, 29, .12); }
.wz-ai-send {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #ff3b46, var(--wz-red));
    box-shadow: 0 6px 14px -4px rgba(228, 16, 29, .55);
    cursor: pointer;
}
.wz-ai[dir="rtl"] .wz-ai-send i { transform: scaleX(-1); }
.wz-ai-send:disabled { opacity: .55; cursor: default; }

.wz-ai-live {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 4px 12px 12px;
    height: 38px;
    border: 1px dashed rgba(228, 16, 29, .45);
    border-radius: 12px;
    background: var(--wz-red-50);
    color: var(--wz-red-700);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}
.wz-ai-live:hover { background: #fee2e2; }

@media (max-width: 480px) {
    .wz-ai { left: 8px; bottom: 6px; }
    .wz-ai-launcher { width: 64px; height: 72px; }
    .wz-ai-bubble { left: 68px; bottom: 20px; padding: 5px 11px; }
    .wz-ai-panel {
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: 84px;
        width: auto;
        height: calc(100dvh - 100px);
    }
}

@media (max-height: 640px) {
    .wz-ai-panel { bottom: 0; height: calc(100dvh - 20px); }
    .wz-ai[data-open="true"] .wz-ai-launcher { display: none; }
    .wz-ai-suggestions { padding-block: 4px; }
    .wz-ai-live { margin-bottom: 8px; height: 34px; }
}
@media (max-height: 640px) and (max-width: 480px) {
    .wz-ai-panel { top: 8px; bottom: 8px; height: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .wz-ai-float, .wz-ai-shadow, .wz-ai-eyes, .wz-ai-plane, .wz-ai-trails path, .wz-ai-launcher::before { animation: none; }
}

@media print { .wz-ai { display: none !important; } }
