/* ════════════════════════════════════════════
   BAY ARLO — maskot asistan
   ════════════════════════════════════════════ */

/* ── İlk giriş tanışma ── */
.arlo-intro {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .55s cubic-bezier(.65,.05,0,1), visibility 0s .55s;
}
.arlo-intro.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity .55s cubic-bezier(.65,.05,0,1), visibility 0s;
}
.arlo-intro.is-leaving {
    opacity: 0;
    transition: opacity .5s cubic-bezier(.65,.05,0,1);
}

.arlo-intro__bg {
    position: absolute;
    inset: 0;
    background: rgba(11, 12, 14, .72);
    backdrop-filter: blur(14px) saturate(1.1);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
}
[data-theme="light"] .arlo-intro__bg {
    background: rgba(241, 240, 236, .82);
}

.arlo-intro__card {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    transform: translateY(22px) scale(.94);
    opacity: 0;
    transition: transform .65s cubic-bezier(.22, 1, .36, 1), opacity .55s ease;
}
.arlo-intro.is-visible .arlo-intro__card {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.arlo-intro.is-leaving .arlo-intro__card {
    transform: translateY(18px) scale(.96);
    opacity: 0;
    transition: transform .45s ease, opacity .4s ease;
}

.arlo-intro__mascot {
    width: min(240px, 58vw);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .28));
    animation: arloFloat 3.2s ease-in-out infinite;
}
.arlo-intro__img {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    pointer-events: none;
    transition: opacity .28s ease, transform .35s cubic-bezier(.22, 1, .36, 1), filter .3s ease;
}
.arlo-intro__img.is-swap-out {
    opacity: 0;
    transform: scale(.9) translateY(6px);
    filter: blur(2px);
}
.arlo-intro__img.is-swap-in {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
    animation: arloPosePop .55s cubic-bezier(.22, 1, .36, 1);
}
@keyframes arloFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes arloPosePop {
    0% { transform: scale(.92) translateY(8px); opacity: .6; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.arlo-intro__bubble {
    width: 100%;
    padding: 18px 20px 20px;
    border-radius: 20px;
    background: var(--bg-raise, #17181c);
    border: 1px solid var(--line, rgba(255,255,255,.09));
    box-shadow: 0 20px 50px rgba(0, 0, 0, .22);
}
[data-theme="light"] .arlo-intro__bubble {
    background: #fff;
    box-shadow: 0 18px 48px rgba(20, 24, 30, .1);
}

.arlo-intro__name {
    margin: 0 0 10px;
    font-family: var(--font-display, system-ui, sans-serif);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent, #c8f031);
}

.arlo-intro__typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 2px;
}
.arlo-intro__typing[hidden] { display: none; }
.arlo-intro__typing i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ink-dim, #c6cac1);
    animation: arloDot 1.2s ease-in-out infinite;
}
.arlo-intro__typing i:nth-child(2) { animation-delay: .15s; }
.arlo-intro__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes arloDot {
    0%, 80%, 100% { opacity: .35; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

.arlo-intro__text {
    margin: 0;
    min-height: 1.4em;
    font-family: var(--font-body, system-ui, sans-serif);
    font-size: 15.5px;
    font-weight: 500;
    line-height: 1.55;
    color: var(--ink, #f4f5f1);
    letter-spacing: -.01em;
}
.arlo-intro__text:empty { display: none; }
.arlo-intro__text .arlo-cursor {
    display: inline-block;
    width: 2px;
    height: .95em;
    margin-left: 2px;
    vertical-align: -2px;
    background: var(--accent, #c8f031);
    animation: arloBlink .85s step-end infinite;
}
@keyframes arloBlink {
    50% { opacity: 0; }
}

.arlo-intro__skip {
    margin-top: 4px;
    padding: 12px 22px;
    border: 0;
    border-radius: 999px;
    background: var(--accent, #c8f031);
    color: var(--accent-ink, #0b0c0e);
    font-family: var(--font-display, system-ui, sans-serif);
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--accent, #c8f031) 28%, transparent);
    transition: transform .25s cubic-bezier(.22, 1, .36, 1), box-shadow .25s, filter .2s;
}
.arlo-intro__skip:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 12px 28px color-mix(in srgb, var(--accent, #c8f031) 35%, transparent);
}
.arlo-intro__skip:active { transform: translateY(0); }

/* ── Widget kabuğu ── */
.arlo-widget {
    position: fixed;
    right: 20px;
    left: auto;
    bottom: 22px;
    z-index: 170;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
}
.arlo-widget > * { pointer-events: auto; }

/* Çerez bandı açıkken yukarı kaydır */
.has-consent .arlo-widget { bottom: 118px; }
@media (max-width: 640px) {
    .has-consent .arlo-widget { bottom: 148px; }
}

/* ── FAB ── */
.arlo-fab {
    position: relative;
    width: 76px;
    height: 76px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    opacity: 0;
    transform: translateY(16px) scale(.86);
    transition: opacity .5s cubic-bezier(.22, 1, .36, 1), transform .55s cubic-bezier(.22, 1, .36, 1);
}
.arlo-fab:not([hidden]) {
    display: block;
}
.arlo-fab.is-ready {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.arlo-fab:hover { transform: translateY(-3px) scale(1.04); }
.arlo-fab:focus-visible {
    outline: 2px solid var(--accent, #c8f031);
    outline-offset: 4px;
}

.arlo-fab__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .28));
    user-select: none;
    pointer-events: none;
}

/* Yeşil çevrimiçi — görselin sağ üstü */
.arlo-fab__online {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #22c55e;
    border: 2.5px solid var(--bg, #0b0c0e);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .55);
    animation: arloPulse 2.2s ease-out infinite;
}
[data-theme="light"] .arlo-fab__online {
    border-color: #f1f0ec;
}
@keyframes arloPulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.arlo-fab__ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--accent, #c8f031) 45%, transparent);
    opacity: 0;
    animation: arloRing 2.8s ease-out infinite;
    pointer-events: none;
}
.arlo-widget.is-open .arlo-fab__ring { animation: none; opacity: 0; }
@keyframes arloRing {
    0% { transform: scale(.85); opacity: .7; }
    100% { transform: scale(1.25); opacity: 0; }
}

.arlo-fab__tip {
    position: absolute;
    right: calc(100% + 10px);
    left: auto;
    top: 50%;
    transform: translateY(-50%) translateX(4px);
    padding: 7px 11px;
    border-radius: 10px;
    background: var(--bg-raise, #17181c);
    border: 1px solid var(--line, rgba(255,255,255,.1));
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    font-family: var(--font-display, system-ui, sans-serif);
    font-size: 12.5px;
    font-weight: 650;
    color: var(--ink, #f4f5f1);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .3s cubic-bezier(.22, 1, .36, 1);
}
.arlo-fab:hover .arlo-fab__tip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}
.arlo-widget.is-open .arlo-fab__tip { opacity: 0; }

/* ── Sohbet paneli ── */
.arlo-panel {
    width: min(400px, calc(100vw - 28px));
    height: min(560px, calc(100vh - 110px));
    max-height: min(560px, calc(100vh - 110px));
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    overflow: hidden;
    background: var(--bg-raise, #17181c);
    border: 1px solid var(--line, rgba(255,255,255,.09));
    box-shadow: 0 24px 60px rgba(0, 0, 0, .32);
    opacity: 0;
    visibility: hidden;
    transform: translateY(18px) scale(.96);
    transform-origin: bottom right;
    transition:
        opacity .4s cubic-bezier(.22, 1, .36, 1),
        transform .45s cubic-bezier(.22, 1, .36, 1),
        visibility 0s .4s;
}
.arlo-widget.is-open .arlo-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition:
        opacity .4s cubic-bezier(.22, 1, .36, 1),
        transform .45s cubic-bezier(.22, 1, .36, 1),
        visibility 0s;
}
[data-theme="light"] .arlo-panel {
    background: #fff;
    box-shadow: 0 20px 50px rgba(20, 24, 30, .14);
}

/* Kompakt header — yazma alanı için yer aç */
.arlo-panel__head {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 48px 12px 12px;
    background:
        radial-gradient(120% 100% at 100% 0%, color-mix(in srgb, var(--accent, #c8f031) 14%, transparent), transparent 55%),
        color-mix(in srgb, var(--bg-soft, #121316) 80%, var(--bg-raise, #17181c));
    border-bottom: 1px solid var(--line, rgba(255,255,255,.08));
}
[data-theme="light"] .arlo-panel__head {
    background:
        radial-gradient(120% 100% at 100% 0%, color-mix(in srgb, var(--accent, #c8f031) 12%, transparent), transparent 55%),
        #f7f6f2;
}

.arlo-panel__avatar {
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,.15));
    user-select: none;
    pointer-events: none;
}

.arlo-panel__meta {
    position: relative;
    min-width: 0;
    flex: 1;
    padding: 0;
}
.arlo-panel__identity {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.arlo-panel__identity strong {
    font-family: var(--font-display, system-ui, sans-serif);
    font-size: 16px;
    font-weight: 700;
    color: var(--ink, #f4f5f1);
    letter-spacing: -.02em;
}
.arlo-panel__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 650;
    color: #22c55e;
}
.arlo-panel__status i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .2);
}
.arlo-panel__tagline {
    margin: 3px 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: var(--ink-dim, #c6cac1);
}

.arlo-panel__close {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line, rgba(255,255,255,.1));
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg-raise, #17181c) 60%, transparent);
    color: var(--ink-dim, #c6cac1);
    cursor: pointer;
    transition: color .2s, border-color .2s, background .2s;
}
.arlo-panel__close svg { width: 15px; height: 15px; }
.arlo-panel__close:hover {
    color: var(--ink, #f4f5f1);
    border-color: var(--accent, #c8f031);
}

.arlo-panel__body {
    flex: 1 1 auto;
    min-height: 0; /* flex çocukta scroll için şart */
    overflow-x: hidden;
    overflow-y: auto;
    padding: 14px 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: color-mix(in srgb, var(--bg-soft, #121316) 35%, transparent);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.arlo-msg {
    max-width: 92%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
}
.arlo-msg p { margin: 0; white-space: pre-wrap; }
.arlo-msg p + p { margin-top: 8px; }
.arlo-msg--bot {
    align-self: flex-start;
    background: var(--bg-raise, #17181c);
    border: 1px solid var(--line, rgba(255,255,255,.08));
    color: var(--ink, #f4f5f1);
    border-bottom-left-radius: 5px;
}
[data-theme="light"] .arlo-msg--bot {
    background: #fff;
}
.arlo-msg--user {
    align-self: flex-end;
    background: color-mix(in srgb, var(--accent, #c8f031) 18%, var(--bg-raise, #17181c));
    border: 1px solid color-mix(in srgb, var(--accent, #c8f031) 30%, var(--line, rgba(255,255,255,.08)));
    color: var(--ink, #f4f5f1);
    border-bottom-right-radius: 5px;
}
.arlo-msg--error {
    align-self: stretch;
    max-width: 100%;
    background: color-mix(in srgb, #ef4444 12%, var(--bg-raise, #17181c));
    border-color: color-mix(in srgb, #ef4444 35%, var(--line, rgba(255,255,255,.08)));
    color: var(--ink, #f4f5f1);
    font-size: 13px;
}

.arlo-msg__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.arlo-msg__action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    font-family: var(--font-display, system-ui, sans-serif);
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .2s, filter .2s;
}
.arlo-msg__action--wa {
    background: #25d366;
    color: #072816;
}
.arlo-msg__action--phone {
    background: color-mix(in srgb, var(--accent, #c8f031) 90%, #fff);
    color: var(--accent-ink, #0b0c0e);
}
.arlo-msg__action:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.arlo-typing-row {
    align-self: flex-start;
    display: inline-flex;
    gap: 5px;
    padding: 12px 14px;
    border-radius: 14px;
    border-bottom-left-radius: 5px;
    background: var(--bg-raise, #17181c);
    border: 1px solid var(--line, rgba(255,255,255,.08));
}
.arlo-typing-row i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ink-dim, #c6cac1);
    animation: arloDot 1.1s ease-in-out infinite;
}
.arlo-typing-row i:nth-child(2) { animation-delay: .15s; }
.arlo-typing-row i:nth-child(3) { animation-delay: .3s; }

/* Yazma alanı her zaman altta görünür */
.arlo-panel__compose {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 12px 10px;
    border-top: 1px solid var(--line, rgba(255,255,255,.1));
    background: var(--bg-raise, #17181c);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .12);
}
[data-theme="light"] .arlo-panel__compose {
    background: #fff;
    box-shadow: 0 -6px 18px rgba(20, 24, 30, .06);
}
.arlo-panel__compose textarea {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    max-height: 110px;
    resize: none;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1.5px solid color-mix(in srgb, var(--accent, #c8f031) 28%, var(--line, rgba(255,255,255,.14)));
    background: var(--bg-soft, #121316);
    color: var(--ink, #f4f5f1);
    font-family: var(--font-body, system-ui, sans-serif);
    font-size: 15px;
    line-height: 1.4;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .2s, box-shadow .2s;
}
[data-theme="light"] .arlo-panel__compose textarea {
    background: #f4f3ef;
    color: #14161a;
}
.arlo-panel__compose textarea:focus {
    border-color: var(--accent, #c8f031);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #c8f031) 22%, transparent);
}
.arlo-panel__compose textarea::placeholder {
    color: var(--muted, #949aa0);
    opacity: 1;
}
.arlo-panel__send {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 14px;
    background: var(--accent, #c8f031);
    color: var(--accent-ink, #0b0c0e);
    cursor: pointer;
    transition: transform .2s, filter .2s, opacity .2s;
}
.arlo-panel__send svg { width: 18px; height: 18px; }
.arlo-panel__send:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }
.arlo-panel__send:disabled { opacity: .45; cursor: not-allowed; }

.arlo-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.arlo-panel__foot {
    flex: 0 0 auto;
    padding: 6px 16px 9px;
    border-top: 0;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .04em;
    color: var(--muted, #949aa0);
    text-align: center;
    background: var(--bg-raise, #17181c);
}
[data-theme="light"] .arlo-panel__foot {
    background: #fff;
}

/* Mobil */
@media (max-width: 480px) {
    .arlo-widget {
        right: 14px;
        left: auto;
        bottom: 16px;
    }
    .arlo-fab {
        width: 68px;
        height: 68px;
    }
    .arlo-fab__online {
        width: 14px;
        height: 14px;
        top: 3px;
        right: 4px;
    }
    .arlo-fab__tip { display: none; }
    .arlo-panel {
        width: min(100vw - 28px, 400px);
        height: min(72vh, 540px);
        max-height: min(72vh, 540px);
    }
    .arlo-panel__compose {
        padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
    }
    .arlo-intro__mascot { width: min(200px, 52vw); }
    .arlo-intro__text { font-size: 14.5px; }
}

/* Intro açıkken arka plan kaymasın */
html.arlo-intro-lock,
html.arlo-intro-lock body {
    overflow: hidden;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .arlo-intro,
    .arlo-intro__card,
    .arlo-fab,
    .arlo-panel,
    .arlo-intro__mascot,
    .arlo-fab__ring,
    .arlo-fab__online {
        animation: none !important;
        transition-duration: .01ms !important;
    }
}
