/* ---------- BASIC RESET & GLOBAL STYLES ---------- */
* {
  box-sizing: border-box;
  margin: 0; 
  padding: 0;
}

/* Hide spinners in Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Hide spinners in Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}


body {
  font-family: "heebo", sans-serif;
  padding: 20px;
  max-width: 850px;
  margin: 0 auto;
  background: var(--bg-color, #1A192D);
  color: var(--text-color, #fff);
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

/* Safe area custom property for reuse */
:root { --safe-area-top: env(safe-area-inset-top, 0px); }

/* Style for terms and conditions links */
.terms-link {
  display: none; /* Hide all individual terms links since we now have one in footer */
  margin-top: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: #7C7C88;
}

.terms-link a {
  color: #16C887;
  text-decoration: underline;
}
body.dark-mode {
  --bg-color: #1e1e1e;
  --text-color: #f7f7f7;
}
input, select, textarea {
  font-size: 16px;
}
button {
  font-family: inherit;
  font-size: 1rem;
  background: #16C887;
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.2s;
}
button:active {
  background: #15B77B;
}


.no-margin {
  margin-top: 0 !important;
}



/* Header container styling */
.site-header {
  position: fixed;           /* Make it fixed */
  top: 0;                    /* Pin to top; absorb safe area inside with padding */
  left: 0;
  width: 100%;               /* Full viewport width */
  padding-top: var(--safe-area-top);
  height: calc(4rem + var(--safe-area-top));
  box-sizing: border-box;
  background-color: #1A192D;  /* Your header background */
  border-bottom: 1px solid #302F41; /* Bottom border */
  z-index: 1000;             /* Make sure it's on top */
  transition: transform 0.5s ease;  /* Smooth transition on transform */
}

/* When hidden via scroll, translate by header height + safe area */
.header-hidden {
  transform: translateY(calc(-1 * (4rem + var(--safe-area-top))));
}


/* Inner container to align logo and nav items */
.header-container {
  max-width: 850px;        /* Limit width if desired */
  margin: 0 auto;           /* Center the content */
  height: 100%;
  display: flex;
  align-items: center;      /* Vertically center logo and nav */
  justify-content: space-between;
  padding: 0 20px;          /* Provide horizontal padding if desired */
}

/* Logo styling */
.logo img {
  height: 40px;                   /* Adjust height so it fits well in 3rem header */
  width: 40px;
  margin-top: 0.5rem;
}

/* Navigation styling */
.header-nav ul {
  list-style: none;
  display: flex;
  margin: 0rem;
  padding: 0;
}

.header-nav li {
  margin-left: 1rem;              /* Space between the links */
  display: flex;                  /* Ensure internal content centers vertically */
  align-items: center;            /* Vertically center anchor or buttons */
}

.header-nav a {
  text-decoration: none;
  color: #fff;                    /* White text (or adjust as needed) */
  font-weight: normal;            /* Regular font weight */
}


/* Authentication UI Styles (scoped to header only) */
.site-header .auth-container {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.sign-in-btn, .about-btn {
  background: none;
  color: #fff;
  border: none;
  padding: 0rem 0rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  margin: 0;
  transition: background 0.2s;
}

.sign-up-btn {
  background: none;
  color: #8D87FF;
  border: 1px solid #8D87FF;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  margin: 0;
  transition: background 0.2s;
}

.sign-in-btn:hover, .sign-up-btn:hover {
  background: none;
}

.sign-out-btn {
  background: #666;
  margin-left: 0.5rem;
}

.sign-out-btn:hover {
  background: #555;
}

.user-menu {
  display: flex;
  align-items: center;
}

.user-email {
  color: #fff;
  font-size: 0.85rem;
  margin-right: 0.5rem;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Controls the top spacing of the Create a Bill Section between header */
#manageBillsPanel {
  margin-top: calc(4rem + var(--safe-area-top)); /* Header height + iOS status bar */
}

/* Default top spacing under the fixed header for non-app web pages */
.header-offset {
  margin-top: 6rem;
}


/* Controls the size of the section headers */
.panel h2 {
  font-size: 1.3rem;
}

/* Checkbox color */
input[type="checkbox"]:checked {
  accent-color: #16C887; /* or whatever color you want */
}


/* =========================================
   Universal Edit and Delete Button Styling
   ========================================= */

/* Edit button (blue) */
.btn-edit {
    font-family: inherit;
  background: #3B3A4B;  /* Red color for "X" */
  color: #D02061;
  border: none;
  border-radius: 10px;
  margin-top: 0;
  padding: 0.2rem 0.2rem;
  font-size: 0.8rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.2s;
  position: static;      /* No absolute positioning */
}
.btn-edit:active {
  background: #2E2E3B;        /* Slightly darker on hover, or your Manage Bills hover color */
}

.btn-edit img {
  width: 1.75rem;    /* Adjust as needed */
  height: 1.75rem;   /* Adjust as needed */
  display: block;
}

/* Delete button (red) */
.btn-delete {
    font-family: inherit;
  background: #3B3A4B;  /* Red color for "X" */
  color: #D02061;
  border: none;
  border-radius: 10px;
  margin-top: 0;
  padding: 0.2rem 0.2rem;
  font-size: 0.8rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.2s;
  position: static;
}
.btn-delete:active {
  background: #2E2E3B;  /* Darker red on hover */
}

.btn-delete img {
  width: 1.75rem;    /* Adjust as needed */
  height: 1.75rem;   /* Adjust as needed */
  display: block;
}

/* Checkbox button */
.btn-checkbox {
  font-family: inherit;
  background: #3B3A4B;  /* Same background as .btn-delete */
  color: #D02061;       /* Same font color as .btn-delete, or whatever you like */
  border: none;
  border-radius: 10px;
  margin-top: 0;
  padding: 0.2rem 0.2rem;
  font-size: 0.8rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.2s;
  position: static;
}

.btn-checkbox:active {
  background: #2E2E3B;  /* Same hover color as .btn-delete */
}

.btn-checkbox img {
  width: 1.75rem;
  height: 1.75rem;
  display: block; /* or inline-block if you prefer text alignment */
}




/* general share button button */
.btn-share {
  font-family: inherit;
  background: #3B3A4B;  /* Red color for "X" */
  color: #D02061;
  border: none;
  border-radius: 10px;
  margin-top: 0;
  padding: 0.2rem 0.2rem;
  font-size: 0.8rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.2s;
  position: static;
}
.btn-share:active {
  background: #2E2E3B;
}
.btn-share img {
  width: 1.75rem;
  height: 1.75rem;
  display: block;
}

/* share all button */
.share-all-btn {
  cursor: pointer;
  transition: background 0.2s;
  vertical-align: middle;
  background: #3B3A4B;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.3rem 1.2rem;
}
.share-all-btn:active {
  background: #2E2E3B;
}
.share-all-btn img {
   width: 1.75rem;
   height: 1.75rem;
   margin-left: -0.5rem; /* small gap between icon and text */
   vertical-align: middle;

}


/* For the "+Add" person button */
.add-person-button {
    font-family: inherit;
  background: #3B3A4B;  /* a green color, for example */
  color: #fff;
  border: none;
  border-radius: 10px;
  margin-top: 0;
  padding: 0.6rem 0.6rem;
  font-size: 0.85rem; 
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.2s;
  position: static;
}
.add-person-button:active {
  background: #2E2E3B;  /* slightly darker green on hover */
}

/* For the "Claim" button */
.claim-person-button {
    font-family: inherit;
  background: #3B3A4B;  /* an orange color, for example */
  color: #8D87FF;
  border: none;
  border-radius: 10px;
  margin-top: 0;
  padding: 0.6rem 0.6rem;
  font-size: 0.85rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.2s;
  position: static;
}
.claim-person-button:active {
  background: #2E2E3B;  /* slightly darker orange on hover */
}

/* Make sure disabled claim buttons have consistent styling */
.claim-person-button:disabled {
  background: #3B3A4B;
  color: #585766;
  cursor: default;
  opacity: 0.7;
}

.remove-diner-button {
    font-family: inherit;
  background: #d33;      /* red color, or match .claim-person-button? */
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.2s;
  position: static;
  margin-left: 0.3rem;    /* if you want a small gap from the diner name */
}
.remove-diner-button:active {
  background: #b11;
}


.shared-icon-button {
  background: #3B3A4B;
  color: #D09E20;
  border: none;
  border-radius: 10px;
  margin-top: 0;
  padding: 0.2rem 0.2rem;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}
.shared-icon-button:active {
  background: #2E2E3B;
}
.shared-icon-button img {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-block;
  vertical-align: middle;
}

/* Split button */
.split-icon-button {
  background: #3B3A4B;
  color: #D09E20;
  border: none;
  border-radius: 10px;
  margin-top: 0;
  padding: 0.2rem 0.2rem;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}
.split-icon-button:active {
  background: #2E2E3B;
}
.split-icon-button img {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-block;
  vertical-align: middle;
}

/* All button */
.all-icon-button {
  background: #3B3A4B;
  color: #D09E20;
  border: none;
  border-radius: 10px;
  margin-top: 0;
  padding: 0.2rem 0.2rem;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.all-icon-button:active {
  background: #2E2E3B;
}

.all-icon-button:disabled {
  cursor: not-allowed;
}

.all-icon-button img {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-block;
  vertical-align: middle;
}


.split-info {
  font-family: inherit;
  font-size: 16px;   /* or any size you like */
  color: #7C7C87;       /* or any color you like */
  margin-left: 0.2rem;  /* small gap from item name */
}



/* The parent container for the image + button Upload Receipt */
.crop-container {
  margin-top: 1rem;
  position: relative; /* ensures we can absolutely position children */
}

#runOcrBtn {
  display: none;  /* hidden by default until receipt is chosen */
  position: absolute; 
}

.collapsed {
  display: none !important;
}


/* Old crop-buttons (now unused since moved to modal footer) */
.crop-buttons {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 65px;
  background-color: #252538;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-top: 1px solid #302F41;
}


/* You can keep the visual styling for the buttons */
.btn-scan {
  background: #16C887;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  margin-right: 118px;
  margin-bottom: 15px;
}

.btn-scan:active {
  background: #15B77B;
}

.btn-cancel {
  background: #3B3A4B;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  margin-left: 118px;
  margin-bottom: 15px;
}

.btn-cancel:active {
  background: #2E2E3B;
}



#addAllOcrItemsBtn {
  margin-top: 0.5rem; 
  background: #fff;  
  color: #8D87FF;
  border: none;
  margin-top: 0;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
#addAllOcrItemsBtn:hover {
  background: #f0f0f0;
}
#addAllOcrItemsBtn:active {
  background: #e0e0e0;
}

#itemsManagementPanel table thead th {
  font-size: 12px;
  color: #7C7C87;
}

#itemsManagementPanel thead {
  display: none;
}

/* Panels & sections */
.panel, .summary-section, .item-management {
  background: var(--panel-bg, #252437);
  padding: 1rem;
  border-radius: 18px;
  margin-bottom: 1.35rem;
}
body.dark-mode .panel,
body.dark-mode .summary-section,
body.dark-mode .item-management {
  --panel-bg: #2a2a2a;
}
label {
  display: block;
  margin: 0.5rem 0 0.5rem;
}

/* Controls input fields */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
textarea {
  font-family: inherit;
  font-size: 16px;
  width: 100%;
  max-width: calc(100vw - 40px); /* 40px accounts for 20px left + 20px right */
  padding: 0.6rem;
  border-radius: 10px;
  border: none;
  background: #3B3A4B;
  color: #fff;
}

input::placeholder,
textarea::placeholder {
  color: #585866; /* or your desired color */
  opacity: 1;  /* optional: some browsers reduce opacity by default */
}

/* For broader compatibility (older browsers): */
::-webkit-input-placeholder {
  color: #585866;
}
:-ms-input-placeholder {
  color: #585866;
}


/* Controls spacing between input fields */
.input-wrapper {
  position: relative;
  margin-top: 2rem;
}

.input-container {
  position: relative;
  width: 100%;
}


.btn-clear {
  position: absolute;
  right: 0.5rem;        
  transform: translateY(-35%);
  background: none;
  border: none;
  color: #fff;          
  font-size: 1rem;      
  cursor: pointer;
  padding: 0rem;
}

.btn-clear:active {
  background: none; 
}

.clear-icon {
  width: 16px;   /* adjust as needed */
  height: 16px;  /* adjust as needed */
  display: block;
}



/* The wrapper for the Fee Amount field */
.fee-amount-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Specific styling for fee clear buttons */
.fee-clear {
  position: absolute;
  right: 5.5rem;        
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;          
  font-size: 1rem;      
  cursor: pointer;
  padding: 0rem;
}


.clear-icon {
  width: 16px;
  height: 16px;
  opacity: 0.5;
}

.clear-icon:hover {
  opacity: 1;
}

/* Adjust input padding for fee inputs */
.fee-amount-input {
  padding-right: 7rem !important; /* Make room for clear button and toggles */
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  background: #3B3A4B;
}

/* Number of people input fields for tax and tip */
#taxNumPeopleInput,
#tipNumPeopleInput {
  width: calc(100% - 5.2rem);
  box-sizing: border-box;
}

/* Container for fee toggle buttons */
.fee-toggle-group {
  display: flex;
  background-color: #3B3A4B;
  border-radius: 10px;
  overflow: hidden;
}

/* The fee toggle buttons ($ and %) */
.fee-toggle {
  padding: 0.6rem 0.6rem;
  border: none;
  color: #fff;
  font-weight: normal;
  min-width: 2.2rem;
  text-align: center;
  cursor: pointer;
  user-select: none;
  background: #3B3A4B;
  border-radius: 10px;
}

/* When a fee toggle is selected (active) */
.fee-toggle.selected {
  background-color: #8D87FF;
  color: #fff;
  font-weight: bold;
}





.flex-row {
  display: flex; 
  gap: 1rem; 
  align-items: center; 
  flex-wrap: wrap; 
  margin-bottom: 1rem;
}

/* OCR instructions text */
.ocr-helper-text {
  font-size: 0.9rem;
  color: #7C7C87;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

/* Bills list */
.bills-list {
  max-height: 250px;
  overflow-y: auto;
  margin-top: 1rem;
  border: none;
  border-radius: 4px;
  padding: 0rem;
}
.bill-item {
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  border-top: 1px solid #302F41;
  cursor: pointer;
  transition: background 0.2s;
}
.bill-item:active {
    color: #E0E0E0;
}
.bill-active {
  color: #16C887;
}
.bill-buttons {
  display: flex;
  gap: 0.4rem;
}

#billTitleSection {
  font-family: inherit;
  font-size: 1.4rem;
    font-weight: bold;
  color: #16C887;
  margin-top: 3rem;
  margin-bottom: 1rem;
    margin-left: 15px;
  text-align: left;
}

/* create a bill removes large gap at bottom */
#manageBillsPanel {
  padding-bottom: 0; 
}

/* aligns both the create bill and share all button */
.create-and-share-all-bttn-row {
  display: flex;
  flex-direction: row;
  align-items: center; /* Vertically centers the buttons */
  gap: 0.4rem;         /* Adjust spacing between buttons as needed */
}


/* Items table, summary table */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
table thead {
  background: none;
}
table th, table td {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  text-align: left;
  border-bottom: 1px solid #302F41;
  border-top: 1px solid #302F41;
}
body.dark-mode table thead {
  background: #444;
}
tr.green-row td {
  background: none;
}


/* Crop Modal */
.crop-modal {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - 36px), 850px);
  height: calc(100vh - 140px);
  background: var(--panel-bg, #252437);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  z-index: 10001;
}
body.dark-mode .crop-modal {
  --panel-bg: #2a2a2a;
}

.crop-modal-header {
  padding: 1rem;
  border-bottom: 1px solid #302F41;
}

.crop-modal-header h3 {
  color: #16C887;
  font-size: 1.4rem;
  font-weight: bold;
  margin: 0 0 0.4rem 0;
}

.crop-modal-header p {
  color: #fff;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.4;
}

.crop-modal-content {
  flex: 1;
  padding: 0rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.crop-modal-content img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.crop-modal-footer {
  padding: 0.5rem;
  border-top: 1px solid #302F41;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

/* Old crop container (now unused) */
.crop-container {
  max-width: 500px;
  margin: 0 auto;
}
.crop-container img {
  max-width: 100%;
  display: block;
}
#hiddenCanvas {
  display: none;
}

/* Increase click radius for cropper control points without changing visual appearance */
.cropper-point::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  z-index: 1;
}

.cropper-line::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  z-index: 1;
}


.browse-button {
  font-family: inherit;
  background: #16C887;
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  margin: 0rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.browse-button:active {
  background: #15B77B;        
}

/* Browse and Arrow container */
#uploadContainer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0rem;
  background: none;      
  border-radius: 10px;
  box-sizing: border-box;
}

.toggle-arrow {
  font-family: inherit;
  background: #3B3A4B;
  color: #7C7C88;
  border: none;
  padding: 0.6rem 0.6rem;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 0rem;
  margin-bottom: 0rem;
  transition: background 0.2s; 
}

.toggle-arrow:active {
  background: #2E2E3B;        
}


/* The OCR pannel that shows receipt list afterr scan */
.ocr-parse-output {
  background: #252437;
  border: none;
  border-radius: 10px;
  padding-top: 0.6rem;
  padding-top: 0.6rem;
  max-height: 312px;
  overflow-y: auto;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}
#ocrStatus {
  margin-top: 0.5rem; 
  color: #7C7C88; 
  font-size: 0.9rem;
}

/* Potential Items found in OCR list to control cells */
.ocr-items {
  border-top: 1px solid #302F41;  /* This creates the divider line */
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.ocr-add-button {
  font-family: inherit;
  background: #3B3A4B;
  color: #fff;
  border: none;
  padding: 0.6rem 0.6rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  margin: 0 !important;

}

.ocr-add-button:active {
  background: #2E2E3B;
}

/* OCR Panel Footer Styles */
.ocr-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 0rem;
  padding-top: 1rem;
  background-color: #8D87FF;
  border-radius: 0 0 15px 15px;
  padding: 1rem;
  margin-left: -1rem;
  margin-right: -1rem;
  margin-bottom: -1rem;
  width: calc(100% + 2rem);
}

/* The "+Add All" button in the footer */
.ocr-panel-footer .add-all-footer-btn {
  font-family: inherit;
  background: #fff;
  color: #8D87FF;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.ocr-panel-footer .add-all-footer-btn:hover {
  background: #f0f0f0;
}

.ocr-panel-footer .add-all-footer-btn:active {
  background: #e0e0e0;
}

/* The "Potential Items Found" text, pinned far right */
.ocr-panel-footer .potential-items-text {
  display: inline-block;
  text-align: right;
  margin-left: auto;
  width: auto;
  color: #fff;
  font-weight: normal;
}

/* Bold styling for cost within potential items text */
.ocr-panel-footer .potential-items-text strong {
  font-weight: bold;
  color: #fff;
}

/* Specific selector to make only the total cost bold but not "Potential Items Found:" text */
.ocr-panel-footer .potential-items-text strong:last-child {
  font-weight: bold;
}

.ocr-panel-footer .potential-items-text strong:first-of-type {
  font-weight: normal;
}

/* OCR +all add all button - keeping original styles for backward compatibility */
#addAllOcrItemsBtn {
  font-family: inherit;
  background: #fff;
  color: #8D87FF;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

#addAllOcrItemsBtn:hover {
  background: #f0f0f0;
}

#addAllOcrItemsBtn:active {
  background: #e0e0e0;
}




/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Items Management Footer
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
.items-management-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;  /* positions first child at left, last child at right */
  width: 100%;
  margin-top: 1rem;
}

/* The "Add Item" button in the footer */
.items-management-footer .add-item-footer-btn {
  display: inline-block;
  width: auto;
  margin-top: 0rem;
}

/* The "Total" text container, pinned far right */
.footer-totals-group {
  display: flex;       /* Aligns "Items:" and "Subtotal:" in a row */
  align-items: center; /* Vertically aligns them if their text sizes differ */
  gap: 15px;           /* This is the gap between "Items:" and "Subtotal:". Adjust 15px as needed. */
  margin-left: auto;
  color: #7C7C88;  
}







/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   JUST MY ITEMS TOGGLE BUTTON STYLES
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

/* Base styling for the #justMyItemsToggleBtn element */
#justMyItemsToggleBtn {
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s, filter 0.2s;
  margin-top: 0rem;

}

/* Inactive (Off) state class */
#justMyItemsToggleBtn.my-items-off {
  background-color: #3B3A4B; /* Example: same as your "btn-cancel" or "btn-delete" background */
  color: #fff;
}

/* Active (On) state class */
#justMyItemsToggleBtn.my-items-on {
  background-color: #8D87FF; /* Example: same as your main "Add" or "Confirm" color */
  color: #fff;
}

/* Optional: Pressed effect when user clicks (a quick highlight/darken) */
#justMyItemsToggleBtn:active {
  filter: brightness(0.9); 
}







/* Controls max height of the items management container */
.items-table-container {
  max-height: 312px; /* Adjust this value as needed */
  overflow-y: auto;
}

/* Controls max height of the bills summary container */
.bill-summary-container {
  max-height: 312px; /* Adjust this value as needed */
  overflow-y: auto;
}


/* Bill Summary Table Dividers */
#summaryTable td {
  border-top: 1px solid #302F41;  /* Change #3B3A4B to your desired color */
   padding-top: 0.6rem;
   padding-bottom: 0.6rem;
}

/* Styling for the breakdown text in the Bill Summary */
.bill-small-line-items {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: #7C7C87; /* Change this value to your desired color */
}

/* Controls the Bill Summary Subtotal Tax Tip Fees text */
.breakdown-label {
  font-size: 12px;
  color: #7C7C87;    /* Adjust color if needed */
  margin-bottom: 0.25rem;  /* Space between the label and its value */
}

.breakdown-value {
  font-size: 12px;
  color: #7C7C87;
}


.venmo-btn {
  font-family: inherit;
  font-size: 1rem;
  background: #008CFF;
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 0rem;
  transition: background 0.2s;
}

.venmo-btn:active {
  background: #006FC9;
}


.cash-app-btn {
  font-family: inherit;
  font-size: 1rem;
  background: #16C887;
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  margin-right: 0.4rem;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 0rem;
  transition: background 0.2s;
}

.cash-app-btn:active {
  background: #15B77B;
}


.copy-link-button {
  font-family: inherit;
  background: #16C887;
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 1rem;
  margin-bottom: 1rem;
  transition: background 0.2s;
}
.copy-link-button:active {
  background: #15B77B;
}


/* ============== ACTIONS MENU FOR ITEMS Management ============== */

/* The main edit options button that shows the pop-up menu (the "⋮" icon or an SVG) */
.actions-btn-icon {
  background: #3B3A4B;
  color: #D09E20;
  border: none;
  border-radius: 10px;
  margin-top: 0;
  padding: 0.2rem 0.2rem;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}
.actions-btn-icon:active {
  background: #2E2E3B;
}
.actions-btn-icon img {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-block;
  vertical-align: middle;
}

/* Style for the add-person icon button in owed mode Only */
.add-person-icon-button {
  background: #3B3A4B;
  color: #D09E20;
  border: none;
  border-radius: 10px;
  margin-top: 0;
  padding: 0.2rem 0.2rem;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.add-person-icon-button:active {
  background: #2E2E3B;
}

.add-person-icon-button img {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-block;
  vertical-align: middle;
}





/* The pop-up menu container itself */
.actions-menu {
  display: none;              /* hidden by default */
  position: absolute;         /* so we can place it near the button */
  right: 0;                   /* or left: 0, whichever you prefer */
  top: 110%;                  /* slightly below the button */
  background: #252437;        /* match your panel style, or pick something else */
  border: 1px solid #444;     /* or no border */
  border-radius: 10px;
  padding: 0.5rem;
  z-index: 999;               /* ensure it's above other elements */
  max-width: 80px;            /* give it a minimum width if you like */
}

/* Each menu item inside the pop-up */
.actions-menu-item {
    font-family: inherit;
  color: #fff;                /* text color */
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;         /* match your other button font-sizes if you like */
  border-radius: 4px;
}
.actions-menu-item:active {
  background: #2E2E3B;        /* highlight on hover */
}


#qrContainer img {
  display: block;       /* So it respects width settings properly */
  max-width: 100%;      /* Constrain the image to the container's width */
  height: auto;         /* Maintain aspect ratio */
  margin: 0 auto;       /* Optional: center it horizontally */
}

.qr-image {
  display: block;       /* ensure block-level for consistent scaling */
  max-width: 100%;      /* never exceed container's width */
  height: auto;         /* maintain aspect ratio */
  margin: 0 auto;       /* center horizontally, if desired */
}

/* QR Code container for resizing and positioning */
.qr-wrapper {
  width: 100%;          /* Let it be fluid up to a max width */
  max-width: 700px;     /* Cap the size if you want 300px max on larger screens */
  aspect-ratio: 1 / 1;  /* important to help Keep qr code from resizing when updating */
  position: relative;
  overflow: hidden;     /* Ensures internal content doesn't pop out */
  margin: 0 auto;       /* Center horizontally, optional */
}



/************************************************************
 * Shared Expense Modal Classes
 ************************************************************/

/* Modal Title (e.g. "Shared Expense") */
.shared-expense-title {
  margin-bottom: 0.25rem;
  font-size: 1.2rem;
  color: #fff;  /* adjust as you wish */
  text-align: left;
}

/* The description text below the modal title */
.modal-description {
  font-size: 1em; /* Example size */
  color: #fff;    /* Example color */
  /* Add any other styles you need, like margin, padding, etc. */
}

/* The text title label above the amount input fields */
.shared-expense-title-amount {
  font-weight: bold;
  display: block; 
  margin-bottom: 0.4rem;
  color: #fff;  /* adjust color as needed */
}

/* The text title label above the people input fields for assign names */
.shared-expense-title-people {
  font-weight: bold;
  display: block; 
  margin-bottom: 0rem;
  color: #fff;  /* adjust color as needed */
}

.shared-expense-title-people-spacing {
  margin-bottom: 0.5rem;

}

/* The "or" text, left-aligned */
.shared-expense-or {
  margin: 0.75rem 0;
  font-weight: bold;
  text-align: left;       /* specifically left-aligned */
  color: #fff;            /* if you want it visible on dark background */
}

/* The numeric field for "Number of People" */
.shared-split-count {
  width: 100%;
  max-width: 100%;
  height: 2.4rem;       /* example: match the text field's height */
  border-radius: 10px;
  border: none;
  background: #3B3A4B;
  color: #fff;
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
}

/* The row containing the manual name input and +Add button */
.shared-expense-add-diner-row {
  display: flex; 
  gap: 0.4rem; 
  margin-top: 0rem;
  align-items: center;  /* vertically center if you want */
}

/* The text input for manually adding a diner name */
.shared-add-diner-input {
  flex: 1;
  height: 2.4rem;       /* match the numeric input's height */
  border-radius: 10px;
  border: none;
  background: #3B3A4B;
  color: #fff;
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
}

/* +Add button for the shared expense */
.shared-add-diner-button {
  background: #3B3A4B;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 1rem;
  height: 2.4rem;       /* keep same height as input for uniform look */
  display: flex;
  align-items: center; 
  margin-top: 0rem;
}
.shared-add-diner-button:active {
  background: #2E2E3B;
}

/* The container for diners list, e.g. checkboxes */
.shared-diners-list {
  max-height: 150px; 
  overflow-y: auto;
  padding: 0.5rem;
  background: #3B3A4B; 
  border-radius: 10px; 
  margin-bottom: 1rem;
}

/* Each diner row */
.shared-diner-row {
  margin-bottom: 0.5rem;
}

/* The label wrapping each checkbox + name */
.shared-diner-label {
  color: #fff;
  font-size: 0.95rem;
}

/* The actual checkbox for each diner */
.shared-diner-checkbox {
  margin-right: 0.4rem;
  transform: scale(1.2);  /* optional: make checkbox bigger */
}

/* Placeholder styling for shared expense quantity inputs */
.shared-diner-qty::placeholder {
  color: #A2A1A9;
  opacity: 1;
}

.shared-diner-qty::-webkit-input-placeholder {
  color: #A2A1A9;
}

.shared-diner-qty:-ms-input-placeholder {
  color: #A2A1A9;
}


/* SHARED EXPENSE Mode Buttons */
.split-mode-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

/* Controls the line divider under the split mode buttons */
.split-mode-header-divider {
  border: none;
  border-top: 1px solid #302F41;
  margin: 1rem -1rem; /* the negative -1rem here makes the divider go all the way to the modal edge */
}

.split-mode-button {
  background: none;
  color: #7C7C88;
  border: none;
  border-radius: 0px;
  padding: 0rem 0rem;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 1rem;
  margin-top: 0rem;
}

.split-mode-button:active {
  color: #2E2E3B;
    background: none;
}

.split-mode-button.selected {
  background: none;
  color: #16C887;
  position: relative;
}

/* This adds a divider line under the selected text */
.split-mode-button.selected::after {
  content: "";
  position: absolute;
  top: 1.2rem;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px; /* same as your desired border thickness */
  background-color: #16C887;
  border-radius: 2px; /* adjust this value for rounder ends */
}

/* The "split by people" numeric input section */
.split-by-people-section {
  margin-bottom: 1rem;
}

/* The "split by amount" known-diners section */
.split-by-amount-section {
  margin-bottom: 1rem;
}





/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  background: rgba(26,25,45,0.9);
  display: none; 
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.modal {
  background: #252437; 
  border-radius: 18px;
  padding: 1rem;
  width: 430px;
  max-width: 90%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.modal h3 {
  margin-bottom: 0.5rem;
}

/* Ensure modal header can position internal absolute elements like the close button */
.modal-header-with-clear {
  position: relative;
}

.modal p {
  line-height: 1.5; /* Adjust this value - higher = more spacing, lower = less spacing */
}

/* Specific spacing for the Pay All Bills panel description */
.pay-all-desc {
  margin-top: 0.6rem;
  margin-bottom: 1.0rem;
}

/* This controls the spacing between the sections for the shared mode people button mode ui */
.modal .form-group {
  margin-bottom: 1rem;
}

/* This controls the spacing and alignment for the pop up modal buttons*/
.modal-buttons {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-start;
}

/* Close button inside standard modals (uses close_modal.png) */
.modal-close-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-top: -0.75rem;
}
.modal-close-btn img {
  width: 20px;
  height: 20px;
  display: block;
}

/* Temporarily hide bill row checkbox buttons in paying mode */
.btn-checkbox {
  display: none !important;
}





/* Specifically for the add diner modal pop up*/
.diner-list-add-diner {
  display: flex; 
  flex-wrap: wrap; 
  gap: 0rem; 
  margin-top: -1rem;
}


.form-group-add-diner {
  margin-top: 2rem;
  margin-bottom: 0rem;
}


.modal-buttons-add-diner {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-start;
}

.button-auto-added-diner {
  background-color: #3B3A4B;
  color: #fff;                
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}
.button-auto-added-diner:active {
  background-color: #2E2E3B;
}




/* Controls the styling of the various pop up modal buttons*/

.modal-confrim-actions-buttons {
  background-color: #16C887;
  color: #fff;                
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}
.modal-confrim-actions-buttons:active {
  background-color: #15B77B;
}


.modal-delete-actions-buttons {
  background-color: #D02061;
  color: #fff;                
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}
.modal-delete-actions-buttons:active {
  background-color: #A8194D;
}

.modal-cancel-actions-buttons {
  background-color: #3B3A4B;
  color: #fff;                
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}
.modal-cancel-actions-buttons:active {
  background-color: #2E2E3B;
}

.modal img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto; /* center horizontally if narrower than size */
}
.diner-list {
  display: flex; 
  flex-wrap: wrap; 
  gap: 0.5rem; 
  margin-top: 0.5rem;
}

#mainContentWrapper {
  display: none; /* Hidden until a bill is created. */
}

#adSection {
  margin-top: 1rem;
  text-align: center; /* optional, so your ad is centered */
}

/* How It Works Section */
#howItWorks {
  padding: 1rem 0;
  text-align: center;
}

/* Auth-aware gating to prevent howItWorks flashing for logged-in users */
/* Default: hide the section until auth state is known */
#howItWorks { display: none; }
/* Show only if explicitly unauthenticated */
body[data-auth-logged-in="false"] #howItWorks { display: block; }
/* Keep hidden for authenticated users */
body[data-auth-logged-in="true"] #howItWorks { display: none; }

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  color: #fff;
}

.feature-block {
  margin-bottom: 6rem;
}

.feature-image {
  width: 100%;
  max-width: 600px;
  border-radius: 14px;
  margin-bottom: 1.2rem;
}

.feature-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.feature-description {
  font-size: 1rem;
  line-height: 1.6;
  color: #d3d3d3;
  max-width: 550px;
  margin: 0 auto;
}

/* Print styles */
@media print {
  #toggleDarkModeBtn, #printBtn, #toggleUserModeBtn,
  .modal-overlay {
    display: none !important;
  }
  body {
    background: #fff !important; 
    color: #000 !important;
  }
}

/* Terms and conditions link styling */
.terms-link {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: #7C7C88;
}

.terms-link a {
  color: #16C887;
  text-decoration: none;
}

.terms-link a:hover {
  text-decoration: underline;
}

/* Terms Agreement Modal Styling */
.terms-agreement-link {
  color: #16C887; /* Default green link color - can be customized */
  text-decoration: none;
}

.terms-agreement-link:hover {
  text-decoration: underline;
}

/* Terms Agreement Modal Buttons */
.terms-agree-button {
  background-color: #16C887; /* Default green - can be customized */
}

.terms-agree-button:active {
  background-color: #15B77B; /* Darker shade for active state */
}

.terms-cancel-button {
  background-color: #3B3A4B; /* Default dark blue-gray - can be customized */
}

.terms-cancel-button:active {
  background-color: #2E2E3B; /* Darker shade for active state */
}

/* New CSS for the Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #1A192D;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000; /* Ensure the overlay is on top of all UI elements */
}

.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Footer styling */
.footer-copyright {
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #7C7C88;
  font-size: 0.85rem;
  line-height: 1; /* This changes spacing between terms text and copywright text */
}

.footer-terms {
  display: block;
  margin-bottom: 0rem;
}

.footer-terms a {
  color: #16C887;
  text-decoration: none;
}

.footer-terms a:hover {
  text-decoration: underline;
}

/* Hide footer copyright when user is logged in (web and app) */
body[data-auth-logged-in="true"] .footer-copyright {
  display: none !important;
}

/* Modal header with clear button */
.modal-header-with-clear {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* Clear button for modals */
.clear-modal-button {
  background-color: #8D87FF;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: -1.3rem;
}

.clear-modal-button:hover {
  background-color: #7973DD;
}

/* Hide all disabled buttons */
button:disabled {
  display: none !important;
}

/* Menu Modal Styles */
.menu-modal-overlay {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  background: none;
  z-index: 9999; /* Above other content */
}

.menu-modal-content {
  position: absolute;
  background: #16C887;
  border-radius: 18px;
  padding: 0.5rem;
  min-width: 180px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transform-origin: top right; /* Anchor point at top-right corner */
}

.menu-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1.5rem; /* Space for close button */
  padding-right: 1.5rem; /* Space for close button */
}

.menu-item {
  color: #fff;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.2s;
  font-size: 0.95rem;
  text-align: left;
  font-weight: 400;
}

.menu-item:hover {
  background: rgba(255,255,255,0.1);
}

.menu-item:active {
  background: rgba(255,255,255,0.2);
}

/* Close button inside modal */
.menu-close-btn {
  position: absolute;
  top: -4px;   /* 12px - 8px (modal padding) to account for container padding */
  right: 8px; /* 12px - 8px (modal padding) to account for container padding */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1; /* Above modal content */
}

.menu-close-btn img {
  width: 24px;
  height: 24px;
  display: block;
}

/* Menu button styling */
#menuBtn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  position: relative;
}

#menuBtn img {
  width: 24px;
  height: 24px;
  display: block;
}

/* The CSS rules below are no longer needed as we're using JavaScript for alignment */
/* Keeping only the button disabled rule above */

/* Live Viewing Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 20px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #007bff;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.toggle-label {
  margin-left: 8px;
  font-size: 14px;
  vertical-align: middle;
}

#liveViewingToggleContainer {
  display: flex;
  align-items: center;
}

/* Live indicator for bills with live viewing enabled */
.live-indicator {
  display: inline-block;
  background: #16C887;
  color: #fff;
  font-size: 0.7rem;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* FAQ Section Styling */
.faq-section {
  margin-top: 1.2rem;
  background-color: #1A192D;
}

.faq-section h2 {
  margin-bottom: 1.5rem;
  color: #7C7C88;
}

.faq-item {
  border-top: 1px solid #3B3A4B;
  margin-bottom: 0;
}

.faq-item:last-child .faq-question {
  padding-bottom: 1rem;
}

.faq-item:last-child {
  border-bottom: 1px solid #3B3A4B;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  cursor: pointer;
  color: #7C7C88;
  font-size: 1rem;
  transition: color 0.2s ease;
}

.faq-question:hover {
  color: none;
}

.faq-question[data-expanded="true"] {
  color: #fff;
}

.faq-arrow {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
  color: #585766;
}

.faq-question[data-expanded="true"] .faq-arrow {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.faq-answer.expanded {
  max-height: none;
  padding-bottom: 1rem;
}

.faq-answer p {
  margin-bottom: 0;
}
