/**
 * Pingvin Plugin Styles
 * Version: 1.0.0
 */

/* Plugin general styles */
.pingvin-wrapper {
  margin: 20px 0;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f9f9f9;
}

.pingvin-title {
  color: #333;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
}

.pingvin-content {
  color: #666;
  line-height: 1.6;
}

/* Admin Settings Styles */
#pingvin-billing-customers {
  max-width: 600px;
}

#customer-search {
  width: 100%;
  max-width: 400px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 10px;
}

#customer-search-results {
  border: 1px solid #ddd;
  border-top: none;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  display: none;
}

#customer-search-results:not(:empty) {
  display: block;
}

.customer-results {
  background: #fff;
}

.customer-result {
  padding: 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.2s;
}

.customer-result:hover {
  background-color: #f8f9fa;
}

.customer-result:last-child {
  border-bottom: none;
}

.customer-name {
  margin-bottom: 4px;
}

.customer-details {
  color: #666;
  font-size: 12px;
}

.no-results {
  padding: 10px;
  color: #666;
  font-style: italic;
}

.search-loading {
  padding: 10px;
  color: #666;
  font-style: italic;
  text-align: center;
}

#selected-customers {
  margin-top: 20px;
}

#selected-customers h4 {
  margin-bottom: 10px;
  color: #333;
}

#selected-customers-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  max-height: 200px;
  overflow-y: auto;
}

#selected-customers-list li {
  padding: 12px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

#selected-customers-list li:last-child {
  border-bottom: none;
}

.selected-customer-info {
  flex: 1;
  margin-right: 10px;
}

.selected-customer-info strong {
  color: #333;
  font-size: 14px;
}

.selected-customer-info small {
  color: #666;
  font-size: 12px;
}

.remove-customer {
  background: #dc3232;
  color: #fff;
  border: none;
  border-radius: 2px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.remove-customer:hover {
  background: #a00;
}

/* Pickup Depots Styles */
#pingvin-pickup-depots {
  max-width: 800px;
}

#depot-form {
  background: #f9f9f9;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 20px;
}

#depot-form h4 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #333;
}

#depot-form .form-table {
  margin-bottom: 15px;
}

#depot-form .form-table td {
  padding: 5px 10px 5px 0;
  vertical-align: middle;
}

#depot-form .form-table input {
  width: 100%;
  max-width: 300px;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 3px;
}

#add-depot {
  background: #0073aa;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 3px;
  cursor: pointer;
}

#add-depot:hover {
  background: #005a87;
}

#existing-depots h4 {
  color: #333;
  margin-bottom: 15px;
}

.depot-item {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 15px;
}

.depot-item .form-table {
  margin-bottom: 10px;
}

.depot-item .form-table td {
  padding: 5px 10px 5px 0;
  vertical-align: top;
}

.depot-item .form-table td:first-child {
  width: 100px;
  font-weight: bold;
}

.remove-depot {
  background: #dc3232;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 3px;
  cursor: pointer;
}

.remove-depot:hover {
  background: #a00;
}

/* Order Deadline Styles */
.pingvin-deadline-fields {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.pingvin-deadline-fields select,
.pingvin-deadline-fields input[type="time"] {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 3px;
}

/* Form styles */
.pingvin-form-field {
  margin-bottom: 20px;
}

.pingvin-form-field label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.pingvin-form-field input[type="text"],
.pingvin-form-field input[type="email"],
.pingvin-form-field input[type="url"],
.pingvin-form-field input[type="time"],
.pingvin-form-field textarea,
.pingvin-form-field select {
  width: 100%;
  max-width: 400px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.pingvin-form-field input[type="checkbox"] {
  margin-right: 8px;
}

.pingvin-form-field .description {
  font-size: 13px;
  color: #666;
  margin-top: 5px;
}

/* Notice styles */
.pingvin-notice {
  padding: 10px 15px;
  margin: 15px 0;
  border-left: 4px solid #0073aa;
  background: #f0f8ff;
  color: #333;
}

.pingvin-notice.success {
  border-left-color: #46b450;
  background: #f0fff0;
}

.pingvin-notice.error {
  border-left-color: #dc3232;
  background: #fff0f0;
}

.pingvin-notice.warning {
  border-left-color: #ffb900;
  background: #fffbf0;
}

/* Responsive styles */
@media (max-width: 768px) {
  .pingvin-wrapper {
    margin: 10px 0;
    padding: 10px;
  }

  .pingvin-form-field input[type="text"],
  .pingvin-form-field input[type="email"],
  .pingvin-form-field input[type="url"],
  .pingvin-form-field input[type="time"],
  .pingvin-form-field textarea,
  .pingvin-form-field select {
    max-width: 100%;
  }

  #pingvin-billing-customers,
  #pingvin-pickup-depots {
    max-width: 100%;
  }

  .pingvin-deadline-fields {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Loading animation */
.pingvin-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #0073aa;
  border-radius: 50%;
  animation: pingvin-spin 1s linear infinite;
}

@keyframes pingvin-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* WooCommerce Integration Styles */

/* Depot Selection in Checkout */
#pingvin_depot_selection {
  margin: 20px 0;
  border-radius: 4px;
  background-color: #ffffff;
  border-top: 1px solid #ddd;
  padding-top: 15px;
}

#pingvin_depot_selection h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #333;
  font-size: 18px;
}

#pingvin_depot_selection .form-row {
  margin-bottom: 15px;
}

#pingvin_depot_selection select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #fff;
}

/* Order Details Pickup Information */
.woocommerce-order-details .pingvin-pickup-info h2 {
  margin-top: 30px;
  margin-bottom: 15px;
  color: #333;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
}

.woocommerce-order-details .pingvin-pickup-info table {
  margin-bottom: 20px;
}

.woocommerce-order-details .pingvin-pickup-info th {
  font-weight: bold;
  padding-right: 15px;
  vertical-align: top;
  width: 120px;
}

/* Admin Orders Table Custom Columns */
.wp-admin .widefat .column-bestellschluss,
.wp-admin .widefat .column-abholdepot {
  width: 150px;
}

.wp-admin .widefat .column-bestellschluss {
  text-align: center;
}

.wp-admin .widefat .column-abholdepot small {
  color: #666;
  font-style: italic;
}

/* Admin Order Details */
.order_data_column .pingvin-depot-info {
  margin-top: 15px;
  padding: 10px;
  background-color: #f9f9f9;
  border-left: 4px solid #0073aa;
}

.order_data_column .pingvin-depot-info strong {
  color: #0073aa;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #pingvin_depot_selection {
    margin: 15px 0;
    padding: 10px;
  }

  .wp-admin .widefat .column-bestellschluss,
  .wp-admin .widefat .column-abholdepot {
    width: 120px;
  }

  .woocommerce-order-details .pingvin-pickup-info th {
    width: 100px;
    padding-right: 10px;
  }
}

/* Payrexx Transaction Fee Styles */
#payrexx_fee_checkbox_container {
  margin: 15px 0;
  padding: 15px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

#payrexx_fee_checkbox_container .form-row {
  margin: 0;
}

#payrexx_fee_checkbox_container label {
  font-weight: 500;
  color: #333;
}

#payrexx_fee_checkbox_container input[type="checkbox"] {
  margin-right: 8px;
}

/* Ensure proper spacing in checkout */
.woocommerce-checkout #payrexx_fee_wrapper {
  margin-bottom: 20px;
}
