/* ============================================================================
  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;
}

/* -----------------------------------------------
   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.1rem; /* Larger font for better readability */
}
th, td {
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
  color: #FFFFFF; /* White text */
  text-shadow: 1px 1px 2px #000000; /* Black drop shadow */
  border: 1px solid black; /* Black grid lines */
}
th {
  background-color: #24527A; /* Dark blue header */
}

/* 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;
}

/* -----------------------------------------------
   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-group {
  margin-bottom: 1rem;
}

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;
}
