/*
 * WooCommerce Product Stock and Sales Table Shortcode Styles
 */

.wc-stock-sales-table-wrapper {
  /* Optional: Add a subtle border or shadow to the entire container */
  /* border: 1px solid #e0e0e0; */
  /* box-shadow: 0 2px 5px rgba(0,0,0,0.05); */
  padding: 15px;
  background-color: #fff;
  border-radius: 8px;
  margin-bottom: 30px;
}

.wc-stock-sales-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.5;
}

.wc-stock-sales-table th,
.wc-stock-sales-table td {
  padding: 12px 15px;
  text-align: left;
  border: 1px solid #e0e0e0;
  vertical-align: middle;
}

.wc-stock-sales-table th {
  background-color: #f2f2f2;
  font-weight: bold;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* .wc-stock-sales-table tr:nth-child(even) {
  background-color: #f8f8f8;
} */

.wc-stock-sales-table tr:hover {
  background-color: #f0f0f0;
  transition: background-color 0.2s ease;
}

.variation-row {
  background-color: #fbfbfb; /* Slightly different background for variations */
  font-size: 0.95em;
}

.variation-name {
  padding-left: 35px; /* Indent variations */
  font-style: italic;
  color: #555;
}

/* Stock Status Colors */
.stock-in-stock {
  color: #28a745; /* Green */
  font-weight: 600;
}
.stock-out-of-stock {
  color: #dc3545; /* Red */
  font-weight: 600;
}
.stock-low-stock {
  color: #ffc107; /* Orange/Amber */
  font-weight: 600;
}

/* Filter Form Styles */
.filter-form {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 25px;
  border: 1px solid #e9ecef;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.filter-form h4 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #343a40;
  font-size: 1.2em;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 10px;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group label {
  font-weight: 600;
  color: #495057;
  font-size: 15px;
}

.filter-group select,
.filter-group input[type="text"] {
  /* Adjust if you add text inputs */
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 5px;
  background-color: #fff;
  font-size: 14px;
  width: 100%; /* Ensure inputs take full width of their grid column */
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.filter-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-start; /* Align buttons to the start */
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

.filter-btn {
  padding: 10px 22px;
  background: #007bff; /* Primary blue */
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: background-color 0.3s ease, transform 0.1s ease;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.filter-btn:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

.filter-btn.reset {
  background: #6c757d; /* Grey for reset */
  box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
}

.filter-btn.reset:hover {
  background: #545b62;
}

/* Results and Pagination Info */
.results-info,
.pagination-info {
  margin-top: 15px;
  margin-bottom: 15px;
  color: #666;
  font-style: italic;
  font-size: 14px;
  text-align: center; /* Center align for better readability */
}

/* Load More Button */
.load-more-container {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #eee; /* Visual separation */
}

.load-more-btn {
  background: #28a745; /* Green for success/action */
  color: white;
  border: none;
  padding: 14px 35px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.1s ease;
  box-shadow: 0 3px 6px rgba(40, 167, 69, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.load-more-btn:hover {
  background: #218838;
  transform: translateY(-2px);
}

.load-more-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Loading Spinner */
.loading-spinner {
  display: none; /* Hidden by default */
  margin: 20px auto;
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #007bff; /* Blue */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
  .filter-row {
    grid-template-columns: 1fr; /* Stack filters vertically */
  }
  .filter-group label {
    width: auto; /* Allow labels to take natural width */
    text-align: left;
  }
  .filter-buttons {
    flex-direction: column; /* Stack buttons vertically */
    align-items: stretch; /* Stretch buttons to full width */
  }
  .filter-btn {
    width: 100%;
  }
  .wc-stock-sales-table th,
  .wc-stock-sales-table td {
    padding: 8px 10px; /* Reduce padding on smaller screens */
  }
  .variation-name {
    padding-left: 25px; /* Adjust indent */
  }
}

@media (max-width: 480px) {
  .filter-form {
    padding: 15px;
  }
  .filter-form h4 {
    font-size: 1.1em;
  }
  .filter-group select,
  .filter-group input {
    min-width: unset; /* Remove min-width constraint */
  }
  .load-more-btn {
    padding: 10px 25px;
    font-size: 14px;
  }
}
