﻿/* =========================
   Tabs (Scrollable) - Clean
   ========================= */

/* Tabs strip */
.table-tabs {
    height: 42px;
    border-bottom: .5px solid var(--gray-300);
    width: 100%;
    display: flex;
    align-items: center;
}

/* Single tab */
.tab-menu {
    height: 100%;
    flex: 0 0 auto; /* don't force equal widths */
    width: clamp(60px, 33.333%, 130px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--gray-500);
    font-size: 12px;
    line-height: 18px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: 0.1s all;
}

    .tab-menu.active {
        background-color: var(--gray-200);
        color: var(--primary-400);
        border-bottom: 1.5px solid var(--primary-400);
        font-weight: 500;
    }

    .tab-menu:hover {
        background-color: var(--gray-200);
        color: var(--primary-400);
        font-weight: 500;
    }

/* Wrapper so arrows & fades can overlay the scrolling strip */
.tabs-scroll-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
    .tabs-scroll-wrap.page-tabs {
        max-width: 100%;
    }

/* The scrolling container (also holds the .table-tabs layout) */
.tabs-scroll {
    min-width: 0;
    /* reserve space for arrows */
    overscroll-behavior-x: contain;
    width: 100%;
    flex: 1 1 auto;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    direction: inherit; /* IMPORTANT for RTL layouts */
    /* hide scrollbar */
    scrollbar-width: none; /* Firefox */
}

    .tabs-scroll::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

/* Arrow buttons */
.tabs-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    border: 0;
    border-radius: 999px;
    width: 34px;
    height: 34px;
    display: none; /* default hidden; JS controls */
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
    background: #fff;
    color: inherit;
}

    /* Place buttons using logical inline start/end (RTL-safe) */
    .tabs-scroll-btn.left {
        inset-inline-start: 8px; /* was -6px */
    }

    .tabs-scroll-btn.right {
        inset-inline-end: 8px; /* was -6px */
    }

    /* Button visibility state */
    .tabs-scroll-btn.is-visible {
        display: inline-flex;
    }

    .tabs-scroll-btn.is-disabled {
        opacity: .45;
        pointer-events: none;
    }

    .tabs-scroll-btn.is-hidden {
        display: none !important;
    }

    /* Ensure icon can be transformed */
    .tabs-scroll-btn > i {
        display: inline-block;
    }

/* Mirror arrow icons in RTL */
html[dir="rtl"] .tabs-scroll-btn > i,
[dir="rtl"] .tabs-scroll-btn > i {
    transform: scaleX(-1);
}

/* Fade edges (optional) */
.tabs-scroll-wrap::before,
.tabs-scroll-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 26px;
    pointer-events: none;
    z-index: 4;
    opacity: 0;
    transition: opacity .15s ease;
}

/* Logical inline start/end */
.tabs-scroll-wrap::before {
    inset-inline-start: 0;
    background: linear-gradient(to right, #fff, rgba(255,255,255,0));
}

.tabs-scroll-wrap::after {
    inset-inline-end: 0;
    background: linear-gradient(to left, #fff, rgba(255,255,255,0));
}

/* Flip gradient directions in RTL */
.tabs-scroll-wrap:dir(rtl)::before {
    background: linear-gradient(to left, #fff, rgba(255,255,255,0));
}

.tabs-scroll-wrap:dir(rtl)::after {
    background: linear-gradient(to right, #fff, rgba(255,255,255,0));
}

/* Fade visibility controlled by JS (start/end, not left/right) */
.tabs-scroll-wrap.has-start::before {
    opacity: 1;
}

.tabs-scroll-wrap.has-end::after {
    opacity: 1;
}
