/* ============================================================================
  List Commissions - Main Stylesheet
  (c) 2025 Rainlight Crafts
============================================================================ */

/* -----------------------------------------------
   Base Layout and Global Styling
----------------------------------------------- */
body {
  font-family: sans-serif;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 1rem;
}

h1 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.person-card {
  max-width: 600px;
  margin: 2rem auto;
  padding: 1rem;
  background-color: rgb(218, 243, 79);  /* Yellow from logo */
  border-radius: 8px;
  box-shadow: 1px 1px 5px rgba(0,0,0,0.1);
  font-size: 1.05rem;
  color: #000;
}

.person-name{
  font-weight: bold;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.person-address,
.person-contact {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.person-details-container {
  display: flex;
  justify-content: space-between;
  max-width: 600px;
  margin: 1rem auto;
  padding: 0 1rem;
}

.person-left {
  text-align: left;
  flex: 1;
}

.person-right {
  text-align: right;
  flex: 1;
}

.future-data {
  font-style: italic;
  color: #999;
}

/* -----------------------------------------------
   Logo Styling
----------------------------------------------- */
.logo {
  margin-bottom: 2rem;
  text-align: center;
}

.logo img {
  display: block;
  margin: 0 auto;
  max-width: 600px;
  width: 100%;
  height: auto;
}

/* -----------------------------------------------
   Table Styling
----------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 1.0rem; /* Larger font for better readability */
}
th, td {
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
  color: #FFFFFF; /* White text */
  text-shadow: 1px 1px 4px #000000; /* Black drop shadow */
  border: 1px solid black; /* Black grid lines */
}
th {
  background-color: #24527A; /* Dark blue header */
}

td.highlight {
  font-weight: bold;
  color: #fff;
  background-color: #c0392b; /* Red for emphasis */
}

/* Zebra striping for table rows */
tbody tr:nth-child(odd) {
  background-color: #70B945; /* Green from logo */
}
tbody tr:nth-child(even) {
  background-color: #24527A; /* Blue from logo */
}

/* -----------------------------------------------
   Action Button Styling
----------------------------------------------- */
.action-buttons {
  display: flex;
  gap: 0.5rem;
}
.action-buttons a {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background-color: #333;
  color: white;
  text-align: center;
  line-height: 28px;
  text-decoration: none;
  font-weight: bold;
  font-family: sans-serif;
  font-size: 16px;
  position: relative;
}
.action-buttons a:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  padding: 4px 6px;
  border-radius: 3px;
  white-space: nowrap;
  font-size: 0.75rem;
  z-index: 10;
  opacity: 0.9;
}
.action-buttons a.delete {
  background-color: #c0392b; /* Red background for delete */
  color: #ffffff; /* White X */
  font-weight: 700;
}

/* -----------------------------------------------
   Top Menu Buttons
----------------------------------------------- */
.menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  max-width: 600px;
  margin: 2rem auto 0 auto;
  width: 100%; /* Important for shrinking */
}

.menu a {
  display: block;
  width: 100%;
  padding: 1rem;
  background-color: #007acc;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 1.1rem;
  text-align: center;
}
.menu a:hover {
  background-color: #005fa3;
}

/* Edit Button on View Page */
.menu a.edit-button {
  background-color: #70B945; /* Green from theme */
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 1.1rem;
  padding: 1rem;
}

.menu a.edit-button:hover {
  background-color: #5aa737; /* Slightly darker green on hover */
}

.menu button {
  display: block;
  width: 100%;
  padding: 1rem;
  background-color: #70B945; /* Theme green */
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: bold;
  text-align: center;
  border: none;
  cursor: pointer;
}

.menu button:hover {
  background-color: #5aa737;
}

.menu button:disabled {
  background-color: #cccccc;
  color: #666666;
  cursor: not-allowed;
}

/* === Save Changes Button (on Edit page) === */
button.save-button {
  background-color: #70B945; /* Green theme */
}

button.save-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === Change Password Button (on Change_password page) === */

button.menu-button {
  background-color: #cccccc; /* Default gray when disabled */
  color: #666666;
  cursor: not-allowed;
  opacity: 0.6;
  transition: background-color 0.3s ease, opacity 0.3s ease;
}

button.menu-button.enabled {
  background-color: #70B945; /* Green when enabled */
  color: white;
  cursor: pointer;
  opacity: 1;
}

button#submitButton.enabled {
  background-color: #70B945;
  cursor: pointer;
  opacity: 1;
}

button#submitButton:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.menu-button {
    background-color: #007acc;
    color: white;
    padding: 1rem;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: not-allowed;
    opacity: 0.6;
    border: none;
}

.menu-button.ready {
    background-color: #70B945; /* your green */
    color: white;
    cursor: pointer;
    opacity: 1;
}

.nav-button {
    display: inline-block;
    width: 100%;
    max-width: 600px;
    padding: 1rem;
    background-color: #24527A; /* same blue as theme */
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 1px 1px 2px #000;
    transition: background-color 0.3s ease;
}

.nav-button:hover {
    background-color: #1b3e5b;
}

/* === Unsaved Changes Warning === */
#unsavedWarning {
  text-align: center;
  margin: 1rem auto;
  color: red;
  font-weight: bold;
  display: none;
}
/* -----------------------------------------------
   Flash Messages
----------------------------------------------- */
.flash-message {
  opacity: 1;
  transition: opacity 1s ease;
  text-align: center;
  padding: 1rem;
  margin: 1rem auto;
  max-width: 800px;
  border-radius: 6px;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#flash-message.fade-out {
  opacity: 0;
}

.flash-message.success {
  background-color: #70B945; /* Green for success */
  color: white;
}

.flash-message.error {
  background-color: #c0392b; /* Red for error */
  color: white;
}

/* -----------------------------------------------
   Modal Confirm Dialogs
----------------------------------------------- */
#deleteConfirmOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.confirm-dialog {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
    
.confirm-buttons {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.confirm-buttons button {
  padding: 0.5rem 1rem;
  font-weight: bold;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.confirm-buttons .confirm {
  background-color: #c0392b; /* Red */
  color: white;
}

.confirm-buttons .cancel {
  background-color: #24527A; /* Blue from theme */
  color: white;
}

.custom-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border: 2px solid #888;
  border-radius: 8px;
  padding: 1.5em;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.custom-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

.custom-dialog form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.custom-dialog input[type="text"] {
  width: 100%;
}

.category-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border: 2px solid #888;
  border-radius: 8px;
  padding: 1.5em;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  display: none; /* Hidden by default */
  width: 500px;
  max-width: 90vw;
}

.category-dialog.open {
  display: block;
}

.material-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border: 2px solid #888;
  border-radius: 8px;
  padding: 1.5em;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  display: none; /* Hidden by default */
  width: 500px;
  max-width: 90vw;
}

.material-dialog.open {
  display: block;
}

/* -----------------------------------------------
   Green Submit Button (for Commission Form)
----------------------------------------------- */
.green-button {
  display: inline-block;
  width: 100%;
  max-width: 600px;
  padding: 1rem;
  background-color: #70B945; /* Green from logo */
  color: white;
  font-weight: bold;
  font-size: 1.1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 1px 1px 2px #000;
  text-align: center;
  text-decoration: none;
}
.green-button:hover {
  background-color: #5da936; /* Darker green on hover */
}

/* -----------------------------------------------
   Commission Form Styles
----------------------------------------------- */
form {
  max-width: 600px;
  margin: 0 auto;
}

.form-section { 
  margin-bottom: 1.5rem; 
}

.form-group {
  margin-bottom: 1rem;
}

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

.category-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.5rem; /* space between select and buttons */
}

.category-row select {
  flex: 1;
}

#addCategoryRow {
  display: flex;
  align-items: center;
  gap: 1rem; /* space between label and button */
  margin-bottom: 10px;
}

.icon-button {
  padding: 0.25rem 0.5rem;
  font-size: 1rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

.icon-button.red {
  margin-top: -10px;
  background-color: #e74c3c;
  color: white;
}

.icon-button.green {
  background-color: #2ecc71;
  color: white;
}

.photo-row { 
  display: flex; 
  flex-wrap: wrap;
  align-items: center; 
  gap: 0.5rem;
}

.photo-drop-area {
  border: 2px dashed #ccc;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  background-color: #f9f9f9;
  transition: border-color 0.3s ease;
}

.photo-drop-area.dragover {
  border-color: #70B945;
  background-color: #eef9e9;
}

.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.photo-preview {
  position: relative;
  display: inline-block;
}

.photo-preview img {
  width: 100px;
  height: auto;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 0 4px rgba(0,0,0,0.2);
}

.photo-preview .remove-btn { 
  position: absolute; 
  top: -8px; 
  right: -8px; 
  background: red; 
  color: white; 
  border-radius: 50%; 
  padding: 0 4px; 
  cursor: pointer; 
  font-weight: bold;
  z-index: 1;
}

.preview-wrapper {
  position: relative;
  display: inline-block;
  width: fit-content;
  margin: 10px;
  text-align: center;
}

.preview-wrapper img {
  width: 120px;
  height: auto;
  display: block;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  background: red;
  color: white;
  border-radius: 50%;
  padding: 0 4px;
  cursor: pointer;
  font-weight: bold;
  z-index: 10;
}

.checkbox-row {
  margin-top: 6px;
  font-size: 0.9em;
  display: flex;
  justify-content: space-around;
}

.photo-checkboxes {
  margin-top: 4px;
  font-size: 0.9em;
}

.metadata-form {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.meta-thumb img {
  width: 80px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 0 3px rgba(0,0,0,0.2);
}

.scroll-container { 
  overflow-x: auto; 
  max-width: 100%; 
  white-space: nowrap; 
  padding: 0.5rem 0; 
}

.scroll-container::-webkit-scrollbar { 
  height: 6px; 
}

.scroll-container::-webkit-scrollbar-thumb { 
  background: #ccc; 
  border-radius: 4px; 
}

.locked-submit { 
  display: block; 
  width: 200px; 
  margin: 2rem auto; 
  background: #ccc; 
  border: none; 
  padding: 1rem; 
  cursor: not-allowed; 
  text-align: center; 
}

.locked-submit.ready { 
  background-color: #70B945; 
  cursor: pointer; 
  color: white; 
}


label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 0.5rem;
  box-sizing: border-box;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

textarea {
  height: 300px;
  resize: vertical;
}

.city-state-postal {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.city-state-postal input[type="text"],
.city-state-postal select {
  padding: 0.5rem;
  font-size: 1rem;
  box-sizing: border-box;
}

.city-state-postal input[name="city"] {
  flex: 2;
}

.city-state-postal select[name="state"] {
  flex: 1;
}

.city-state-postal input[name="postalCode"] {
  flex: 1;
}

/* -----------------------------------------------
Logged in banner
----------------------------------------------- */
.logged-in-banner {
  background-color: #24527A; /* matches your dark blue theme */
  color: white;
  text-align: center;
  padding: 0.75rem;
  font-size: 1rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #70B945; /* green accent */
}

.logged-in-banner a {
  color: #70B945; /* green */
  font-weight: bold;
  text-decoration: none;
  margin-left: 0.5rem;
}

.logged-in-banner a:hover {
  text-decoration: underline;
}

/* -----------------------------------------------
   Page Footer
----------------------------------------------- */
footer {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: #888;
}

.good {
    color: green;
}

.bad {
    color: red;
}

/* -----------------------------------------------
   Scrollable table
----------------------------------------------- */

.scrollable-table {
  max-height: calc(3.0em * 6); /* 1.5em height * 5 rows + 1 for padding */
  overflow-y: auto;
  border: 1px solid #ccc;
  margin: 1rem auto;
}

.scrollable-table table {
  width: 100%;
  border-collapse: collapse;
}

.scrollable-table thead th {
  position: sticky;
  top: 0;
/*  background-color: #f5f5f5; */
  z-index: 1;
  border-bottom: 2px solid #aaa;
/*  height: 1.0em; */
}

.dropdown-list {
  border: 1px solid #ccc;
  background: #fff;
  max-height: 150px;
  overflow-y: auto;
  margin-top: 0.5rem;
  z-index: 1000;
  position: relative;
}

.search-result {
  padding: 0.5rem;
  cursor: pointer;
}

.search-result:hover {
  background-color: #eee;
}

#isCommissionCheckbox {
  margin-top: 0.25rem;
}

.form-group.commission-toggle {
  margin-top: -0.55rem;
  margin-bottom: 0.5rem;
}

#itemList th,
#itemList td {
  text-align: center;      /* Horizontal centering */
  vertical-align: middle;  /* Vertical centering */
}

#itemList a {
  color: white;
}

.sort-icons {
  display: inline-flex;
  flex-direction: column;
  margin-left: 4px;
  align-items: center;
  justify-content: center;
  gap: 1px;
  vertical-align: middle;
}

.sort-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 10pt;         /* 9pt + 9pt = 18pt total */
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.sort-btn:hover {
  color: #ffd700;          /* Optional: gold hover effect */
}

th {
  white-space: nowrap;
}

th.sorted {
  color: #e5f63f;           /* gold-ish highlight */
  font-weight: bold;
}

th .sort-indicator {
  margin-left: 4px;
}

svg {
  fill: white;
  width: 24px;
  height: 24px;
}

img.icon {
  vertical-align: middle; /* or try: text-bottom, sub, top */
  height: 1em;             /* match text height */
}

div.commission-column {
  position: relative;
  top: 2px; /* Pushes the whole content down */
}

.mini-dialog {
  position: absolute;
  background: white;
  border: 1px solid #aaa;
  padding: 0.5rem 1rem;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
  border-radius: 6px;
  z-index: 1000;
}

.dialog-close {
  position: absolute;
  top: 8px;
  left: 12px;
  cursor: pointer;
  font-size: 18px;
  color: red;
  font-weight: bold;
  z-index: 10;
}

#categoryDialog {
  padding-top: 2rem; /* extra room for close button */
}

#statusDialog {
  position: absolute;
  background: white;
  border: 1px solid #aaa;
  padding: 1rem;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
  border-radius: 6px;
  z-index: 1000;
}

.dialog-actions {
  margin-top: 1rem;
  text-align: right;
}

.dialog-actions button {
  margin-left: 0.5rem;
}

.status-text.clickable {
  cursor: pointer;
  text-decoration: underline dotted;
}


    .photo-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
    }

    .photo-grid img {
      height: 100px;
      border: 1px solid #007A3D;
      border-radius: 4px;
    }

    .badge {
      font-size: 0.75rem;
      background: #eef;
      padding: 2px 6px;
      margin-left: 4px;
      border-radius: 4px;
      text-align: center;
    }

    .status-stage {
      font-style: italic;
    }

    .badge.blue { background-color: #cce5ff; color: #004085; }
    .badge.green { background-color: #d4edda; color: #155724; }
    
    .section-card {
      background-color: #007A3D; /* Theme green */
      color: white;
      padding: 1rem;
      border-radius: 1rem;
      box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
      margin-bottom: 1rem;
      text-shadow: 1px 1px 2px black;
    }

    .section-header {
      color: #e5f63f;
      text-shadow: 1px 1px 2px black;
    }

a {
  color: yellow;
}

.delete-photo {
  position: absolute;
  top: 2px;
  left: 2px;
  background-color: red;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-weight: bold;
  cursor: pointer;
}
