/* ============================================================
   AI Vision modal — Faz E frontend widget stilleri
   Tema değişkeni: --theme-primary (fallback #c0392b)
   ============================================================ */
.aiv-bd {
    position: fixed; inset: 0; z-index: 1100; display: none;
    align-items: center; justify-content: center; padding: 20px;
    background: rgba(15, 23, 42, .62); backdrop-filter: blur(3px);
    animation: aivFade .18s ease;
}
.aiv-bd.open { display: flex; }
@keyframes aivFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes aivPop { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes aivSpin { to { transform: rotate(360deg); } }
@keyframes aivBarSlide { 0% { background-position: 0 0; } 100% { background-position: 36px 0; } }

.aiv-modal {
    background: #fff; border-radius: 18px; width: 100%; max-width: 780px;
    display: flex; flex-direction: column; max-height: 92vh; overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35); animation: aivPop .24s cubic-bezier(.22,.61,.36,1);
}
.aiv-head { padding: 18px 24px; border-bottom: 1px solid #eef0f3; display: flex; align-items: center; gap: 11px; }
.aiv-head-ic {
    width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--theme-primary, #c0392b); color: #fff; flex: 0 0 auto;
}
.aiv-head-ic .material-icons { font-size: 20px; color: #fff; }
.aiv-head-txt { flex: 1; min-width: 0; }
.aiv-title { margin: 0; font-size: 1.02rem; font-weight: 700; color: #111827; line-height: 1.25; }
.aiv-sub { margin: 2px 0 0; font-size: .78rem; color: #94a3b8; }
.aiv-close {
    background: none; border: none; cursor: pointer; width: 34px; height: 34px; border-radius: 9px;
    color: #94a3b8; display: inline-flex; align-items: center; justify-content: center; transition: all .15s;
}
.aiv-close:hover { background: #f1f5f9; color: #111827; }

.aiv-body { padding: 20px 24px; overflow-y: auto; flex: 1 1 auto; }
.aiv-foot { padding: 14px 24px; border-top: 1px solid #eef0f3; background: #fafbfc; display: flex; gap: 9px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

/* Adım göstergesi */
.aiv-steps { display: flex; align-items: center; gap: 6px; margin-bottom: 18px; }
.aiv-step { display: flex; align-items: center; gap: 7px; font-size: .76rem; font-weight: 700; color: #cbd5e1; }
.aiv-step-num {
    width: 22px; height: 22px; border-radius: 50%; background: #f1f5f9; color: #94a3b8;
    display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; transition: all .25s;
}
.aiv-step.active { color: #111827; }
.aiv-step.active .aiv-step-num { background: var(--theme-primary, #c0392b); color: #fff; }
.aiv-step.done { color: #16a34a; }
.aiv-step.done .aiv-step-num { background: #16a34a; color: #fff; }
.aiv-step-line { flex: 1; height: 2px; background: #eef0f3; border-radius: 2px; }

/* İki sütun: ürün + kullanıcı görseli */
.aiv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.aiv-col-label { font-size: .74rem; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: #94a3b8; margin: 0 0 8px; }
.aiv-prod-img {
    width: 100%; height: 240px; object-fit: contain; border-radius: 12px;
    background: #f8fafc; border: 1px solid #eef0f3; padding: 8px;
}

/* Dropzone */
.aiv-drop {
    position: relative; height: 240px; border: 2px dashed #d7dde5; border-radius: 12px; background: #f8fafc;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
    cursor: pointer; text-align: center; padding: 16px; transition: all .18s; overflow: hidden;
}
.aiv-drop:hover, .aiv-drop.over { border-color: var(--theme-primary, #c0392b); background: #fff; }
.aiv-drop.over { transform: scale(1.01); }
.aiv-drop input[type=file] { display: none; }
.aiv-drop .material-icons { font-size: 34px; color: #cbd5e1; transition: color .18s; }
.aiv-drop:hover .material-icons, .aiv-drop.over .material-icons { color: var(--theme-primary, #c0392b); }
.aiv-drop-main { font-size: .86rem; font-weight: 700; color: #475569; }
.aiv-drop-hint { font-size: .74rem; color: #94a3b8; line-height: 1.5; }
.aiv-drop.has-file { border-style: solid; border-color: #bbf7d0; background: #fff; padding: 0; }
.aiv-drop-preview { width: 100%; height: 100%; object-fit: contain; }
.aiv-drop-clear {
    position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 8px; border: none;
    background: rgba(15,23,42,.65); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.aiv-drop-clear .material-icons { font-size: 16px; color: #fff; }
.aiv-drop-name {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 10px; font-size: .72rem; font-weight: 600;
    background: rgba(15,23,42,.72); color: #fff; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
}

.aiv-field { margin-top: 12px; }
.aiv-field label { display: block; font-size: .76rem; font-weight: 700; color: #475569; margin-bottom: 5px; }
.aiv-input { width: 100%; padding: 10px 13px; border: 1px solid #dde3ea; border-radius: 9px; font-size: .86rem; font-family: inherit; }
.aiv-input:focus { outline: none; border-color: var(--theme-primary, #c0392b); box-shadow: 0 0 0 3px rgba(192,57,43,.12); }
.aiv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.aiv-chip {
    border: 1px solid #e2e8f0; background: #fff; border-radius: 999px; padding: 4px 11px;
    font-size: .74rem; font-weight: 600; color: #475569; cursor: pointer; transition: all .15s;
}
.aiv-chip:hover { border-color: var(--theme-primary, #c0392b); color: var(--theme-primary, #c0392b); }

/* Butonlar */
.aiv-btn {
    border: none; border-radius: 10px; padding: 11px 20px; font-weight: 700; font-size: .86rem; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: all .16s; font-family: inherit;
    text-decoration: none;
}
.aiv-btn .material-icons { font-size: 18px; }
.aiv-btn-primary { background: var(--theme-primary, #c0392b); color: #fff; box-shadow: 0 6px 16px rgba(192,57,43,.24); }
.aiv-btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); color: #fff; }
.aiv-btn-primary:disabled { background: #cbd5e1; color: #fff; box-shadow: none; cursor: not-allowed; transform: none; filter: none; }
.aiv-btn-ghost { background: #fff; color: #475569; border: 1px solid #dde3ea; }
.aiv-btn-ghost:hover { background: #f8fafc; color: #111827; }
.aiv-btn-block { width: 100%; margin-top: 16px; padding: 13px; }

/* Uyarı satırı (native alert yerine) */
.aiv-warn {
    display: none; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 13px; border-radius: 9px;
    background: #fffbeb; border: 1px solid #fde68a; color: #78350f; font-size: .8rem; font-weight: 600;
}
.aiv-warn.show { display: flex; }
.aiv-warn .material-icons { font-size: 17px; color: #d97706; }

/* Çalışıyor ekranı */
.aiv-loading { text-align: center; padding: 26px 16px 12px; }
.aiv-spin { width: 54px; height: 54px; border: 4px solid #f1f5f9; border-top-color: var(--theme-primary, #c0392b); border-radius: 50%; animation: aivSpin .9s linear infinite; margin: 0 auto; }
.aiv-loading-txt { margin: 16px 0 4px; font-weight: 700; color: #111827; font-size: .94rem; }
.aiv-loading-sub { font-size: .78rem; color: #94a3b8; margin: 0; }
.aiv-progress { height: 7px; border-radius: 99px; background: #f1f5f9; overflow: hidden; margin: 18px auto 8px; max-width: 340px; }
.aiv-progress-bar {
    height: 100%; width: 25%; border-radius: 99px;
    background-image: linear-gradient(45deg, var(--theme-primary, #c0392b) 25%, rgba(255,255,255,.35) 25%, rgba(255,255,255,.35) 50%, var(--theme-primary, #c0392b) 50%, var(--theme-primary, #c0392b) 75%, rgba(255,255,255,.35) 75%);
    background-size: 36px 36px; animation: aivBarSlide .9s linear infinite; transition: width .6s ease;
}
.aiv-timer { font-size: .76rem; color: #94a3b8; font-variant-numeric: tabular-nums; }

/* Sonuç */
.aiv-result-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-weight: 700; color: #16a34a; font-size: .9rem; }
.aiv-result-head .material-icons { font-size: 19px; color: #16a34a; }
.aiv-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.aiv-compare figure { margin: 0; }
.aiv-compare figcaption { font-size: .72rem; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: #94a3b8; margin-bottom: 6px; text-align: center; }
.aiv-compare img { width: 100%; max-height: 46vh; object-fit: contain; border-radius: 12px; background: #f8fafc; border: 1px solid #eef0f3; }
.aiv-compare .aiv-after img { border-color: #bbf7d0; box-shadow: 0 10px 26px rgba(22,163,74,.14); }

.aiv-error {
    background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 14px 16px; border-radius: 11px;
    font-size: .85rem; display: flex; gap: 10px; align-items: flex-start;
}
.aiv-error .material-icons { font-size: 19px; color: #dc2626; }

@media (max-width: 640px) {
    .aiv-bd { padding: 0; align-items: flex-end; }
    .aiv-modal { max-width: none; border-radius: 18px 18px 0 0; max-height: 94vh; }
    .aiv-cols, .aiv-compare { grid-template-columns: 1fr; }
    .aiv-prod-img, .aiv-drop { height: 190px; }
    .aiv-foot { justify-content: stretch; }
    .aiv-foot .aiv-btn { flex: 1; }
}
