﻿/* ===================================================================
   LAF_Editor_Image bilesenine ait stiller. Onek: 'laf-img-'.
   index.html'de bir kez referanslanir; bilesen markup'inda <style> YOKTUR.

   Gorunum: LAF_Editor_Text outlined ile birebir.
   Outline/arka plan/hover/focus laf_editors.css token'larindan gelir.
   Yukseklik ISTISNA: bilesenin kendi Height parametresi kullanilir.
   =================================================================== */

/* ── Field: outlined gorunum ─────────────────────────────────────── */
.laf-img-field {
    position: relative;
    width: 100%;
    margin-top: 8px;
    margin-bottom: 0px;
    font-family: var(--LAF-default-font-family);
}

.laf-img-wrap {
    position: relative;
}

/* Icerik border'in ustunde kalsin */
.laf-img-container {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* ── Outlined border: token'lara bagli ──────────────────────────── */
.laf-img-border {
    position: absolute;
    inset: -4px 0 0;
    margin: 0;
    padding: 0 10px;
    border-width: var(--LAF-editor-outline-width);
    border-color: var(--LAF-editor-outline-color);
    border-radius: var(--LAF-editor-radius);
    pointer-events: none;
    overflow: hidden;
    box-sizing: border-box;
    /*    transition: var(--LAF-editor-transition);*/
    background: var(--LAF-editor-bg);
    /*    box-shadow: var(--LAF-editor-inset);*/
}

/* Notch her zaman acik → label daima cizginin ustunde */
.laf-img-notch {
    float: unset;
    width: auto;
    overflow: hidden;
    display: block;
    padding: 0;
    height: 0;
    font-size: .75em;
    visibility: hidden;
    max-width: 100%;
    white-space: nowrap;
}

    .laf-img-notch > span {
        padding: 0 6px;
        display: inline-block;
    }

/* Hover / focus border (token) */
.laf-img-field:not(.laf-img-disabled):not(.laf-img-focused):hover .laf-img-border {
    /*    border-width: var(--LAF-editor-outline-width-hover);*/
    border-color: var(--LAF-editor-outline-color-hover);
}

.laf-img-focused .laf-img-border {
    /*    border-width: var(--LAF-editor-outline-width-focus);*/
    border-color: var(--LAF-editor-outline-color-focus);
}

/* ── Floating label: cizginin ustunde sabit ───────────────────── */
.laf-img-lbl {
    position: absolute;
    left: 11px;
    top: 0;
    z-index: 2;
    padding: 0 8px;
    transform: translate(0, -10px) scale(.75);
    transform-origin: left top;
    color: var(--LAF-palette-text-secondary);
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(133% - 32px);
    /*    background: linear-gradient(to bottom, transparent 0%, var(--LAF-editor-bg) 65%);*/
    transition: color .2s cubic-bezier(0,0,.2,1);
}

.laf-img-focused .laf-img-lbl {
    color: var(--LAF-palette-primary-lighten);
}

/* ── Disabled ──────────────────────────────────────────────────── */
.laf-img-disabled {
    opacity: .62;
    pointer-events: none;
}

    .laf-img-disabled .laf-img-border {
        border-style: dotted;
    }

/* ── Container & states ─────────────────────────────────────────── */
.laf-img-center {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Gorsel yukluyken tiklayinca preview → imlec pointer */
.laf-img-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    height: 100%;
    cursor: pointer;
}

    .laf-img-preview img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

/* ── Empty state ────────────────────────────────────────────────── */
.laf-img-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 16px;
    height: 100%;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color .2s ease;
}

.laf-img-dragover {
    background-color: color-mix(in srgb, var(--LAF-palette-primary, #594ae2) 12%, transparent);
}

.laf-img-hints {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 32px;
    opacity: .28;
}

    .laf-img-hints .laf-img-hint svg {
        width: 36px;
        height: 36px;
        display: block;
        fill: var(--LAF-palette-text);
    }

.laf-img-sizehint {
    font-size: .75rem;
    opacity: .7;
    color: var(--LAF-palette-text-secondary, rgba(0, 0, 0, .6));
}

/* ── Action overlay ─────────────────────────────────────────────── */
.laf-img-actions {
    position: absolute;
    top: 8px;
    right: 14px;
    display: flex;
    flex-direction: row;
    gap: 6px;
    opacity: 0;
    transition: opacity .2s ease;
}

.laf-img-container:hover .laf-img-actions,
.laf-img-focused .laf-img-actions {
    opacity: 1;
}

/* Ikonlar FAB'in metin rengini devralsin (LAFIcons disi bir SVG
   verilirse de siyaha dusmesin). */
.laf-img-actions svg,
.laf-img-camera-actions svg {
    fill: currentColor;
}

/* ── Kamera overlay ─────────────────────────────────────────────── */
.laf-img-camera {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
    border-radius: var(--LAF-editor-radius);
}

    .laf-img-camera video {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }

        /* On kamerada onizleme aynada gibi gorunsun; cekilen kare aynalanmaz. */
        .laf-img-camera video.laf-img-mirrored {
            transform: scaleX(-1);
        }

.laf-img-camera-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .35);
    z-index: 2;
}

/* Kamera aciktayken butonlar hover beklemeden hep gorunur. */
.laf-img-camera-actions {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    gap: 10px;
    z-index: 3;
}
