/* MD Chat – V1.2 Görsel Katman (temiz + typing balonu) */
:root {
    --mdchat-bg: #ffffff;
    --mdchat-fg: #0f172a;
    --mdchat-soft: #f8fafc;
    --mdchat-line: #e2e8f0;
    --mdchat-brand: #2563eb;
    --mdchat-radius: 14px;
    --mdchat-shadow: 0 12px 30px rgba(2, 6, 23, .08);

    --mdchat-bot-bg: #eef2f7;
    /* bot balonu */
    --mdchat-user-bg: #2563eb;
    /* user balonu */
    --mdchat-user-fg: #fff;
}

/* Kart */
.mdchat-card {
    width: 100%;
    max-width: 640px;
    margin: 12px auto;
    background: #fff;
    color: #0f172a;
    border: 1px solid var(--mdchat-line);
    border-radius: var(--mdchat-radius);
    box-shadow: var(--mdchat-shadow);
    overflow: hidden;
}

.mdchat-close {
    display: none !important;
}

/* X kaldırıldı */

.mdchat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--mdchat-line);
}

.mdchat-title {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mdchat-title::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #22c55e, #16a34a);
    box-shadow: 0 0 0 3px color-mix(in oklab, #22c55e 20%, transparent);
}

.mdchat-body {
    padding: 10px 10px 0;
}

/* Intro */
.mdchat-intro p {
    margin: 10px 2px 12px;
    opacity: .9;
}

.mdchat-btn {
    background: var(--mdchat-brand);
    color: #fff;
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(37, 99, 235, .18);
}

.mdchat-btn:hover {
    filter: brightness(1.02);
}

.mdchat-kvkk {
    font-size: .9em;
    margin-top: 10px;
    opacity: .8;
}

.mdchat-kvkk a {
    color: #dc2626;
    text-decoration: none;
}

/* Lead */
.mdchat-lead label {
    display: block;
    margin: 8px 0;
}

.mdchat-lead input[type="text"],
.mdchat-lead input[type="tel"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--mdchat-line);
    background: #fff;
    outline: 2px solid transparent;
}

.mdchat-lead input:focus {
    outline-color: color-mix(in oklab, var(--mdchat-brand) 30%, transparent);
}

.mdchat-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .95em;
    margin: 8px 0 4px;
}

/* Chat */
.mdchat-chat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mdchat-log {
    background: #f8fafc;
    border: 1px solid var(--mdchat-line);
    border-radius: 12px;
    padding: 12px;
    max-height: 60vh;
    overflow: auto;
    display: flex;
    flex-direction: column;
    /* typing + balon akışı */
}

/* Mesaj balonları */
.mdchat-msg {
    display: inline-block;
    max-width: 85%;
    padding: 10px 12px;
    border-radius: 14px;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 6px 0;
    /* ← balonlar arası boşluk */
}

.mdchat-msg.bot {
    align-self: flex-start;
    background: var(--mdchat-bot-bg);
    border: 1px solid var(--mdchat-line);
    color: #0f172a;
}

.mdchat-msg.user {
    align-self: flex-end;
    background: var(--mdchat-user-bg);
    color: var(--mdchat-user-fg);
}

.mdchat-msg.appear {
    animation: mdchat-pop .18s ease-out;
}

@keyframes mdchat-pop {
    from {
        transform: translateY(6px);
        opacity: 0
    }

    to {
        transform: none;
        opacity: 1
    }
}

/* Düşünüyor (typing) – gerçek bot balonu gibi */
.mdchat-msg.typing {
    align-self: flex-start;
    background: var(--mdchat-bot-bg);
    border: 1px solid var(--mdchat-line);
    color: #0f172a;
}

.mdchat-msg.typing .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 2px;
    border-radius: 50%;
    background: #94a3b8;
    opacity: .6;
    animation: mdchat-dot 1s ease-in-out infinite;
}

.mdchat-msg.typing .dot:nth-child(2) {
    animation-delay: .18s;
}

.mdchat-msg.typing .dot:nth-child(3) {
    animation-delay: .36s;
}

@keyframes mdchat-dot {

    0%,
    100% {
        transform: translateY(0);
        opacity: .35;
    }

    50% {
        transform: translateY(-3px);
        opacity: .95;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mdchat-msg.typing .dot {
        animation: none;
        opacity: .6;
    }
}

/* Input */
.mdchat-input {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--mdchat-line);
    background: #fff;
}

.mdchat-text {
    flex: 1;
    border: 1px solid var(--mdchat-line);
    background: #fff;
    border-radius: 999px;
    padding: 10px 14px;
    outline: 2px solid transparent;
}

.mdchat-text:focus {
    outline-color: color-mix(in oklab, var(--mdchat-brand) 30%, transparent);
}

.mdchat-send {
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    background: var(--mdchat-brand);
    color: #fff;
    font-weight: 600;
}

.mdchat-send:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* Mobil */
@media (max-width:480px) {
    .mdchat-card {
        max-width: none;
        border-radius: 12px;
    }

    .mdchat-log {
        max-height: 65vh;
    }
}
/* ==== OVERRIDE: Eski typing stilini tamamen sustur ==== */
.mdchat-typing .dots {
    display: none !important;
}

/* önceki sürümün nokta bloğunu gizle */

/* ==== Mesajlar arası boşluk + tutarlı satır akışı ==== */
.mdchat-log {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* <— balonlar arası boşluk */
}

/* ==== Yeni, net “düşünüyor” balonu ==== */
.mdchat-msg.typing {
    align-self: flex-start;
    background: #eef2f7 !important;
    /* gri bot balonu */
    border: 1px solid #e2e8f0 !important;
    color: #0f172a;
    border-radius: 14px;
    padding: 10px 12px;
}

.mdchat-msg.typing .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    /* biraz daha büyük ve net */
    margin: 0 3px;
    border-radius: 50%;
    background: #64748b;
    /* koyu gri-mavi */
    opacity: 1;
    animation: mdchat-pulse 1s ease-in-out infinite;
}

.mdchat-msg.typing .dot:nth-child(2) {
    animation-delay: .15s;
}

.mdchat-msg.typing .dot:nth-child(3) {
    animation-delay: .30s;
}

@keyframes mdchat-pulse {

    0%,
    80%,
    100% {
        transform: scale(.7);
        opacity: .55;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}