table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    table-layout: auto;
}

/*
  This class is for tables that require a fixed layout.
  It overrides the default `table-layout: auto;`.
*/
table.fixed {
    table-layout: fixed;
}

/*
  Base styles for all table cells.
*/
th, td {
    padding: 5px;
    text-align: left;
    font-size: 12px;
    color: var(--text-light)
}

tr {
    height: auto; 
    border-top: 0px solid var(--c2);
}


.truncate-text {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-row {
    border-bottom: 2px solid var(--c2);
    padding: 5px;
}

.time-and-edit-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.edit-symbol {
    position: absolute;
    right: 0;
    bottom: 3px;
    cursor: pointer;
    color: var(--text-light);
}

.micros-symbol {
    display: flex;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
}

.highlighted-row {
    border: 2px solid var(--c3);
}

.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    height: 56px;
}

.clickable-row:hover {
    background-color: var(--c2);
}

.secondary-col {
    width: 50px;
    text-align: center;
}

.add-serving-col {
    width: 50px;
}

.value-unit-col {
    width: 60px;
}

.main-col-text {
    font-weight: bold; /* Added for clarity */
    color: var(--text-light);
}

.main-col-sub {
    font-size: 0.85em;
    color: var(--c5);
    margin-top: 4px;
    display: flex;
    column-gap: 0.5rem;
}


/* Custom swipable table */

.table-wrapper {
    max-width: 700px;
    margin-top: 24px;
    margin-bottom: 24px;
    overflow: hidden; /* This is important to clip the corners of the swipe containers */
}
        
/* Your original CSS for swipe functionality */
.swipe-container {
    display: flex;
    overflow: auto; /* Changed to auto to only show scrollbar when needed */
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    border-bottom: 1px solid var(--c2);
}

/* Last row shouldn't have a border */
.table-wrapper .swipe-container:last-child {
    border-bottom: none;
}

/* scrollbar should be hidden */
.swipe-container::-webkit-scrollbar {
    display: none;
}
/* For Firefox and IE */
.swipe-container {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* main element should always snap into view */
.swipe-element {
    scroll-snap-align: start;
    padding: 5px;
}

/* actions and element should be 100% wide */
.action,
.swipe-element {
    min-width: 100%;
    box-sizing: border-box; /* Ensures padding is included in the width */
}
        
/* Action container styling */
.action {
    display: flex;
    align-items: center;
    padding: 12px;
}

/* action text should remain sticky */
.action-text {
    color: var(--c4);
    font-weight: bold;
    position: sticky;
    left: 16px;
    right: 16px;
}
        
/* action background colors */
.left {
    background-color: var(--c10);
}

.right {
    justify-content: flex-end;
    background-color: var(--c10);
}

/* Added CSS to make the row content look like columns */
.row-content {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.col, 
.main-col,
.unit-col {
    width: 33%; /* Creates 3 columns */
    white-space: nowrap; /* Prevents text from wrapping */
    overflow: hidden;
    text-overflow: ellipsis; /* Adds '...' if text is too long */
}

.main-col {
    width: 85%;
}

.unit-col {
    color: var(--text-light);
    width: 15%;
    min-width: 60px;
    padding-left: 8px;
}

.quantity-col {
    width: 20%;
    min-width: 70px;
    padding-left: 8px;
}

.col:first-child {
    padding-right: 10px;
}

.row-content > span {
  font-size: 14px; /* Adjust the value as needed */
}

.progress-row {
    width: 100%;
    max-width: 500px;
}

/* Remove border from the progress row */
tr.progress-row-tr {
    border: none !important;
    line-height: 0 !important;
}

/* Remove top padding/margin and add bottom padding/margin */
td.progress-row-td {
    border: none !important;
    line-height: 0 !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    padding-bottom: 0px !important; /* Add bottom padding */
    margin-bottom: 0px !important; /* Add bottom margin */
}

/* Ensure the progress bar div has no top padding/margin */
div.progress-row {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 10px !important; /* Optional: Add bottom margin */
    padding-bottom: 0px !important; /* Optional: Add bottom padding */
}
