/* === Base Styles === */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 40px;
  background-color: white;
  color: #333;
  max-width: 800px;
  font-size: 16px;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.background-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 880px;
  height: 100vh;
  object-fit: cover;
  z-index: -1;
  opacity: 0.25;
  pointer-events: none;
}



/* Page loader (insert near the top of layout.css) */
#pageLoader {
  position: fixed;
  inset: 0; /* top:0; right:0; bottom:0; left:0; */
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  z-index: 9999;
  transition: opacity 0.4s ease;
  background-color: #121212; /* dark fallback */
  color: #fff;
}

/* Light-mode loader */
html.light-mode #pageLoader,
body.light-mode #pageLoader {
  background-color: #fff;
  color: #333;
}

/* Hidden state for fade-out */
#pageLoader.hidden {
  opacity: 0;
  pointer-events: none;
}


input, textarea, button {
  font-size: 16px;
  padding: 8px 10px;
  line-height: 1.4;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease;
  margin-bottom: 8px;
}

button {
  cursor: pointer;
}

/* === Header & Title Block === */
header {
  border-bottom: 1px solid #ccc;
  margin-bottom: 20px;
}

.title-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1px 15px;
  padding: 0 10px;
}

.title-block .line1,
.title-block .line2 {
  font-size: 36px;
  margin: 0;
}

.title-block .line1 {
  flex-basis: 100%;
}

.title-block .line2 {
  flex: 1;
}

.title-block img {
  height: 60px;
  transform: translate(-10px, -25px);
  align-self: flex-start; /* Ensure image aligns to top */
}

/* === Top Bar Navigation === */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
  flex-wrap: wrap;
  gap: 10px;
}

.left-buttons,
.right-button {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  min-width: 80px;
}

.left-buttons button,
.right-button button {
  padding: 6px 10px;
  font-size: 15px;
  background-color: #444;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.left-buttons button:hover,
.right-button button:hover {
  background-color: #555;
}


.nav-button {
  padding: 6px 10px;
  font-size: 15px;
  background-color: #444;
  color: white;
  border: none;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  min-width: 80px;
}

.nav-button:hover {
  background-color: #222;
}

/* === Dark Mode Toggle === */
#darkToggle {
  padding: 6px 10px;
  font-size: 15px;
  background-color: #444;
  color: white;
  border: none;
  border-radius: 4px;
  min-width: 80px;
}

#darkToggle:hover {
  background-color: #222;
}

/* === Dark Mode Styles === */
body.dark-mode {
  background-color: #121212;
  color: #eee;
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode button {
  background-color: #333;
  color: #eee;
  border-color: #555;
}

body.dark-mode button:hover {
  background-color: #444;
}

body.dark-mode header {
  background-color: #121212;
  color: #eee;
}

body.dark-mode header h1,
body.dark-mode header button {
  color: #eee;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #ccc !important;
  opacity: 1;
}
html.dark-mode input:-webkit-autofill,
body.dark-mode input:-webkit-autofill,
html.dark-mode input:-webkit-autofill:focus,
body.dark-mode input:-webkit-autofill:focus,
html.dark-mode input:-webkit-autofill:hover,
body.dark-mode input:-webkit-autofill:hover {
  -webkit-text-fill-color: #eee !important;
  background-color: #333 !important;
  box-shadow: 0 0 0px 1000px #333 inset !important;
  transition: background-color 0s ease-in-out 0s;
}

html.dark-mode textarea:-webkit-autofill,
body.dark-mode textarea:-webkit-autofill,
html.dark-mode textarea:-webkit-autofill:focus,
body.dark-mode textarea:-webkit-autofill:focus,
html.dark-mode textarea:-webkit-autofill:hover,
body.dark-mode textarea:-webkit-autofill:hover {
  -webkit-text-fill-color: #eee !important;
  background-color: #333 !important;
  box-shadow: 0 0 0px 1000px #333 inset !important;
  transition: background-color 0s ease-in-out 0s;
}

body.dark-mode textarea {
  background-color: #333 !important;
  color: #eee !important;
  border-color: #555 !important;
}

/* === Form Layout === */
form > * {
  margin-bottom: 8px;
}

#reportForm label {
  display: block;
  margin-top: 2px;
  font-weight: 500;
}

#reportForm h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

#reportForm input,
#reportForm textarea {
  width: 100%;
  max-width: 100%;
  margin-bottom: 5px;
}

#reportForm button {
  width: auto;
  max-width: 200px;
  display: inline-block;
  margin-bottom: 5px;
  background-color: #0078D4;
  color: white;
  border: none;
  border-radius: 5px;
}

#reportForm button:hover {
  background-color: #005A9E;
}

/* === Responsive Tweaks === */
@media (max-width: 650px) {
  body {
    margin: 20px;
    font-size: 16px;
  }
  
    .footer {
    font-size: 16px !important;
 
}
.cool-font {
  font-size: 60px !important;
}


  .title-block {
    padding: 0 8px;
  }

  .title-block .line1,
  .title-block .line2 {
    font-size: 25px;
  }

  header {
    margin-bottom: 16px;
  }
}


/* === Invoice Form Specific === */
#invoiceForm label {
  display: block;
  margin-top: 2px;
  font-weight: 500;
}

#invoiceForm h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

#invoiceForm input,
#invoiceForm select {
  width: 100%;
  max-width: 100%;
  margin-bottom: 8px;
  display: block;
  padding: 8px 10px;
  font-size: 16px;
}

#invoiceForm button {
  width: auto;
  max-width: 200px;
  display: inline-block;
  margin-bottom: 8px;
  background-color: #0078D4;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 8px 14px;
  font-size: 16px;
}

#invoiceForm button:hover {
  background-color: #005A9E;
}

.item-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.item-row input {
  flex: 1;
  min-width: 100px;
}

/* === Footer Buttons === */
.footer {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer button {
  background-color: #444;
  color: white;
  padding: 10px 20px;
  font-size: 15px;
  border: none;
  border-radius: 4px;
}

.footer button:hover {
  background-color: #222;
}
.button-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.cool-font {
  font-family: 'Segoe UI', 'Open Sans', sans-serif;
  font-size: 2.5em;
  font-style: italic;
  font-weight: bold;
  font-weight: 700;
}

.bold-italic {
  font-weight: bold;
  font-style: italic;
}

.line2 {
  font-size: 1.2em;
  margin-top: -10px;
  color: #555;
}

.title-block {
  text-align: left;
  margin-bottom: 20px;
}

.title-block img {
  max-height: 80px;
  margin-top: 10px;
  display: block;
}
body.dark-mode .footer {
  background-color: #121212 !important;
  color: #eee !important;
  border-top-color: #444 !important;
}
.footer {
  background-color: #f2f2f2;
  padding: 20px;
  font-size: 16px;
  color: #444;
  text-align: center;
  border-top: 1px solid #ccc;
}

.footer a {
  color: #0066cc;
}

body.dark-mode .footer {
  background-color: #121212 !important;
  color: #eee !important;
  border-top-color: #444 !important;
}

body.dark-mode .footer a {
  color: #66b2ff !important;
}
.form-group {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.dropdown {
  background-color: #f2f2f2;
  color: #333;
  border: 1px solid #ccc;
  padding: 8px;
  font-size: 14px;
  border-radius: 4px;
}

/* Dark mode overrides */
body.dark-mode .form-group label {
  color: #eee;
}

body.dark-mode .dropdown {
  background-color: #1e1e1e;
  color: #eee;
  border: 1px solid #444;
}
#reportForm button#submitOrder {
  display: block;
  margin: 20px auto 0 auto;
}

.footer {
  font-size: 1rem !important;
  font-size: 14px !important;
}
/* restore blue on Add/Delete when dark-mode is active */
body.dark-mode button.add-btn,
body.dark-mode button.remove-btn {
  background-color: #007bff;
  color: #fff;
  border-color: #007bff;
}

  /* force each item row to be a flex‐row like Inventory */
  #items .item {
    display: flex !important;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.75em;
  }
  /* inputs keep natural size unless otherwise desired */
  #items .item input {
    flex: none;
  }
  /* group remove/add buttons inline */
  .button-row, .item > button.remove-btn {
    display: flex;
    gap: 0.5em;
  }
 /* make each .item a horizontal flex row */
  #items .item {
    display: flex !important;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.75em;
  }

  /* stop inputs from stretching full-width inside .item */
  #items .item input {
    display: inline-block !important;
    width: auto !important;
    flex: none !important;
  }

  /* keep the delete button inline too */
  #items .item .remove-btn {
    flex: none !important;
  }

  /* your bottom button row */
  .button-row {
    display: flex;
    gap: 0.5em;
    margin-top: 1em;
  }
  #items .item:first-child .remove-btn {
  display: none;
}
/* hide the delete button in the original first item-row only */
#items .item-row:first-child .remove-btn {
  display: none;
}
 /* 1) Force each row in the Quotes page to be a flex‐row */
  #items .item-row {
    display: flex !important;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.75em;
  }

  /* 2) Prevent inputs from stretching 100% */
  #items .item-row input {
    display: inline-block !important;
    width: auto !important;
    flex: none !important;
  }

  /* 3) Hide the first‐row Delete button (you already did this for .remove-btn) */
  #items .item-row:first-child .remove-btn {
    display: none;
  }
  
  /* 1) Make each item-row a flex line */
  #items .item-row {
    display: flex !important;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.75em;
  }

  /* 2) Prevent inputs from stretching full-width */
  #items .item-row input {
    display: inline-block !important;
    width: auto !important;
    flex: none !important;
  }

  /* 3) Hide the Delete button in the first/template row */
  #items .item-row:first-child .remove-btn {
    display: none;
  }

  /* 4) Keep your bottom buttons inline */
  .button-row {
    display: flex;
    gap: 0.5em;
    margin-top: 1em;
  }
button.add-btn,
button.remove-btn,
button[type="submit"],
#submitOrder,
#saveInventory {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 6px 10px;
  font-size: 15px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button.add-btn:hover,
button.remove-btn:hover,
button[type="submit"]:hover,
#submitOrder:hover,
#saveInventory:hover {
  background-color: #0056b3;
}
.button-row button.add-btn {
  background-color: #007bff;
  color: white;
  padding: 6px 10px;
  font-size: 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.button-row button.add-btn:hover {
  background-color: #0056b3;
}




/* one-line flex layout for each item row */
#items .item {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 0.75em;
}

/* group bottom buttons inline */
.button-row {
  display: flex;
  gap: 0.5em;
  margin-top: 1em;
}

/* hide Delete on the very first row */
#items .item:first-child .remove-btn {
  display: none;
}
/* Inventory + global add/remove button look */
button.add-btn,
button.remove-btn,
#reportForm button#submitOrder {
  background-color: #007bff;
  color: #fff;
  border: none;
  padding: 0.5em 1em;
  border-radius: 4px;
  cursor: pointer;
}

/* Inline the Inventory button row */
#inventoryForm .button-row {
  display: flex;
  gap: 0.5em;
  margin-top: 1em;
}
/* Strong, final override so .add-btn and submit inside .button-row match darkToggle spacing while keeping blue */
.button-row button.add-btn,
.button-row button[type="submit"],
.button-row .add-btn,
.button-row .remove-btn,
button.add-btn,
button.remove-btn,
button[type="submit"] {
  padding: 6px 10px !important;      /* match #darkToggle */
  font-size: 15px !important;         /* match #darkToggle */
  background-color: #007bff !important; /* keep blue */
  color: #fff !important;
  border: none !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease !important;
}

/* Hover state */
.button-row button.add-btn:hover,
.button-row button[type="submit"]:hover,
button.add-btn:hover,
button[type="submit"]:hover {
  background-color: #0056b3 !important;
}
/* Final override: ensure Save button on quote page matches .add-btn/darkToggle look */
#invoiceForm button.add-btn,
#invoiceForm button[type="submit"],
.button-row button.add-btn,
.button-row button[type="submit"],
button.add-btn,
button[type="submit"] {
  padding: 6px 10px !important;
  font-size: 15px !important;
  background-color: #007bff !important;
  color: #fff !important;
  border: none !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease !important;
}

#invoiceForm button.add-btn:hover,
#invoiceForm button[type="submit"]:hover,
.button-row button.add-btn:hover,
.button-row button[type="submit"]:hover,
button.add-btn:hover,
button[type="submit"]:hover {
  background-color: #0056b3 !important;
}
/* Ensure form fields stack vertically and align */
.page-container form,
.page-container form .form-row,
.page-container form .form-group {
  width: 100%;
}

/* Make labels full width and place input/select/textarea below each label */
.page-container form label {
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;
  font-weight: 600;
}

.page-container form input,
.page-container form select,
.page-container form textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: 15px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

/* Tighten vertical rhythm for compact look */
.page-container form h2 {
  margin-bottom: 12px;
}

.page-container .button-row {
  margin-top: 16px;
  justify-content: flex-start;
}

/* Make the submit button a normal inline button but same width as content if wanted */
.page-container .button-row button#submitOrder,
.page-container .button-row button[type="submit"] {
  padding: 8px 14px;
  min-width: 120px;
}

/* Responsive: keep the same stacking on small screens */
@media (max-width: 650px) {
  .page-container { padding: 0 12px; }
}
.button-row {
  display: block;
}
.button-row button {
  display: block;
  width: 20%;
  max-width: 320px; /* optional cap */
  margin: 0 auto;
}
/* Dark-mode selects — place at EOF of styles.css */
html.dark-mode select,
body.dark-mode select,
html.dark-mode .dropdown,
body.dark-mode .dropdown {
  background-color: #1e1e1e !important;
  color: #eee !important;
  border: 1px solid #444 !important;
  -webkit-appearance: none;
  appearance: none;
}

/* Make the internal options legible when the menu is opened */
html.dark-mode select option,
body.dark-mode select option {
  background-color: #1e1e1e;
  color: #eee;
}

/* Focus/hover states */
html.dark-mode select:focus,
body.dark-mode select:focus,
html.dark-mode .dropdown:focus,
body.dark-mode .dropdown:focus {
  outline: 2px solid rgba(102,178,255,0.18);
  outline-offset: 2px;
  box-shadow: none;
}

/* If you use custom select wrappers that show a faux arrow, keep it visible */
html.dark-mode .dropdown,
body.dark-mode .dropdown {
  background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.12) 50%),
                    linear-gradient(135deg, rgba(255,255,255,0.12) 50%, transparent 50%),
                    linear-gradient(to right, rgba(0,0,0,0.05), rgba(0,0,0,0.05));
  background-position: calc(100% - 20px) calc(1em + 2px), calc(100% - 15px) calc(1em + 2px), 100% 0;
  background-size: 6px 6px, 6px 6px, 1px 1.5em;
  background-repeat: no-repeat;
  padding-right: 34px; /* reserve space for arrow */
}

/* WebKit autofill safety for selects (defensive) */
html.dark-mode select:-webkit-autofill,
body.dark-mode select:-webkit-autofill {
  -webkit-text-fill-color: #eee !important;
  box-shadow: 0 0 0px 1000px #1e1e1e inset !important;
}

/* Optional: keep label contrast in dark mode */
html.dark-mode label,
body.dark-mode label {
  color: #ddd;
}
/* Neutral select baseline (applies to both themes) */
select,
.dropdown {
  -webkit-appearance: none;
  appearance: none;
  padding: 8px 10px;
  font-size: 15px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background-repeat: no-repeat;
  background-position: calc(100% - 18px) 50%;
  background-size: 10px;
  padding-right: 34px; /* reserve space for arrow */
  color: inherit;
}

/* Decorative arrow (subtle, works on light and dark backgrounds) */
select,
.dropdown {
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(0,0,0,0.25) 50%),
    linear-gradient(135deg, rgba(0,0,0,0.25) 50%, transparent 50%),
    radial-gradient(#0000 0, #0000 70%);
  background-size: 6px 6px, 6px 6px, 1px 1px;
  background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px), 100% 0;
  background-repeat: no-repeat;
}

/* Light-mode explicit (documentElement or body can contain the class) */
html.light-mode select,
body.light-mode select,
html.light-mode .dropdown,
body.light-mode .dropdown {
  background-color: #fff;
  color: #222;
  border-color: #cfcfcf;
}
html.light-mode select option,
body.light-mode select option {
  background-color: #fff;
  color: #222;
}

/* Dark-mode explicit */
html.dark-mode select,
body.dark-mode select,
html.dark-mode .dropdown,
body.dark-mode .dropdown {
  background-color: #1e1e1e !important;
  color: #eee !important;
  border-color: #444 !important;
}

/* Option readability when native menu opens */
html.dark-mode select option,
body.dark-mode select option {
  background-color: #1e1e1e;
  color: #eee;
}

/* Focus states (use same outline color family for both themes) */
select:focus,
.dropdown:focus {
  outline: 2px solid rgba(0,123,255,0.18);
  outline-offset: 2px;
  box-shadow: none;
}

/* WebKit autofill safety */
html.dark-mode select:-webkit-autofill,
body.dark-mode select:-webkit-autofill {
  -webkit-text-fill-color: #eee !important;
  box-shadow: 0 0 0px 1000px #1e1e1e inset !important;
}
html.light-mode select:-webkit-autofill,
body.light-mode select:-webkit-autofill {
  -webkit-text-fill-color: #222 !important;
  box-shadow: 0 0 0px 1000px #fff inset !important;
}.project-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.project-links a {
  display: block;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 6px 20px; /* matches video padding visually */
  font-size: 18px;
  color: #1f1f1f;
  background-color: #f0f0f0;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
  box-sizing: border-box;
}


/* Optional: still allow hover to slightly darken */
.project-links a:hover {
  background-color: #e0e0e0;
  color: #0f0f0f;
}

/* Light mode adjustments */
body.light-mode .project-links a,
html.light-mode .project-links a {
  color: #0a0a0a;
  background-color: #ccc;
}

body.light-mode .project-links a:hover,
html.light-mode .project-links a:hover {
  background-color: #bbb !important;
  color: #000 !important;
}
html.dark-mode .project-links a,
body.dark-mode .project-links a {
  background-color: #2a2a2a; /* 👈 slightly darker than #1f1f1f */
  color: #eee;
}
html.dark-mode .project-links a:hover,
body.dark-mode .project-links a:hover {
  background-color: #3a3a3a; /* 👈 visibly darker than #2a2a2a */
  color: #fff;
}
