/* General admission specific styles */
.general-admission-ticket {
  background-color: #f0f8ff !important;
  border: 2px solid #4caf50 !important;
}

.general-admission-ticket:focus {
  outline: 2px solid #45a049;
}

/* General admission row highlighting */
.dptpe_ticket_table tbody tr:has(.general-admission-ticket) {
  background-color: #f9f9f9;
}

.dptpe_ticket_table tbody tr:has(.general-admission-ticket) td:nth-child(2) {
  font-weight: bold;
  color: #2e7d32;
}

/* Hide member-related elements for general admission events */
.general-admission-event .member-panel-icon {
  display: none !important;
}

.general-admission-event .member-details-panel {
  display: none !important;
}

.general-admission-event .member-login-required {
  display: none !important;
}

.general-admission-event #member-login-btn {
  display: none !important;
}

/* Base table styles */
.dptpe_ticket_table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.dptpe_ticket_table th,
.dptpe_ticket_table td {
  padding: 10px;
  border: 1px solid #ddd;
  text-align: left;
}

.dptpe_ticket_table th {
  background-color: #f5f5f5;
}

/* Responsive table styles */
@media screen and (max-width: 768px) {
  .dptpe_ticket_table {
    display: block;
    width: 100%;
  }

  .dptpe_ticket_table thead {
    display: none; /* Hide headers on mobile */
  }

  .dptpe_ticket_table tbody,
  .dptpe_ticket_table tr,
  .dptpe_ticket_table td {
    display: block;
    width: 100%;
  }

  .dptpe_ticket_table tr {
    margin-bottom: 15px;
    border: 1px solid #ddd;
  }

  .dptpe_ticket_table td {
    text-align: right;
    padding-left: 50%;
    position: relative;
    border: none;
    border-bottom: 1px solid #eee;
  }

  .dptpe_ticket_table td:last-child {
    border-bottom: none;
  }

  /* Add labels for mobile */
  .dptpe_ticket_table td::before {
    content: attr(data-label);
    position: absolute;
    left: 10px;
    width: 45%;
    text-align: left;
    font-weight: bold;
  }

  /* Special handling for footer rows */
  .dptpe_ticket_table tfoot tr {
    border: none;
  }

  .dptpe_ticket_table tfoot td {
    text-align: right;
    padding-left: 10px;
  }

  .dptpe_ticket_table tfoot td::before {
    content: none;
  }

  /* Adjust popup table specifically */
  .dptpe_popup_content .dptpe_ticket_table {
    font-size: 14px;
  }

  .dptpe_popup_content .dptpe_ticket_table td {
    padding: 8px 8px 8px 50%;
  }
}

/* Additional popup adjustments for very small screens */
@media screen and (max-width: 480px) {
  .dptpe_popup_content {
    padding: 15px;
  }

  .dptpe_form_columns {
    gap: 15px;
  }
}

.dptpe_quantity_select {
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-align: center;
  width: 70px;
}

.dptpe_quantity_select:focus {
  outline: none;
  border-color: #2271b1;
}

/* Style the spinner buttons */
.dptpe_quantity_select::-webkit-outer-spin-button,
.dptpe_quantity_select::-webkit-inner-spin-button {
  opacity: 1;
  height: 30px;
  cursor: pointer;
}

/* For Firefox */
.dptpe_quantity_select[type="number"] {
  -moz-appearance: textfield;
}

/* Show custom arrows in Firefox */
.dptpe_quantity_select[type="number"]:hover::-webkit-inner-spin-button {
  opacity: 1;
}

.dptpe_add_to_order_btn {
  text-decoration: none;
  text-align: center;
  display: inline-block;
  font-family: "proxima-nova", sans-serif;
  letter-spacing: 0.1rem;
  color: #fff;
  line-height: 1.1;
  font-weight: 400;
  transition: transform 0.25s;
  transform-origin: 50% 50%;
  font-size: 1rem;
  padding: 12px 24px;
  cursor: pointer;
  background-color: #15243c;
}

.dptpe_add_to_order_btn:hover {
  background-color: #005177;
}

/* Popup styles */
.dptpe_popup_overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.dptpe_popup_content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  width: 100%;
  max-width: 1024px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dptpe_popup_close {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.dptpe_popup_close:hover {
  background: #f0f0f0;
  color: #333;
}

/* Form columns layout */
.dptpe_form_columns {
  display: flex;
  gap: 30px;
  margin-bottom: 20px;
}

.dptpe_form_column {
  flex: 1;
  min-width: 0; /* Prevents flex items from overflowing */
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
  .dptpe_form_columns {
    flex-direction: column;
    gap: 20px;
  }

  .dptpe_popup_content {
    padding: 20px;
    margin: 15px;
    max-height: calc(100vh - 30px);
  }
}

/* Form headings */
.dptpe_popup_content h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #333;
  font-size: 1.4em;
}

/* Scrollbar styling for the popup */
.dptpe_popup_content::-webkit-scrollbar {
  width: 8px;
}

.dptpe_popup_content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.dptpe_popup_content::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.dptpe_popup_content::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Make form elements clickable */
.dptpe_payment_form input,
.dptpe_payment_form textarea,
.dptpe_payment_form select,
.dptpe_payment_form button,
#stripe-card-element {
  cursor: text;
  position: relative;
  z-index: 2;
}

/* Set proper cursor for buttons */
.dptpe_payment_form button,
.dptpe_payment_form select {
  cursor: pointer;
}

/* Ensure form elements are properly styled */
.dptpe_payment_form input,
.dptpe_payment_form textarea {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

#stripe-card-element {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 20px;
}

/* Ensure proper stacking context */
.dptpe_form_columns {
  position: relative;
  z-index: 2;
}

.dptpe_popup_close {
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 24px;
  cursor: pointer;
  z-index: 1; /* Ensure the close button is always clickable */
}

.dptpe_form_columns {
  display: flex;
  gap: 20px;
}

.dptpe_form_column {
  flex: 1;
}

.dptpe_form_row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.dptpe_payment_form input,
.dptpe_payment_form textarea {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

#stripe-card-element {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 20px;
}

.dptpe_submit_payment_btn {
  text-decoration: none;
  text-align: center;
  display: inline-block;
  font-family: "proxima-nova", sans-serif;
  letter-spacing: 0.1rem;
  color: #fff;
  line-height: 1.1;
  font-weight: 400;
  transition: transform 0.25s;
  transform-origin: 50% 50%;
  font-size: 1rem;
  padding: 12px 24px;
  cursor: pointer;
  background-color: #15243c;
}

.dptpe_submit_payment_btn:hover {
  background-color: #15243c;
}

#card-errors {
  color: #dc3232;
  margin-bottom: 10px;
}

.dptpe_order_summary {
  margin-bottom: 30px;
}

.dptpe_order_summary .dptpe_ticket_table {
  font-size: 0.9em;
}

.dptpe_order_summary .dptpe_ticket_table th,
.dptpe_order_summary .dptpe_ticket_table td {
  padding: 8px;
}

.text-right {
  text-align: right;
}

.member-login-required {
  color: #dc3545;
  font-weight: bold;
  margin-left: 5px;
  cursor: help;
}

tr[data-ticket-type="Member"] {
  position: relative;
}

tr[data-ticket-type="Member"]::after {
  content: attr(data-login-message);
  display: none;
  position: absolute;
  background: #fff;
  border: 1px solid #ddd;
  padding: 8px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1;
  font-size: 0.9em;
}

tr[data-ticket-type="Member"] input[disabled]:hover + ::after {
  display: block;
}

.dptpe_quantity_select[disabled] {
  background-color: #f5f5f5;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Tooltip styles */
.dptpe_quantity_select[disabled]:hover {
  cursor: help;
}

/* Style for member ticket rows */
tr:has(.dptpe_quantity_select[data-member-ticket="true"][disabled]) {
  background-color: #fafafa;
}

/* Custom tooltip for disabled inputs */
.dptpe_quantity_select[disabled] + .tooltip {
  position: absolute;
  background: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 100;
  display: none;
}

.dptpe_quantity_select[disabled]:hover + .tooltip {
  display: block;
}

@media (max-width: 768px) {
  .dptpe_ticket_table_wrapper {
    width: 100% !important;
  }

  .dptpe_ticket_table tfoot tr {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .dptpe_ticket_table tfoot td {
    width: 100% !important;
    text-align: right;
    display: block;
  }

  .dptpe_ticket_table tfoot td[colspan] {
    text-align: left; /* Keeps labels aligned left */
  }
}
