* {
    box-sizing: border-box;
}

html,
body {
    padding: 0;
    margin: 0;
}

body {
    font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
}

#pageContent {
    display: none;
}

/* Swal Stuff */
.swal-small {
    width: 200px;
    height: 100px;
    padding: 10px;
    font-size: 10px;
}

/* Loading Screen */

.center{
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.loader {
    display: none;
    border: 16px solid #f1f1f1;
    border-top: 16px solid #454545;
    border-radius: 50%;
    width: 200px;
    height: 200px;
    animation: spin 2s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.LoadPage{
    opacity: 0.3;
    overflow: hidden;
}

.LoadingCursor{
    cursor: wait;
}

/* Line Item Form */

.container-card{
    display: none;
    z-index: 1000;
    background-color: #ebebed;
    padding: 1.5rem;
    border-radius: 0.375rem;
}

.FormLine{
    display: flex;
}
.FormLine input, .FormLine select{
    min-width: 188px;
    display: block;
}

/* Page Tops */

#QuoteValuesFlex{
    display: flex;
    justify-content: center;
}

.list-group-item{
    font-size: 1.1rem;
}

.EpicLogo{
    display: inline-block;
    width: 150px;
    height: 85px;
}

.StickyFooter{
    position: fixed;
    bottom: 0;
    width: 100%;
}

/* PDF Stuff */

#pdf-container{
    padding: 0;
}

.pdf-section:not(#title-page){
    padding: 10rem 5rem;
}

.section-title{
    color: #e91d2d;
    font-weight: bold;
}

.divider{
    color: #358bb5;
    border-top-width: 5px;
    opacity: 1;
    margin: 1.5rem 0;
}

.vr-div{
    font-size: 25px;
    font-weight: bold;
    /*color: #358bb5;*/
}

#title-page{
    display: flex;
    flex-direction: column;
    /*height: 100vh;*/
}

#pdf-logo{
    width: 25%;
}

#title-picture{
    height: 60vh;
}

#title-info{
    width: fit-content;
}

#pdf-summary{
    padding: 5px 10px 100px 10px;
    border: 1px solid black;
    border-radius: 0.375rem;
}

#font-size{
    width: fit-content;
    border-color: #3d3935;
}

#font-size option:hover{
    background-color: #e91d2d;
}

.pictures-grid{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5em;
}

.pictures-flex{
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid black;
    position: relative;
}

.pictures-flex > .remove-picture{
    position: absolute;
    top: 0;
    right: 0;
    z-index: 11;
}

.square{
    aspect-ratio: 1/1;
}

#details-popup{
    width: 75%;
    max-height: 75%;
}

#pdf-quote-total{
    display: flex;
    align-items: flex-end;
}

#auth-values{
    display: grid;
    grid-template-columns: 1fr 1fr;
}

#customer-notes{
    margin-bottom: 40%;
}

#customer-sign{
    display: flex;
    justify-content: space-between;
    margin-bottom: 20%;
}

.auth-label{
    border-bottom: 2px solid black;
    padding-right: 30%;
}

/* Input Fields */

#SearchBar {
    field-sizing: fixed;
    width: 100%;
}

/* Removes arrows from number input fields */
input[type="number"] {
    -moz-appearance: textfield;
}
input[type="number"]::-ms-clear {
    display: none;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="checkbox"]{
    accent-color: #358bb5;
}

input{
    field-sizing: content;
}

.form-control{
    display: inline-block;
    width: 50px;
}

#QuoteValuesFlex .input-group{
    width: 100%;
}
.input-group{
    width: fit-content;
}

.input-group-text{
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group-prepend-hover{
    display: none;
	position: absolute;
	text-align: left;
    background-color: #f1f1f1;
    padding: 2px;
	z-index: 1;
    margin-top: 50px;
    color:#3d3935
}

.input-group-prepend:hover .input-group-prepend-hover{
    display: inline;
}

.input-group > .form-control{
    flex: 0 0 auto;
    width: auto;
}

.group-name{
    border: none;
    background-color: transparent;
    font-weight: bold;
    color: white;
    cursor: pointer;
    /* flex-grow: 1; */
    text-align: center;
}

.Filter {
    border: none;
    position: sticky;
    top: 0;
    background: #3d3935;
    text-align: left;
    font-weight: bold;
    color: white;
    cursor:pointer;
    z-index: 500;
}

select{
    background-color: #f0f0f0;
    font-size: 1em;
}

/* Buttons */

.NavButton{
    color: #e91d2d !important;
}
.NavButton:hover{
    color: #3d3935 !important;
    text-decoration: underline;
}

.IconButton{
    height: 38px;
    display: flex;
    align-items: center;
}

.group-button{
    height: 26px;
    display: flex;
    align-items: center;
    margin-left: 4px;
}


/* Tables */

table > tbody .group-cell{
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #3d3935;
    height: 35px;
    border-width: 1px;
    border-color: #4d5154;
    color: white;
    font-weight: bold;
    cursor: move;
}

.StickyHeader{
    position: sticky;
    top: 172px;
    z-index: 1020;
}

table:not(#TotalMaterial, #details-table, #items-table, .saving-table) th:last-child{
    width: 50px;
}

#QuoteTable th:nth-child(4){
    min-width: 116px;
}

/* Override Bootstrap table defaults */
#QuoteTable tbody tr {
    height: 40px; /* Must accommodate 30px inputs */
    line-height: 1.3; /* Reduce line height */
}

#QuoteTable tbody td {
    vertical-align: middle;
    font-size: 0.9rem;
    padding: 2px 4px; /* Reduce cell padding */
    height: 40px; /* Match row height */
    line-height: 1.3;
}

#QuoteTable thead th {
    padding: 6px 4px; /* Reduce header padding */
    line-height: 1.3;
    height: 40px;
    vertical-align: middle;
}

/* Form controls */
#QuoteTable .form-control {
    height: 35px; /* Smaller inputs */
    padding: 2px 10px;
    font-size: 0.93rem;
    line-height: 1.3;
    min-width: 30px;
    width: fit-content;
}

/* Input groups */
#QuoteTable .input-group {
    width: fit-content;
    height: 35px;
}

#QuoteTable .input-group-text {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    font-size: 0.93rem;
    padding: 2px 10px;
    height: 35px;
    line-height: 1.3;
}

/* Center button in cell */
#QuoteTable td:last-child {
    text-align: center;
}

/* Fix SVG centering inside the button */
#QuoteTable .IconButton {
    height: 30px;
    padding: 3px 6px;
    display: inline-flex; /* Change to inline-flex */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
}

/* Ensure SVG is properly centered */
#QuoteTable .IconButton svg {
    display: block;
    margin: 0 auto;
}

/* Override Bootstrap table spacing */
#QuoteTable {
    line-height: 1.3;
}

/* Group Row - Match QuoteTable settings */
#QuoteTable .group-row {
    height: 40px; /* Match regular row height */
    line-height: 1.3;
}

#QuoteTable .group-row td {
    padding: 0 !important; /* Force remove all padding */
    height: 40px; /* Match regular cell height */
    border: none; /* Remove default table borders */
    vertical-align: top; /* Prevent centering issues */
    line-height: 1.3;
}

#QuoteTable tbody .group-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #3d3935;
    height: 40px; /* Match row height */
    width: 100%; /* Force full width */
    border: 1px solid #4d5154;
    color: white;
    font-weight: bold;
    cursor: move;
    margin: 0; /* Remove any margin */
    box-sizing: border-box; /* Include border in height calculation */
    line-height: 1.3;
}

#QuoteTable tr.group-row td:nth-child(2) .group-cell {
    justify-content: center; /* Override to center the content */
}

/* Group inputs - match form control settings */
#QuoteTable .group-name {
    border: none;
    background-color: transparent;
    font-weight: bold;
    color: white;
    cursor: pointer;
    height: 30px; /* Match form control height */
    font-size: 0.9rem; /* Match form control font size */
    padding: 2px 6px; /* Match form control padding */
    line-height: 1.3;
    position: center;
}

/* Group buttons - match IconButton settings */
#QuoteTable .group-button {
    height: 30px; /* Match IconButton height */
    padding: 3px 6px; /* Match IconButton padding */
    font-size: 0.9rem; /* Match form control font size */
    line-height: 1.3;
    display: flex;
    align-items: center;
}

#items-table th:first-child{
    width: 40px;
}

thead > tr{
    border-top: 0;
}

.Scrollable{
    overflow-y: scroll;
}

/* Other */

.TakeoffSideElement{
    width: 20%;
    margin-top: 2.5rem;
}

.TemplateDropdown:hover{
    text-decoration: underline;
    cursor: pointer;
}

.show{
    display:block;
}

.inline > *{
    display: inline;
}

svg {
  pointer-events: none;
}

.cell-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    width: 100%;
}

.item-name {
    flex-grow: 1;
    text-align: left;
}

.menu-button {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    color: #666;
    margin-left: 10px;
}

.menu-button:hover {
    background-color: #f0f0f0;
    color: #333;
}

.custom-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-width: 120px;
    z-index: 1000;
}

.custom-dropdown-menu.show {
    display: block;
}

.menu-option {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.menu-option:last-child {
    border-bottom: none;
}

.menu-option:hover {
    background-color: #f5f5f5;
}

/* Remarks Form */
.remarks-card {
    display: none; 
    z-index: 1;
    background-color: #ebebed;
    padding: 1.5rem;
    border-radius: 0.375rem;
    width: 500px;
    max-width: 90%;
}

/* This is the VISIBLE style, toggled by JavaScript. */
.remarks-card.show {
    display: block; /* Change from flex to block */
}

/* --- Form inside the card --- */
#remarksForm {
    width: 100%; 
}
#remarksForm .form-control {
    width: 100%;
    display: block; 
}

#remarksText {
    width: 100%;
}

.char-counter {
    text-align: right;
    font-size: 0.85rem;
    color: #6c757d; /* A standard Bootstrap secondary text color */
    margin-top: 0.25rem;
}

/* Purchase Unit Column - Hide when toggle is off */
.purchase-unit-hidden .purchase-unit-column {
    display: none;
}

#QuoteTable td:nth-child(12) {
    text-align: left;
    vertical-align: middle;
}

#QuoteTable td:nth-child(13) {
    text-align: center;
    vertical-align: middle; /* Also good for vertical centering */
}

/* Style for the scrollable container inside the SweetAlert */
.swal-scrollable-table {
    max-height: 400px; /* Adjust as needed */
    overflow-y: auto;
    border: 1px solid #ddd;
    margin-top: 1rem;
}

/* Make the table rows look clickable */
.swal-scrollable-table tbody tr:hover {
    background-color: #f1f1f1;
    cursor: pointer;
}

.quantity-cell {
    position: relative;
}

/* 
  2. This is the style for the tooltip div itself.
*/
.quantity-focus {
    display: none; /* Hidden by default */
    position: absolute; /* Positioned relative to the 'quantity-cell' <td> */
    top: 100%; /* Places the tooltip just below the cell */
    left: 0;
    margin-top: 5px; /* Adds a little space between the tooltip and the cell */
    
    background-color: #f1f1f1;
    color: #3d3935;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Optional: nice shadow effect */
    
    text-align: left;
    white-space: nowrap; /* Prevents the text from wrapping */
    z-index: 10; /* Ensures the tooltip appears on top of other content */
}

#TemplateTable {
    table-layout: fixed;
    width: 100%; /* Ensure the table spans the full width of its container */
}

.col-button {
    width: 5px; /* A fixed, narrow width for the button column */
    text-align: center; /* Ensures the button inside is centered */
}

.col-template-name {
    width: auto; /* Let this column take up all the leftover space */
}

.template-items-row {
    display: none;
}

.template-row-container {
    display: flex;
    align-items: center; /* Vertically aligns the button and the text */
    width: 100%;
    padding: 0.5rem; /* Adds some nice padding inside the cell */
}

#TemplateTable .col-item-button {
    width: 3%; /* A small, fixed width for the add/remove button */
}

#TemplateTable .col-item-product {
    width: 26%; /* Give the product name a good amount of space */
}

#TemplateTable .col-item-unit {
    width: 5%; /* Define other columns as needed */
}

#TemplateTable .col-item-purchase {
    width: 10%; /* Define other columns as needed */
}

#TemplateTable .col-item-make {
    width: 14%; /* Define other columns as needed */
}

#TemplateTable .col-item-cat1 {
    width: 14%; /* Define other columns as needed */
}

#TemplateTable .col-item-cat2 {
    width: 14%; /* Define other columns as needed */
}

#TemplateTable .col-item-cat3 {
    width: 14%; /* Give the product name a good amount of space */
}
.group-total-cost, .group-total-sell, .group-total-hours {
    padding-left: 3px;;
}

#QuoteTable tbody .group-round {
    justify-content: center;
}

#QuoteTable .group-round button {
    /* --- Visual Styling --- */
    background-color: #3d3935;
    color: white;            
    font-weight: bold;       
    border: 1px solid white; 

    /* --- Shape and Sizing --- */
    width: 30px;        
    height: 30px;       
    border-radius: 5px; 
    padding: 0;          

    display: flex;         
    align-items: center;    
    justify-content: center;   

    /* --- User Experience --- */
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

#QuoteTable .group-round button:hover {
    background-color: white;
    color: #3d3935;
}

header .container {
  /* Set a new, larger max-width. Bootstrap's default for xl is 1140px. */
  /* We are giving it more room here. Adjust the value as you see fit. */
  max-width: 1600px;
}

/* #RoundButton {
  display: inline-flex;
  align-items: center;      
  justify-content: center;  

  padding: 0.5rem; 

  width: 40px;   
  height: 40px;  
}

#RoundButton img {
  max-width: 100%;
  max-height: 100%;

  height: 1.5em;
  width: auto;
}

.grayscale {
    filter: grayscale(100%) brightness(96%) saturate(0%) contrast(129%) invert(100%);
    -webkit-filter: grayscale(100%) brightness(96%) saturate(0%) contrast(129%) invert(100%);
    -moz-filter: grayscale(100%) brightness(96%) saturate(0%) contrast(129%) invert(100%);
}

/* ===== Multi-Selection Styles ===== */

/* Multi-selected row highlight */
tr.multi-selected {
    background-color: #f8d7da !important; /* Bootstrap table-danger color */
}

tr.multi-selected td {
    background-color: #f8d7da !important;
}

/* Drag preview for multiple items */
.ui-sortable-helper.multi-drag {
    opacity: 0.8;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    position: relative;
}

/* Counter badge showing number of items being dragged */
.ui-sortable-helper.multi-drag::after {
    content: attr(data-count);
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    line-height: 24px;
    text-align: center;
}