﻿/* ==========================================================================
   laf_edittable_styles.css — LAF_EditTable (ve LAFEditTable wrapper'ı) stilleri
   LAF_EditTable.razor içindeki style bloğundan ayrıldı.
   index.html'e eklenir:
     <link href="css/laf_edittable_styles.css" rel="stylesheet" />
   ========================================================================== */

.laf-edittable {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

/* Flex ebeveyn içinde (LAFEditTable) kalan alanı doldur: tablo büyür,
   aksiyon satırı altta sabit kalır. Akış içinde (dialog) etkisizdir. */
.laf-edittable {
    flex: 1 1 auto;
    min-height: 0;
}

    .laf-edittable .laf-edittable-scroll {
        flex: 1 1 auto;
        min-height: 0;
    }

    .laf-edittable > :not(.laf-edittable-scroll) {
        flex: 0 0 auto;
    }

/* Çerçevesiz: çerçeve / zemin dış kaptan (LAFPaper) gelir */
.laf-edittable-borderless .laf-edittable-scroll {
    border: none;
    border-radius: 0;
    background: transparent;
}

.laf-edittable-borderless {
    padding: 0 4px 2px 4px;
    box-sizing: border-box;
}

.laf-edittable-scroll {
    width: 100%;
    overflow: auto; /* dar ekranda yatay kaydır */
    background: var(--LAF-default-editor-background);
    border: 1px solid var(--LAF-palette-lines-input);
    border-radius: var(--LAF-default-border-radius);
    box-sizing: border-box;
}

.laf-edittable-table {
    width: 100%;
    min-width: max-content;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 0.9em;
}

    /* Başlık: kaydırırken üstte kalsın */
    .laf-edittable-table thead th {
        position: sticky;
        top: 0;
        z-index: 1;
        background: var(--LAF-default-editor-background);
        text-align: left;
        font-weight: 600;
        font-size: 0.85em;
        opacity: 0.85;
        padding: 8px 6px;
        border-bottom: 1px solid var(--LAF-palette-lines);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .laf-edittable-table td {
        padding: 2px 4px;
        border-bottom: 1px solid var(--LAF-palette-lines);
        vertical-align: middle;
    }

.laf-edittable-row:last-child td {
    border-bottom: none;
}

.laf-edittable-row {
    cursor: default;
}

    .laf-edittable-row:hover {
        background: color-mix(in srgb, var(--LAF-palette-primary) 4%, transparent);
    }

.laf-edittable-selected,
.laf-edittable-selected:hover {
    background: color-mix(in srgb, var(--LAF-palette-primary) 10%, transparent);
}

/* Satır numarası sütunu; seçili satırda solda ince vurgu */
.laf-edittable-idx {
    text-align: center;
    font-size: 0.8em;
    opacity: 0.55;
    user-select: none;
}

.laf-edittable-selected .laf-edittable-idx {
    opacity: 1;
    color: var(--LAF-palette-primary);
    box-shadow: inset 3px 0 0 var(--LAF-palette-primary);
}

.laf-edittable-center {
    text-align: center !important;
}

/* Hücre editörü: sakin görünür, üzerine gelince / odakta belirginleşir */
/* Select hücresi */
.laf-edittable-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 22px !important;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 12px 12px;
}

/* Select hücresi: tarayıcının select menüsü yerine kendi açılır listemiz
   (yerel menü işletim sistemince çizilir, temaya uymaz). */
.laf-edittable-dd {
    position: relative;
    min-width: 0;
}

.laf-edittable-select {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    font: inherit;
    color: inherit;
}

.laf-edittable-dd-text {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.laf-edittable-dd-open {
    border-color: var(--LAF-palette-primary) !important;
}

.laf-edittable-dd-overlay {
    position: fixed;
    inset: 0;
    z-index: 19;
    background: transparent;
}

.laf-edittable-dd-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 20;
    max-height: 260px;
    overflow-y: auto;
    padding: 4px;
    box-sizing: border-box;
    border: 1px solid var(--LAF-palette-lines-input);
    border-radius: var(--LAF-default-border-radius);
    background: color-mix(in srgb, var(--LAF-default-editor-background) 88%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    outline: none;
    font-size: 0.95em;
}

.laf-edittable-dd-item {
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

    /* Fare vurgusu CSS ile (C# state değil): her fare hareketinde
   yeniden çizim olmasın; klavye vurgusu ayrıca .laf-edittable-dd-hi */
    .laf-edittable-dd-item:hover,
    .laf-edittable-dd-hi {
        background: color-mix(in srgb, var(--LAF-palette-primary) 14%, transparent);
    }

.laf-edittable-dd-sel {
    font-weight: 600;
    color: var(--LAF-palette-primary);
}

.laf-edittable-select:disabled {
    cursor: default;
    opacity: 1;
}

/* TextButton hücresi: metin + "…" */
.laf-edittable-textbtn {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

    .laf-edittable-textbtn .laf-edittable-input {
        flex: 1 1 auto;
        min-width: 0;
    }

.laf-edittable-dots {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--LAF-default-border-radius);
    background: transparent;
    color: var(--LAF-palette-primary);
    font-weight: 700;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
}

    .laf-edittable-dots:hover:not(:disabled) {
        background: color-mix(in srgb, var(--LAF-palette-primary) 10%, transparent);
        border-color: var(--LAF-palette-lines-input);
    }

    .laf-edittable-dots:disabled {
        color: inherit;
        opacity: 0.3;
        cursor: default;
    }

.laf-edittable-input {
    width: 100%;
    height: 30px;
    box-sizing: border-box;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: var(--LAF-default-border-radius);
    background: transparent;
    color: inherit;
    font: inherit;
    outline: none;
    transition: border-color .12s ease, background .12s ease;
}

    .laf-edittable-input:hover:not([readonly]) {
        border-color: var(--LAF-palette-lines-input);
    }

    .laf-edittable-input:focus {
        border-color: var(--LAF-palette-primary);
        background: var(--LAF-default-editor-background);
    }

    .laf-edittable-input::placeholder {
        opacity: 0.4;
    }

.laf-edittable-upper {
    text-transform: uppercase;
}

.laf-edittable-number {
    text-align: right;
    -moz-appearance: textfield;
}

    .laf-edittable-number::-webkit-outer-spin-button,
    .laf-edittable-number::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

.laf-edittable-check {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--LAF-palette-primary);
}

/* Button hücresi: input'la aynı ölçü/sakinlikte, sağda "…" */
.laf-edittable-cellbtn {
    appearance: none;
    width: 100%;
    height: 30px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: var(--LAF-default-border-radius);
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease;
}

    .laf-edittable-cellbtn:hover:not(:disabled) {
        border-color: var(--LAF-palette-lines-input);
    }

    .laf-edittable-cellbtn:focus-visible {
        outline: none;
        border-color: var(--LAF-palette-primary);
        background: var(--LAF-default-editor-background);
    }

    .laf-edittable-cellbtn:disabled {
        cursor: default;
    }

.laf-edittable-cellbtn-text {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.laf-edittable-cellbtn-empty {
    opacity: 0.4;
}

.laf-edittable-cellbtn-dots {
    flex: 0 0 auto;
    color: var(--LAF-palette-primary);
    font-weight: 600;
}

.laf-edittable-empty {
    text-align: center;
    padding: 24px 8px !important;
    opacity: 0.5;
    font-size: 0.9em;
}

/* --- LAFEditTable wrapper --- */
.lafedittable-host {
    min-height: 0;
    min-width: 0;
}
