/* Vehicle Booking Manager - Form Styles v0.4.0 */

/* Apply border-box globally within the plugin */
.vbm-booking-form,
.vbm-booking-details,
.vbm-booking-history {
  box-sizing: border-box;
}

/* Define CSS variables for easy customization */
:root {
  --vbm-primary-color: #143422;
  --vbm-hover-color: #1f5735;
  --vbm-border-color: #bfc9d1;
  --vbm-error-color: #e74c3c;
  --vbm-success-color: #1a482d;
  --vbm-pending-color: #5d5d5d;
  --vbm-completed-color: #2d3e7b;
}

/* General form layout */
form {
  margin-bottom: 2em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  padding: 0.5em;
  border: 1px solid var(--vbm-border-color);
  border-radius: 3px;
  font-size: 1em;
  width: 100%;
  max-width: 350px;
  box-sizing: border-box;
  margin-bottom: 0.5em;
  transition: border-color 0.2s; /* Add transition for focus */
}

/* Add focus styles for accessibility */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none; /* Remove default outline */
  border-color: var(--vbm-primary-color); /* Highlight border */
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.1); /* Optional: subtle shadow */
}

input[type="email"]:invalid {
  border-color: var(--vbm-error-color);
}

/* Increase specificity to override theme styles like Hello Elementor */
.vbm-booking-form .button,
.vbm-booking-form button,
.vbm-booking-form input[type="submit"],
#vbm-feedback-form .button,
#vbm-feedback-form button,
.vbm-request-history-center .button {
  background: var(--vbm-primary-color);
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: 1em;
  cursor: pointer;
  padding: 0.5em 1.2em;
  transition: background 0.2s, color 0.2s;
}

.vbm-booking-form .button:hover,
.vbm-booking-form button:hover,
.vbm-booking-form input[type="submit"]:hover,
#vbm-feedback-form .button:hover,
#vbm-feedback-form button:hover,
.vbm-request-history-center .button:hover {
  background: var(--vbm-hover-color);
  color: #fff;
}

/* Add focus styles for accessibility */
.vbm-booking-form .button:focus,
.vbm-booking-form button:focus,
.vbm-booking-form input[type="submit"]:focus,
#vbm-feedback-form .button:focus,
#vbm-feedback-form button:focus,
.vbm-request-history-center .button:focus,
.vbm-create-another:focus {
  /* Use box-shadow for a cleaner focus ring. !important is used to ensure it overrides stubborn theme styles. */
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(20, 52, 34, 0.4) !important;
}

.vbm-request-history-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.vbm-export-csv-button {
  margin-bottom: 2em;
}

.create-another {
  display: block;
  font-size: large;
  position: relative;
  margin: 20px auto;
  padding: 20px;
}

.vbm-create-another {
  padding: 10px 18px;
  background-color: #dec37d;
  color: white;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
}
.vbm-create-another:hover {
  color: black;
}

.vbm-message {
  margin: 1em 0;
  padding: 0.8em 1em;
  border-radius: 3px;
  font-weight: bold;
  background: #f8f8f8;
  color: #333;
}

.vbm-message-success {
  background: #e6fbe7;
  color: var(--vbm-success-color);
  border: 1px solid #b2e2c6;
}

.vbm-message-error {
  background: #ffeaea;
  color: var(--vbm-error-color);
  border: 1px solid #f5bdbd;
}

.vbm-request-history-form {
  display: flex;
  gap: 0.5em;
  align-items: center;
  margin-top: 1em;
}

.vbm-history-message {
  font-weight: bold;
  min-height: 1.5em;
}

/* Styles for the booking history table */
.vbm-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
}

.vbm-table th,
.vbm-table td {
  padding: 0.5em 1em;
  text-align: left;
  border-bottom: 1px solid #ddd; /* Add a subtle border */
}

.vbm-table th {
  background: #f1f1f1;
  font-weight: bold;
}

.vbm-table tr:nth-child(even) {
  background: #fafbfc;
}

/* Ensure feedback details table is styled consistently */
.vbm-booking-details-table th,
.vbm-booking-details-table td {
  text-align: left;
  vertical-align: top;
}

.vbm-status {
  padding: 4px 8px;
  border-radius: 3px;
  font-weight: 600;
  display: inline-block;
}
.vbm-status-approve {
  background: #c6f7d2;
  color: var(--vbm-success-color);
}
.vbm-status-decline {
  background: #ffd1d1;
  color: var(--vbm-error-color);
}
.vbm-status-pending {
  background: #e0e0e0;
  color: var(--vbm-pending-color);
}

.vbm-status-completed {
  background: #dce4ff;
  color: var(--vbm-completed-color);
}

.tablenav-pages {
  margin-top: 1em;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .vbm-row {
    flex-direction: column;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  select,
  textarea {
    max-width: 100%; /* Full width on smaller screens */
  }
}

.vbm-field input[type="submit"] {
  background: #143222 !important;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  margin-top: 10px;
}

/* Styles for conditional feedback fields to prevent label wrapping */
.approver-notes,
.decline-reason {
  margin-bottom: 1em;
}

.approver-notes label,
.decline-reason label {
  display: block; /* Ensures label is on its own line */
  margin-bottom: 5px; /* Adds a little space above the input field */
}

.driver-name > label,
.driver-phone > label,
.approver-notes > label,
.decline-reason > label {
  width: auto !important;
  display: block !important;
}
