/* Custom SiteAI styles with Dashtreme theme */

/* Global layout styles for fixed layout with scrollable content area only */
html {
    height: 100%;
    overflow: hidden !important;
}

body {
    height: 100%;
    overflow: hidden !important;
    position: relative;
}

#wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
}

.content-wrapper {
    flex: 1;
    overflow-y: auto !important;
    padding-bottom: 20px;
    margin-bottom: 0;
    height: calc(100vh - 130px); /* Adjust based on header and footer height */
    position: relative;
}

.footer {
    flex-shrink: 0;
    width: 100%;
    padding: 5px 0;
    text-align: center;
    position: relative;
    bottom: 0;
}

/* Fix for specific sections that might still be scrollable */
.section, .section-report {
    overflow-y: visible;
    height: auto;
}

/* Camera feed images */
.tab-content img {
    width: 100%;
    height: 436px;
    border-radius: 5px;
}

/* Response box for AI text */
.response-box {
    min-height: 300px;
    max-height: 400px;
    padding: 15px;
    overflow-y: auto;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin-bottom: 10px;
    position: relative;
    height: 380px;
}

/* Ensure spinner is properly positioned in response box */
.spinner-wrapper {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.spinner-wrapper > div {
    width: 3rem;
    height: 3rem;
}

/* Input box styles */
.input-wrapper {
    display: flex;
    border-radius: 5px;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.1);
}

.input-wrapper input {
    flex-grow: 1;
    border: none;
    background-color: transparent;
    color: #fff;
    padding: 10px 15px;
}

.input-wrapper input:focus {
    outline: none;
}

.input-wrapper button {
    margin-left: 5px;
}

/* Card adaptations */
.card .card-header select {
    margin: 0;
    padding: 5px;
    border-radius: 4px;
    width: 310px;
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
}

/* Tab styles */
.nav-tabs {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-tabs .nav-link {
    color: rgba(255, 255, 255, 0.7);
    background-color: transparent;
    border: none;
    padding: 10px 15px;
    border-radius: 0;
    border-bottom: 2px solid transparent;
}

.nav-tabs .nav-link.active {
    color: #fff;
    background-color: transparent;
    border-bottom: 2px solid #fff;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: #fff;
}

/* Fix for HTMX and Bootstrap compatibility */
[hx-get], [hx-post], [hx-put], [hx-delete], [hx-patch] {
    cursor: pointer;
}

/* Custom styles for siteai_images display */
.card-img-top {
    border-radius: 0;
}

/* Audio player style */
.audio-wrapper {
    margin: 20px auto;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 10px;
}

.audio-wrapper audio {
    width: 100%;
    border-radius: 5px;
}

/* Record button style */
#recordButton {
    width: 64px;
    height: 64px;
    background-image: url('../images/siteai_images/record.png');
    background-repeat: no-repeat;
    border-radius: 50%;
    margin: 0 auto;
    display: block;
}

/* Oscilloscope canvas */
canvas {
    width: 100%;
    margin: 0 auto;
    display: block;
}

/* Table sections */
.table-section {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

/* DataTables Dashtreme Styling */
table.dataTable {
    color: #fff !important;
    border-collapse: collapse !important;
    width: 100% !important;
    table-layout: fixed;
}

table.dataTable thead th {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 15px 10px;
}

/* DataTable header layout */
.table-header-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 5px 0;
    width: 100%;
    gap: 8px;
    min-height: 70px;
}

.table-header-label {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: start;
    margin-bottom: 6px;
    font-size: 14px;
    height: 20px;
}

.header-title {
    font-size: 1rem;
    font-weight: 500;
}

.table-header-search {
    width: 60%;
    height: 34px;
}

/* DataTable column filter inputs */
table.dataTable thead th .column-filter {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 8px;
    width: 100%;
    font-size: 12px;
}

table.dataTable tbody td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

table.dataTable.stripe tbody tr.odd {
    background-color: rgba(255, 255, 255, 0.03);
}

table.dataTable.hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: #fff !important;
}

.dataTables_wrapper .dataTables_filter input {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
}

.dataTables_wrapper .dataTables_length select {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #fff !important;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0 2px;
    border-radius: 3px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    color: rgba(255, 255, 255, 0.5) !important;
}

/*!* Fix for the modal in Dashtreme *!*/
/*.modal {*/
/*    display: none;*/
/*    position: fixed;*/
/*    z-index: 9999;*/
/*    padding-top: 100px;*/
/*    left: 0;*/
/*    top: 0;*/
/*    width: 100%;*/
/*    height: 100%;*/
/*    overflow: auto;*/
/*    background-color: rgba(0, 0, 0, 0.9);*/
/*}*/

/*.modal .close {*/
/*    position: absolute;*/
/*    top: 80px;*/
/*    right: 35px;*/
/*    color: #fff;*/
/*    font-size: 40px;*/
/*    font-weight: bold;*/
/*    transition: 0.3s;*/
/*    z-index: 10000;*/
/*}*/

/*.modal .close:hover,*/
/*.modal .close:focus {*/
/*    color: #bbb;*/
/*    text-decoration: none;*/
/*    cursor: pointer;*/
/*}*/

/*.modal-content {*/
/*    margin: auto;*/
/*    display: block;*/
/*    max-width: 80%;*/
/*    max-height: 80%;*/
/*}*/

/* Login page specific styles */
.login-footer {
    flex-shrink: 0;
    width: 100%;
    text-align: center;
    padding: 15px 0;
    margin-top: auto;
    color: #fff;
}

/* Media queries */
@media (max-width: 767px) {
    .response-box {
        min-height: 200px;
    }
    
    .card .card-header select {
        width: 100%;
        margin-top: 10px;
    }
    
    /*.modal-content {*/
    /*    max-width: 95%;*/
    /*}*/
    
    /* Mobile table styles */
    table.dataTable thead th {
        padding: 10px 5px;
    }
    
    .table-header-container {
        padding: 2px 0;
        gap: 5px;
    }
    
    .table-header-label {
        font-size: 13px;
        margin-bottom: 4px;
    }
    
    /* Adjust table header for mobile */
    .table-header-container {
        flex-direction: column;
    }
}

/* Custom styles for Dashtreme template */

/* Right-aligned search bar */
.right-nav-link .search-bar {
    margin-left: 0;
    margin-right: 20px;
    position: relative;
}

.right-nav-link .search-bar input {
    width: 300px;
}

@media only screen and (max-width: 1024px) {
    .right-nav-link .search-bar {
        margin-right: 10px;
    }
    
    .right-nav-link .search-bar input {
        width: 250px;
    }
}

@media only screen and (max-width: 767px) {
    .right-nav-link .search-bar input {
        width: 200px;
    }
}

@media only screen and (max-width: 480px) {
    .right-nav-link .search-bar {
        margin-right: 5px;
    }
    
    .right-nav-link .search-bar input {
        width: 160px;
    }
}

/*!* Fix for DataTables sizing issues when filtering *!*/
/*table.dataTable th, */
/*table.dataTable td {*/
/*    box-sizing: border-box;*/
/*    overflow: hidden;*/
/*    text-overflow: ellipsis;*/
/*}*/

/*!* Container ID column width *!*/
/*table.dataTable th:nth-child(1),*/
/*table.dataTable td:nth-child(1) {*/
/*    width: 12% !important;*/
/*}*/

/*!* Site column width *!*/
/*table.dataTable th:nth-child(2), */
/*table.dataTable td:nth-child(2) {*/
/*    width: 10% !important;*/
/*}*/

/*!* Image columns width *!*/
/*table.dataTable th:nth-child(3),*/
/*table.dataTable td:nth-child(3),*/
/*table.dataTable th:nth-child(4),*/
/*table.dataTable td:nth-child(4) {*/
/*    width: 12% !important;*/
/*    text-align: center;*/
/*}*/

/*!* Fullness column width *!*/
/*table.dataTable th:nth-child(5),*/
/*table.dataTable td:nth-child(5) {*/
/*    width: 8% !important;*/
/*}*/

/*!* Materials column width *!*/
/*table.dataTable th:nth-child(6),*/
/*table.dataTable td:nth-child(6) {*/
/*    width: 20% !important;*/
/*}*/

/*!* Timestamp column width *!*/
/*table.dataTable th:nth-child(7),*/
/*table.dataTable td:nth-child(7) {*/
/*    width: 14% !important;*/
/*}*/

/*!* Failure column width *!*/
/*table.dataTable th:nth-child(8),*/
/*table.dataTable td:nth-child(8) {*/
/*    width: 10% !important;*/
/*    white-space: normal;*/
/*    word-wrap: break-word;*/
/*}*/

/* Make sure the DataTable container doesn't change size */
.dataTables_wrapper {
    min-height: 500px;
}

/* Ensure images maintain consistent size */
table.dataTable td img {
    width: 64px;
    height: 64px;
    object-fit: cover;
}

/* Additional styles for failure column */
#dumpster_report td:nth-child(8) {
    max-width: 120px;
    overflow: visible;
    white-space: normal;
    word-break: break-word;
}

/* Ensure all columns have proper text handling */
table.dataTable th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

table.dataTable td {
    word-break: break-word;
}

/* Specific fix for scrolling and overflow */
.dataTables_wrapper {
    overflow-x: auto !important;
    margin-bottom: 20px;
}

/* Special container for dumpster table */
.dumpster-table-container {
    overflow-x: auto;
    margin-bottom: 30px;
    min-height: 500px;
    padding-bottom: 10px;
}

/* Make sure horizontal scroll is smooth and visible */
.dumpster-table-container::-webkit-scrollbar {
    height: 8px;
}

.dumpster-table-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.dumpster-table-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.dumpster-table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Sidebar scrollbar customization */
#sidebar-wrapper .simplebar-track.vertical {
    height: 0 !important;
}

/* Additional fallback for specific class structure */
#sidebar-wrapper .sidebar-track.vertical {
    height: 0 !important;
} 