﻿/* layout.css - Layout components extracted from inline styles */

/* Main layout containers */
.container-fluid {
    padding-left: 0;
    padding-right: 0;
}

.full-width-container {
    width: 100%;
    max-width: 100%;
    padding-left: 30px;
    padding-right: 30px;
}

.nav-panels{
    height: 10vh;
}
main {
    width: 100%;
    padding: 1rem;
    margin: 0;
    height: calc(100vh - 200);
}


/* Modal layouts */
.modal-dialog-wide {
    width: auto;
    max-width: 90%;
}

.modal-content-scrollable {
    max-height: 80vh;
    overflow-y: auto;
}

.modal-body-scrollable {
    max-height: 60vh;
    overflow-y: auto;
}

/* Form container */
.form-container {
    max-height: 450px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 50px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    margin-left: 200px;
    margin-right: 200px;
}

/* Custom width containers */
.custom-width-container {
    max-width: 50%;
}

/* Table containers */
.table-responsive {
    overflow-x: auto;
    max-height: calc(70vh - 50px);
    overflow-y: auto;
    z-index: 1;
}

/* Scrollable containers */
.scrollable-container {
    max-height: 200px;
    overflow-y: auto;
}

.cascading-list-container {
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 10px;
}

/* Column layouts */
.col-fixed-width {
    width: 300px;
}

/* Children containers */
.children-container {
    border-left: 2px solid #dee2e6;
    margin-left: 1rem;
    padding-left: 1rem;
}

/* Content wrappers */
.table-cell-content {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%; 
    max-width: 100%;
}

.table-cell-content.show-more {
    white-space: normal;
    overflow: visible;
}

/* Special positioning */
.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    padding: 6px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

/* Options popup positioning */
.options-popup {
    min-width: 160px;
    background: white;
    padding: 4px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-radius: 4px;
}

.options-toggle {
    position: relative;
    z-index: 2;
}

/* Custom animations */
@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .form-container {
        margin-left: 15px;
        margin-right: 15px;
        padding: 20px;
    }

    .modal-dialog-wide {
        width: 95%;
        max-width: none;
    }

    .custom-width-container {
        max-width: 100%;
    }
}

.multilist-wrapper {
    position: relative;
}

.multilist-panel {
    position: absolute;
    z-index: 9999;
    top: 100%;
    left: 0;
    width: max-content;
    margin-top: 35px;
    max-height: 260px;
    background: #fff;
}


.multilist-options {
    max-height: 180px;
    overflow: auto;
}

.multilist-option:hover {
    background: rgba(0,0,0,0.03);
    border-radius: .5rem;
}

/*Attributes */
.attr-input-wrapper {
    display: flex;
    position: relative;
    width: 100%;
    align-items: center;
    gap: 5px;
    justify-content: space-between;
}

.attr-input {
    /* space on right for icon*/
    float: left;
    /* padding-right: 3.5rem; */
}

.attr-input.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 .1rem rgba(220,53,69,.1);
}


th{
    text-align:center;
}

/* make widths effective across header & body */
.table.resizable {
    table-layout: fixed;
}

.table.resizable thead th {
    position: relative;
    user-select: none;
}

/* the vertical draggable area */
.table.resizable thead th .col-resize-grip {
    position: absolute;
    top: 0;
    right: -4px;
    width: 8px;
    height: 600px;
    cursor: col-resize;
}


.pagination-container {
    display: flex;
    flex-direction: column;
    height: 100vh; /* Fill viewport height */
    padding: 1rem;
    box-sizing: border-box;
}

.pagination-container .small-column{
    width: 60px;
}

.table tbody {
    flex: 1; /* Take available space */
    overflow: auto; /* Enable both horizontal & vertical scrolling */
    max-height: calc(100vh - 100px); /* Adjust to leave space for pagination controls */
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
}

.pagination-container {
    display: flex;
    flex-direction: column;
    height: 100vh; /* Full viewport height */
    padding: 1rem;
    box-sizing: border-box;
}

/* Table setup */
.table.fixed-header {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}

    /* Scroll only inside tbody */
    .table.fixed-header tbody {
        display: block;
        max-height: calc(100vh - 150px); /* Adjust depending on header/pagination height */
        overflow-y: auto;
        overflow-x: auto;
    }

        /* Keep header fixed */
        .table.fixed-header thead,
        .table.fixed-header tbody tr {
            display: table;
            width: 100%;
            table-layout: fixed;
        }

    /* Ensure header always visible */
    .table.fixed-header thead {
        position: sticky;
        top: 0;
        background-color: #f8f9fa;
        z-index: 2;
    }

    /* Optional — style for scroll area */
    .table.fixed-header tbody::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    .table.fixed-header tbody::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 4px;
    }

.pagination-controls {
    margin-top: 1rem;
}




.w-0 {width: 0%;}
.w-5 {width: 5%;}

.w-10 {
    width: 10%;
}

.w-15 {
    width: 15%;
}

.w-20 {
    width: 20%;
}

.w-25 {
    width: 25%;
}

.w-30 {
    width: 30%;
}

.w-35 {
    width: 35%;
}

.w-40 {
    width: 40%;
}

.w-45 {
    width: 45%;
}

.w-50 {
    width: 50%;
}

.w-55 {
    width: 55%;
}

.w-60 {
    width: 60%;
}

.w-65 {
    width: 65%;
}

.w-70 {
    width: 70%;
}

.w-75 {
    width: 75%;
}

.w-80 {
    width: 80%;
}

.w-85 {
    width: 85%;
}

.w-90 {
    width: 90%;
}

.w-95 {
    width: 95%;
}

.w-100 {
    width: 100%;
}


/* Wrapper that provides horizontal scrolling for the table */
.table-x-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden; /* y handled by tbody */
}

/* Ensure the table can grow wider than the container */
.table.fixed-header {
    border-collapse: collapse;
    width: 100%;
    min-width: 100%; /* allow horizontal overflow when columns sum > container */
    table-layout: fixed; /* stable column widths */
}

/* Enforce min 100px on all data/header cells (except small-column) */
.table.fixed-header.col-min-100 th,
.table.fixed-header.col-min-100 td {
    min-width: 100px;
    width: auto;
}

/* Keep your small utility column compact */
.small-column {
    width: 60px !important;
    min-width: 60px !important;
}

/* Scroll only inside tbody */
.table.fixed-header tbody {
    display: block;
    max-height: calc(100vh - 150px); /* adjust as needed */
    overflow-y: auto;
    overflow-x: visible; /* CHANGED from auto -> visible */
}

    /* Keep header aligned with body rows */
    .table.fixed-header thead,
    .table.fixed-header tbody tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
