/* Gift-i-Card Admin Styles */
.wrap {
  margin: 20px 0;
}

.gicapi-settings-form {
  max-width: 800px;
  margin: 20px 0;
  padding: 20px;
  background: #fff;
  border: 1px solid #ccd0d4;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.gicapi-settings-form h2 {
  margin-top: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.form-table th {
  width: 200px;
  padding: 20px 0;
}

.form-table td {
  padding: 15px 10px;
}

.form-table input[type="text"],
.form-table input[type="password"] {
  width: 100%;
  max-width: 400px;
}

.gicapi-test-connection {
  margin: 20px 0;
  padding: 10px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.gicapi-test-connection button {
  margin: 10px 0;
}

.gicapi-test-result {
  margin-top: 10px;
  padding: 10px;
  border-radius: 4px;
}

.gicapi-test-result.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.gicapi-test-result.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.gicapi-products-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.gicapi-products-table th,
.gicapi-products-table td {
  padding: 10px;
  border: 1px solid #ddd;
  text-align: right;
}

.gicapi-products-table th {
  background: #f8f9fa;
}

.gicapi-products-table tr:nth-child(even) {
  background: #f8f9fa;
}

.gicapi-pagination {
  margin: 20px 0;
  text-align: center;
}

.gicapi-pagination .page-numbers {
  display: inline-block;
  padding: 5px 10px;
  margin: 0 5px;
  border: 1px solid #ddd;
  background: #fff;
  text-decoration: none;
}

.gicapi-pagination .page-numbers.current {
  background: #0073aa;
  color: #fff;
  border-color: #0073aa;
}

.gicapi-dialog {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 20px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 100000;
}

.gicapi-dialog-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99999;
}

.gicapi-dialog h3 {
  margin-top: 0;
}

.gicapi-dialog .close {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
}

.gicapi-dialog select {
  width: 100%;
  margin: 10px 0;
}

.gicapi-dialog button {
  margin: 10px 5px;
}

.update-plugins {
  display: inline-block;
  margin-left: 5px;
}

.update-count {
  background-color: #46b450;
  color: #fff;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  display: inline-block;
  margin: 0;
  min-width: 20px;
  height: 20px;
  box-sizing: border-box;
}

.notice {
  margin: 15px 0;
  padding: 12px;
  border-left: 4px solid;
}

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

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

.notice strong {
  font-weight: 600;
}

/* Status indicators for admin area */
.gicapi-status {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #ffffff;
}

.gicapi-status-pending {
  background: #6c757d;
  color: #ffffff;
  border: 1px solid #5a6268;
}

.gicapi-status-processing {
  background: #007bff;
  color: #ffffff;
  border: 1px solid #0056b3;
}

.gicapi-status-completed {
  background: #28a745;
  color: #ffffff;
  border: 1px solid #1e7e34;
}

.gicapi-status-failed {
  background: #dc3545;
  color: #ffffff;
  border: 1px solid #c82333;
}

.gicapi-status-confirmed {
  background: #28a745;
  color: #ffffff;
  border: 1px solid #1e7e34;
}

.gicapi-status-pending-create {
  background: #ffc107;
  color: #212529;
  border: 1px solid #e0a800;
}

.gicapi-status-cancelled {
  background: #828a92;
  color: #ffffff;
  border: 1px solid #828a92;
}

/* Tab Styles */
.tab-content {
  margin-top: 20px;
}

.nav-tab-wrapper {
  margin-bottom: 20px;
}

/* Modal Styles */
.gicapi-modal {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  overflow-x: hidden;
}

.gicapi-modal-content {
  background-color: #fefefe;
  margin: 20px auto;
  padding: 20px;
  border: 1px solid #888;
  width: 90%;
  max-width: 900px;
  max-height: calc(100vh - 40px);
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gicapi-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

.gicapi-modal-close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.gicapi-modal-close:hover {
  color: black;
}

.gicapi-product-search-wrapper {
  margin-bottom: 20px;
  position: relative;
  z-index: 100001;
}

.gicapi-modal-body {
  position: relative;
  z-index: 100001;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 200px);
}

.gicapi-modal-footer {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.gicapi-mapped-products {
  margin-bottom: 10px;
}

.gicapi-mapped-products-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.gicapi-mapped-products-footer .mapped-count {
  color: #666;
  font-style: italic;
}

.gicapi-mapped-product-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  padding: 8px;
  background: #f8f8f8;
  border-radius: 3px;
  border: 1px solid #e5e5e5;
}

.gicapi-mapped-product-item a {
  flex: 1;
  margin-right: 10px;
  text-decoration: none;
}

.gicapi-mapped-product-item a:hover {
  color: #2271b1;
}

.gicapi-remove-mapping {
  cursor: pointer;
  color: #cc0000;
  padding: 2px;
  border-radius: 3px;
}

.gicapi-remove-mapping:hover {
  background: #ffebee;
}

.gicapi-mapped-products-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 5px;
}

.gicapi-mapped-products-list::-webkit-scrollbar {
  width: 8px;
}

.gicapi-mapped-products-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.gicapi-mapped-products-list::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.gicapi-mapped-products-list::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Select2 Custom Styles */
.select2-container--default .select2-selection--single {
  height: 32px;
  border-color: #ddd;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  line-height: 32px;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__arrow {
  height: 30px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border-color: #ddd;
}

.select2-container--default
  .select2-results__option--highlighted[aria-selected] {
  background-color: #2271b1;
}

.select2-dropdown {
  border-color: #ddd;
}

.select2-container {
  z-index: 100002 !important;
}

.select2-dropdown {
  z-index: 100002 !important;
}

/* Cron Status Styles */
.gicapi-cron-status .status-enabled {
  color: #46b450;
  font-weight: bold;
}

.gicapi-cron-status .status-disabled {
  color: #dc3232;
  font-weight: bold;
}

.gicapi-cron-info ol {
  margin-left: 20px;
}

.gicapi-cron-info li {
  margin-bottom: 8px;
}

/* Actions Column Styles */
.column-actions {
  width: 200px;
  text-align: center;
}

.gicapi-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: stretch;
}

.gicapi-actions .button {
  margin: 0;
  white-space: normal;
  text-align: center;
  min-height: 28px;
  line-height: 1.2;
}

/* Create Product Modal Styles */
.gicapi-create-product-modal-close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 15px;
}

.gicapi-create-product-modal-close:hover {
  color: black;
}

.mapping-info {
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  margin: 5px 0;
}

.mapping-info p {
  margin: 5px 0;
  font-size: 13px;
}

.required {
  color: #dc3232;
}

.form-table th {
  width: 150px;
  padding: 15px 10px 15px 0;
  vertical-align: top;
}

.form-table td {
  padding: 15px 10px 15px 0;
}

.form-table input[type="text"],
.form-table input[type="number"],
.form-table select {
  width: 100%;
  max-width: 300px;
}

.form-table .description {
  color: #666;
  font-style: italic;
  margin-top: 5px;
  font-size: 12px;
}

/* Page Actions Styles */
.gicapi-page-actions {
  margin: 20px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

/* Variable Product Variants List Styles */
.variants-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  background: #f9f9f9;
}

.variant-header {
  padding: 10px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  margin-bottom: 10px;
  border-radius: 4px;
}

.variant-header label {
  font-weight: 600;
  cursor: pointer;
}

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

.variant-checkbox {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.variant-checkbox label {
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.variant-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-top: 10px;
}

.variant-field {
  display: flex;
  flex-direction: column;
}

.variant-field label {
  font-weight: 500;
  margin-bottom: 5px;
  color: #555;
  font-size: 13px;
}

.variant-field input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 3px;
}

.variants-list::-webkit-scrollbar {
  width: 8px;
}

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

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

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

/* Price Sync Styles */
.gicapi-mapped-product-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f9f9f9;
}

.gicapi-product-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gicapi-product-price-sync-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gicapi-product-price-sync-toggle,
.gicapi-product-stock-sync-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
}

.gicapi-product-price-sync-toggle input[type="checkbox"],
.gicapi-product-stock-sync-toggle input[type="checkbox"] {
  margin: 0;
}

.gicapi-customize-product-price-sync {
  padding: 2px 5px;
  cursor: pointer;
}

.gicapi-customize-product-price-sync:hover {
  color: #0073aa;
}

#create-product-price-sync-settings,
#create-product-price-sync-margin-row,
#create-variable-product-price-sync-settings,
#create-variable-product-price-sync-margin-row {
  display: none;
}
