/* =========================
   Common/Shared Components
   ========================= */

/* Table styles */
.table-responsive {
    overflow: visible;
}

.table .thead-dark th {
    border-color: transparent;
    /* or the same as the background color */
}

/* Custom header style */
.custom-thead {
    background-color: #f2f2f2;
    /* Light grey background */
    color: #000;
    /* Black text for headers */
    border-bottom: none;
}

.custom-thead th,
.custom-thead td {
    position: relative;
    /* Required for absolute positioning of the button */
    border-bottom: none !important;
    /* Remove the bottom border */
}

.common-table,
.dt-scroll {
    overflow-x: auto;
    border-collapse: collapse;
    margin-top: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1),
        /* Shadows for borders */
        0 -2px 4px rgba(0, 0, 0, 0.1);
}

.common-table th,
.common-table td {
    padding: 8px;
    text-align: left;
    vertical-align: middle !important;
}

.common-table tbody tr:hover {
    cursor: pointer;
    background-color: #e9ecef !important;
}

.common-table tr.no-hover:hover {
    background-color: inherit;
}

.dt-scroll-body tbody tr td:last-child {
    padding-right: 1.25rem !important;
}

/* Custom filter buttons for table columns */
.filter-btn {
    background-color: transparent;
    border: none;
    color: #000 !important;
    /* Set the color to black */
    cursor: pointer;
    font-size: inherit;
    /* Inherit the font size from the th element */
}

.filter-btn:hover {
    color: #555;
    /* Slightly lighter color on hover for feedback */
}

/* Hide the dropdown by default and position it absolutely relative to the th */
.filter-dropdown {
    display: none;
    position: absolute;
    right: 0;
    background-color: #fff;
    min-width: 100px;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
    z-index: 1000;
    padding: 5px 10px;
    /* Adds padding inside the link for better spacing */
    text-decoration: none;
    /* Removes underline from links */
    max-height: 400px;
    overflow-y: auto;
}

.filter-dropdown a {
    display: block;
    color: black;
    text-decoration: none;
    font-weight: normal;
}

.filter-dropdown a:hover {
    background-color: #f2f2f2;
    /* Adds a light grey background on hover for better interaction feedback */
    text-decoration: none;
}

.show-dropdown {
    display: block;
}


.checkmark {
    color: #deba5ca6;
    display: none;
    /* Hide by default */
    text-align: right;
    padding-left: 10px;
    float: right;
    /* Position to the right */
}

.table-menu-btn {
    padding-right: 0 !important;
}

.dropdown-item {
    padding: 5px 5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#nodesMenu .dropdown-item {
    justify-content: left;
}

.dropdown-item.active {
    background-color: transparent;
    /* Light grey background for active item */
    color: black
}

.dropdown-item:active {
    background-color: #f2f2f2;
    /* Light grey background for active item */
    color: black
}

.dropdown-item.active .checkmark {
    display: inline-block;
    /* Show when active */
}

.filter-active {
    color: #deba5ca6;
}

.timestamp-milli {
    min-width: 195px;
}

.timestamp-minutes {
    min-width: 165px;
}

.timestamp {
    min-width: 185px;
}

/* CSV table styles */
.csv-common-table {
    min-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1),
        /* Shadows for borders */
        0 -2px 4px rgba(0, 0, 0, 0.1);
}

.csv-common-table tr.no-hover:hover {
    background-color: inherit;
    /* Keeps the background the same as non-hovered state */
}


.csv-common-table th,
.csv-common-table td {
    padding: 8px;
    text-align: left;
    vertical-align: middle !important;
}

.csv-common-table tr:hover {
    background-color: #f5f5f5;
    /* Hover effect for table rows */
}

.csv-common-table th {
    white-space: nowrap;
    flex-direction: row;
    align-items: center;
    /* Center vertically */
    justify-content: space-between;
    /* Push content to both ends */
    background-color: #f2f2f2;
    color: #000;
    padding-right: 8px;
}

.csv-common-table tr {
    display: table-row;
}

#csvTable {
    table-layout: fixed;
    width: 100%;
}

#csvTable th,
#csvTable td {
    white-space: nowrap;
    /* prevent multi-line wrapping */
    overflow: hidden;
    /* hide overflow text */
    text-overflow: ellipsis;
    /* show ... if content is wider */
}

table.dataTable thead th.dt-colresizable-hover {
    cursor: col-resize !important;
}

/*
 *  DataTables Custom Search Styling
 */

div.dt-search {
    position: relative;
    text-align: left;
}

div.dt-search label {
    font-size: 0;
}

div.dt-search .search-icon {
    position: absolute;
    left: 5px;
    top: 43%;
    transform: translateY(-40%);
    color: #5a6b7b;
    font-size: 24px;
    pointer-events: none;
}

/* Style the actual search input field */
div.dt-search input[type="search"] {
    width: 200px;
    /* UPDATED: Reduced width */
    height: 36px;
    /* UPDATED: Reduced height for a more compact feel */
    font-size: 16px;
    /* UPDATED: Slightly smaller font */

    /* UPDATED: Adjusted padding to match new height and icon size */
    /* top/bottom padding is smaller, left padding makes space for the smaller icon */
    padding: 6px 10px 6px 38px;

    border: 1px solid #d1d5db;
    border-radius: 6px;
    margin-left: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* No blue outline on focus */
div.dt-search input[type="search"]:focus {
    outline: none;
    box-shadow: none;
    border-color: #d1d5db;
}

.truncate {
    white-space: nowrap;
    /* Prevent the text from wrapping to the next line */
    overflow: hidden;
    /* Hide the overflowing text */
    text-overflow: ellipsis;
    /* Add the "..." */
    max-width: 0;
    /* A trick to make text-overflow work in flex/table cells */
}


.fa-windows {
    color: #0078D6;
}

.fa-linux {
    color: #333;
}

select.dt-input {
    margin-right: 10px;
}

/* Leftalign empty table messages */
table.dataTable td.dt-empty {
    text-align: left;
}

.dt-length label {
    margin-bottom: 0;
}

/* Remove gap between header and filter icon */
table.dataTable thead>tr>th div.dt-column-header {
    gap: 0px;
}


/* Style the table container created by DataTables */
.datatable-as-list_wrapper .dt-layout-row {
    padding: 0.5em 0;
}

/* Make each table row a flex container */
.datatable-as-list tbody tr {
    display: flex;
    /*  <-- The key change!  */
    align-items: center;
    /*  Vertically align content in the middle */
    cursor: pointer;
    padding: 4px 0;
    white-space: nowrap;
}

/* Style the cells (flex items) within the row */
.datatable-as-list tbody td {
    border: none !important;
    /* Remove all borders from cells */
    box-shadow: none !important;
    padding: 0 5px !important;
    /* Adjust padding for spacing */
}

/* Specifically style the first cell (the icon) to not grow */
.datatable-as-list tbody td.dt-control {
    flex: 0 0 20px;
    /* Don't grow, don't shrink, base width 20px */
    text-align: center;
}

/* Hide the table header */
.datatable-as-list thead {
    display: none;
}

/* --- Styling for the expanded child row --- */

/* When a row is expanded, remove its bottom border */
.datatable-as-list tr.dt-hasChild {
    border-bottom: none;
}

/* Style the container for the child details */
.datatable-as-list tr.dt-child td {
    display: block;
    /* Make the child cell a full-width block */
    width: 100%;
    padding: 10px 25px !important;
    /* Indent the details */
    background-color: #f8f9fa;
    border-bottom: 1px solid #f0f0f0;
}

.datatable-as-list td.dt-control::before {
    content: none !important;
}

.dt-column-order::before {
    top: 0em;
}

.dt-column-order::after {
    bottom: 0em;
}

div.dt-container div.dt-layout-row {
    margin: 1rem 0;
}

/* Override a specific style from styles.css */
.dtcc-button .material-icons {
    margin-right: 0px !important;
}

.tenant-header {
    display: flex;
    /* Establishes a flex container */
    justify-content: space-between;
    /* Pushes children to opposite ends */
    align-items: center;
    /* Vertically aligns items in the center */
    width: 100%;
    /* Ensures the container takes up the full header width */
}

/* ───────── Executables page – allow wrapping for long text ───────── */
td.llm-summary,
td.llm-description {
    white-space: normal !important;
    /* override DataTables default */
    word-break: break-word;
    /* split very long tokens if needed */
    line-height: 1.35;
    /* optional: a touch more breathing room */
}