﻿/**
 * TRINEX GRID STYLES v2.1
 */

:root {
    --trinex-primary: #0d9488;
    --trinex-border: #e5e7eb;
    --trinex-border-dark: #d1d5db;
    --trinex-bg-light: #f9fafb;
    --trinex-bg-header: #f3f4f6;
    --trinex-text: #374151;
    --trinex-text-light: #6b7280;
    --trinex-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --trinex-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --trinex-radius: 8px;
    --trinex-radius-lg: 10px;
    --selection-color: #0d9488;
    --selection-color-light: rgba(13, 148, 136, 0.15);
}

/* WRAPPER */
.trinex-grid-wrapper {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    position: relative;
    padding: 8px;
}

/* GRID CONTAINER */
.trinex-grid-container {
    background: #fff;
    border: 1px solid var(--trinex-border);
    border-radius: var(--trinex-radius-lg);
    overflow: hidden;
    box-shadow: var(--trinex-shadow);
}

/* BAŞLIK SATIRI - DÜZ RENK (GÖLGE/GEÇİŞ YOK) */
.trinex-grid-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--trinex-primary);
    border-bottom: 1px solid var(--trinex-primary);
}

.trinex-title-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.trinex-title-text {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.01em;
}

/* MENÜ TRIGGER BUTONU */
.trinex-menu-trigger {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

    .trinex-menu-trigger:hover {
        background: rgba(255, 255, 255, 0.25);
    }

/* DROPDOWN MENÜ */
.trinex-dropdown-menu {
    position: fixed;
    display: none;
    background: #fff;
    border: 1px solid var(--trinex-border);
    border-radius: var(--trinex-radius);
    box-shadow: var(--trinex-shadow-lg);
    z-index: 10000;
    min-width: 220px;
    padding: 6px 0;
    animation: trinexFadeIn 0.2s ease;
}

    .trinex-dropdown-menu.show {
        display: block;
    }

@keyframes trinexFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.trinex-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--trinex-text);
    text-align: left;
    transition: all 0.15s ease;
    position: relative;
}

    .trinex-dropdown-item:hover {
        background-color: var(--trinex-bg-light);
    }

    .trinex-dropdown-item i {
        width: 18px;
        font-size: 13px;
    }

    .trinex-dropdown-item span {
        flex: 1;
        font-weight: 500;
    }

    .trinex-dropdown-item small {
        font-size: 11px;
        color: var(--trinex-text-light);
        position: absolute;
        right: 14px;
    }

    .trinex-dropdown-item.text-danger {
        color: #ef4444;
    }

.trinex-dropdown-divider {
    height: 1px;
    background: var(--trinex-border);
    margin: 4px 0;
}

/* RENK SINIFLARI */
.text-cyan {
    color: #06b6d4 !important;
}

.text-blue {
    color: #3b82f6 !important;
}

.text-red {
    color: #ef4444 !important;
}

.text-purple {
    color: #8b5cf6 !important;
}

.text-teal {
    color: #0d9488 !important;
}

.text-orange {
    color: #f59e0b !important;
}

.text-green {
    color: #10b981 !important;
}

.text-gray {
    color: #6b7280 !important;
}

/* TABULATOR CONTAINER */
.trinex-table-container {
    width: 100%;
    background-color: #fff;
}

    .trinex-table-container .tabulator {
        border: none !important;
        border-radius: 0;
        font-size: 13px;
    }

    /* HEADER */
    .trinex-table-container .tabulator-header {
        background-color: #fff !important;
        border-bottom: 2px solid var(--trinex-primary) !important;
        font-weight: 600 !important;
        padding: 0 !important;
    }

        .trinex-table-container .tabulator-header .tabulator-col {
            background-color: #fff !important;
            border-right: 1px solid var(--trinex-border) !important;
            padding: 0 !important;
            height: auto !important;
        }

            .trinex-table-container .tabulator-header .tabulator-col:last-child {
                border-right: none !important;
            }

        .trinex-table-container .tabulator-header .tabulator-col-content {
            display: flex !important;
            flex-direction: column-reverse !important;
            height: 100% !important;
            padding: 0 !important;
            justify-content: flex-end;
        }

        /* FİLTRE KUTULARI */
        .trinex-table-container .tabulator-header .tabulator-header-filter {
            width: 100% !important;
            padding: 6px 8px !important;
            background-color: var(--trinex-bg-light) !important;
            border-bottom: 1px solid var(--trinex-border) !important;
            margin: 0 !important;
        }

            .trinex-table-container .tabulator-header .tabulator-header-filter input {
                border: 1px solid var(--trinex-border) !important;
                border-radius: 4px !important;
                padding: 6px 10px !important;
                font-size: 12px !important;
                height: 28px !important;
                width: 100% !important;
                background: #fff !important;
                transition: all 0.2s ease;
            }

                .trinex-table-container .tabulator-header .tabulator-header-filter input:focus {
                    border-color: var(--trinex-primary) !important;
                    outline: none !important;
                    box-shadow: 0 0 0 3px var(--selection-color-light) !important;
                }

        /* BAŞLIK YAZISI */
        .trinex-table-container .tabulator-header .tabulator-col-title-holder {
            background-color: var(--trinex-bg-header) !important;
            padding: 10px 12px !important;
            width: 100% !important;
            text-align: left !important;
            min-height: 36px !important;
            display: flex !important;
            align-items: center !important;
            justify-content: space-between !important;
            cursor: pointer;
            transition: background 0.2s ease;
        }

            .trinex-table-container .tabulator-header .tabulator-col-title-holder:hover {
                background-color: #e5e7eb !important;
            }

        .trinex-table-container .tabulator-header .tabulator-col-title {
            color: var(--trinex-text) !important;
            font-weight: 600 !important;
            font-size: 13px !important;
            display: flex !important;
            align-items: center !important;
            justify-content: space-between !important;
            width: 100% !important;
        }

.trinex-header-title {
    flex: 1;
}

.trinex-sort-icon {
    color: #9ca3af;
    font-size: 11px;
    margin-left: 8px;
    transition: color 0.2s ease;
}

.tabulator-col-title-holder:hover .trinex-sort-icon {
    color: var(--trinex-primary);
}

/* SATIRLAR */
.trinex-table-container .tabulator-row {
    border-bottom: 1px solid var(--trinex-border) !important;
    background-color: #ffffff !important;
    min-height: 36px !important;
    transition: background-color 0.15s ease;
}

    .trinex-table-container .tabulator-row.tabulator-row-even {
        background-color: var(--trinex-bg-light) !important;
    }

    .trinex-table-container .tabulator-row:hover {
        background-color: #e0f2fe !important;
    }

/* HÜCRELER */
.trinex-table-container .tabulator-cell {
    padding: 8px 12px !important;
    border-right: 1px solid var(--trinex-border) !important;
    color: var(--trinex-text) !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .trinex-table-container .tabulator-cell:last-child {
        border-right: none !important;
    }

/* SIRA NO */
.trinex-table-container .row-number-cell {
    background-color: var(--trinex-bg-light) !important;
    font-weight: 600 !important;
    color: var(--trinex-text-light) !important;
    cursor: pointer;
}

    .trinex-table-container .row-number-cell:hover {
        background-color: var(--trinex-border) !important;
    }

/* SEÇİLİ SATIR */
.trinex-table-container .tabulator-row.tabulator-selected {
    background-color: var(--selection-color-light) !important;
    box-shadow: inset 4px 0 0 var(--selection-color) !important;
}

    .trinex-table-container .tabulator-row.tabulator-selected .tabulator-cell {
        background-color: transparent !important;
        border-right-color: rgba(13, 148, 136, 0.3) !important;
    }

    .trinex-table-container .tabulator-row.tabulator-selected:hover {
        background-color: rgba(13, 148, 136, 0.25) !important;
    }

/* SIRALAMA DROPDOWN */
.trinex-sort-dropdown {
    position: fixed;
    display: none;
    background: #fff;
    border: 1px solid var(--trinex-border);
    border-radius: var(--trinex-radius);
    box-shadow: var(--trinex-shadow-lg);
    z-index: 10000;
    min-width: 180px;
    padding: 6px 0;
    animation: trinexFadeIn 0.2s ease;
}

    .trinex-sort-dropdown.show {
        display: block;
    }

.trinex-sort-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--trinex-text);
    text-align: left;
    transition: all 0.15s ease;
}

    .trinex-sort-item:hover {
        background-color: var(--trinex-bg-light);
        color: var(--trinex-primary);
    }

    .trinex-sort-item i {
        width: 18px;
        color: var(--trinex-text-light);
    }

    .trinex-sort-item:hover i {
        color: var(--trinex-primary);
    }

.trinex-sort-divider {
    height: 1px;
    background: var(--trinex-border);
    margin: 4px 0;
}

/* CONTEXT MENÜ */
.tabulator-menu {
    border-radius: var(--trinex-radius) !important;
    box-shadow: var(--trinex-shadow-lg) !important;
    border: 1px solid var(--trinex-border) !important;
    padding: 6px 0 !important;
    background: #fff !important;
}

.tabulator-menu-item {
    padding: 10px 14px !important;
    font-size: 13px !important;
    color: var(--trinex-text) !important;
    transition: all 0.15s ease !important;
}

    .tabulator-menu-item:hover {
        background-color: var(--trinex-bg-light) !important;
    }

    .tabulator-menu-item i {
        margin-right: 10px;
    }

.tabulator-menu-separator {
    border-color: var(--trinex-border) !important;
    margin: 4px 0 !important;
}

/* SELECT2 */
.select2-container {
    box-sizing: border-box;
    display: block;
    margin: 0;
    text-align: left;
}

.tabulator-cell .select2-container .select2-selection--single {
    height: 100% !important;
    border: none !important;
    background: transparent !important;
}

.select2-dropdown {
    z-index: 99999 !important;
    font-size: 13px;
    border-radius: var(--trinex-radius) !important;
    box-shadow: var(--trinex-shadow-lg) !important;
}

.select2-results__option--highlighted {
    background-color: var(--trinex-primary) !important;
}

.select2-container--default .select2-selection--multiple {
    border: 1px solid var(--trinex-border) !important;
    border-radius: 4px !important;
    min-height: 30px !important;
}

    .select2-container--default .select2-selection--multiple .select2-selection__choice {
        background-color: var(--trinex-primary) !important;
        border: none !important;
        color: #fff !important;
        border-radius: 4px !important;
        padding: 2px 8px !important;
    }

    .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
        color: #fff !important;
        margin-right: 5px !important;
    }

/* MODAL */
.trinex-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .trinex-modal-backdrop.show {
        opacity: 1;
        visibility: visible;
    }

.trinex-column-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 480px;
    max-width: 95vw;
    max-height: 85vh;
    background: #fff;
    border-radius: var(--trinex-radius-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

    .trinex-column-modal.show {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%) scale(1);
    }

.trinex-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--trinex-primary);
    color: #fff;
}

.trinex-modal-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.trinex-modal-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.trinex-modal-title-group h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.trinex-modal-subtitle {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
    display: block;
}

.trinex-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 16px;
}

    .trinex-modal-close:hover {
        background: rgba(255, 255, 255, 0.25);
        transform: rotate(90deg);
    }

.trinex-modal-search {
    padding: 14px 20px;
    background: var(--trinex-bg-light);
    border-bottom: 1px solid var(--trinex-border);
    position: relative;
}

    .trinex-modal-search i {
        position: absolute;
        left: 34px;
        top: 50%;
        transform: translateY(-50%);
        color: #9ca3af;
        font-size: 14px;
    }

    .trinex-modal-search input {
        width: 100%;
        padding: 10px 14px 10px 38px;
        border: 1px solid var(--trinex-border);
        border-radius: 8px;
        font-size: 14px;
        background: #fff;
        transition: all 0.2s ease;
    }

        .trinex-modal-search input:focus {
            outline: none;
            border-color: var(--trinex-primary);
            box-shadow: 0 0 0 3px var(--selection-color-light);
        }

.trinex-modal-toolbar {
    display: flex;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border-bottom: 1px solid var(--trinex-border);
}

.trinex-toolbar-btn {
    padding: 6px 12px;
    border: 1px solid var(--trinex-border);
    border-radius: 6px;
    background: #fff;
    color: var(--trinex-text);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

    .trinex-toolbar-btn:hover {
        background: var(--trinex-bg-light);
        border-color: var(--trinex-primary);
        color: var(--trinex-primary);
    }

    .trinex-toolbar-btn i {
        font-size: 11px;
    }

.trinex-column-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    max-height: 400px;
}

.trinex-column-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid #f5f5f5;
    gap: 12px;
}

    .trinex-column-item:hover {
        background: var(--trinex-bg-light);
    }

    .trinex-column-item:last-child {
        border-bottom: none;
    }

.trinex-column-checkbox {
    position: relative;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

    .trinex-column-checkbox input {
        position: absolute;
        opacity: 0;
        cursor: pointer;
        width: 100%;
        height: 100%;
        z-index: 1;
    }

.trinex-checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 2px solid var(--trinex-border);
    border-radius: 5px;
    transition: all 0.2s ease;
}

.trinex-column-checkbox input:checked ~ .trinex-checkmark {
    background: var(--trinex-primary);
    border-color: var(--trinex-primary);
}

.trinex-checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.trinex-column-checkbox input:checked ~ .trinex-checkmark:after {
    display: block;
}

.trinex-column-checkbox:hover .trinex-checkmark {
    border-color: var(--trinex-primary);
}

.trinex-column-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

    .trinex-column-info i {
        width: 20px;
        color: var(--trinex-text-light);
        font-size: 13px;
    }

.trinex-column-name {
    font-size: 14px;
    color: var(--trinex-text);
    font-weight: 500;
}

.trinex-column-field {
    font-size: 11px;
    color: #9ca3af;
    background: var(--trinex-bg-light);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: monospace;
}

.trinex-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--trinex-bg-light);
    border-top: 1px solid var(--trinex-border);
}

.trinex-modal-footer-info {
    font-size: 12px;
    color: var(--trinex-text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

    .trinex-modal-footer-info i {
        color: var(--trinex-primary);
    }

.trinex-btn-primary {
    padding: 10px 20px;
    background: var(--trinex-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

    .trinex-btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(13, 148, 136, 0.4);
    }

/* SCROLLBAR */
.trinex-table-container .tabulator-tableholder::-webkit-scrollbar,
.trinex-column-list::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.trinex-table-container .tabulator-tableholder::-webkit-scrollbar-track,
.trinex-column-list::-webkit-scrollbar-track {
    background: var(--trinex-bg-light);
    border-radius: 4px;
}

.trinex-table-container .tabulator-tableholder::-webkit-scrollbar-thumb,
.trinex-column-list::-webkit-scrollbar-thumb {
    background: var(--trinex-border-dark);
    border-radius: 4px;
}

    .trinex-table-container .tabulator-tableholder::-webkit-scrollbar-thumb:hover,
    .trinex-column-list::-webkit-scrollbar-thumb:hover {
        background: #9ca3af;
    }

/* PLACEHOLDER */
.trinex-table-container .tabulator-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

    .trinex-table-container .tabulator-placeholder span {
        color: var(--trinex-text-light);
        font-size: 14px;
        font-style: italic;
    }

/* RESPONSIVE */
@media (max-width: 768px) {
    .trinex-grid-title-row {
        padding: 10px 12px;
    }

    .trinex-title-text {
        font-size: 14px;
    }

    .trinex-menu-trigger {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .trinex-column-modal {
        width: 95vw;
        max-height: 90vh;
    }
}
