/* Product Add Page Styles */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #6b7280;
}

.breadcrumb a {
  color: #667eea;
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: #5568d3;
}

.breadcrumb i {
  font-size: 10px;
}

/* Form Layout */
.product-form {
  margin-top: 24px;
}

.form-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
}

.form-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Form Card */
.form-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.form-card-title {
  margin: 0 0 20px 0;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  padding-bottom: 12px;
  border-bottom: 2px solid #f3f4f6;
}

/* Form Group */
.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
}

.required {
  color: #ef4444;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
  resize: vertical;
}

.input-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #6b7280;
  pointer-events: none;
}

.form-group {
  position: relative;
}

.form-group input[type="number"] {
  padding-right: 40px;
}

/* Form Row */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Image Upload Tabs */
.image-upload-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.image-tab {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  background: white;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.image-tab:hover {
  border-color: #667eea;
  color: #667eea;
}

.image-tab.active {
  border-color: #667eea;
  background: #f5f7ff;
  color: #667eea;
}

.image-tab i {
  font-size: 16px;
}

/* Image Upload */
.image-upload-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.image-upload-box {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-upload-box:hover {
  border-color: #667eea;
  background: #f5f7ff;
}

.image-upload-box i {
  font-size: 48px;
  color: #9ca3af;
  margin-bottom: 12px;
}

.image-upload-box p {
  font-size: 15px;
  font-weight: 500;
  color: #374151;
  margin: 0 0 4px 0;
}

.image-upload-box span {
  font-size: 13px;
  color: #6b7280;
}

/* Image URL Box */
.image-url-box {
  padding: 20px;
  background: #f9fafb;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
}

.url-input-group {
  display: flex;
  gap: 12px;
}

.url-input-group input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
}

.url-input-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-add-url {
  padding: 12px 20px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-add-url:hover {
  background: #5568d3;
}

.url-hint {
  margin: 12px 0 0 0;
  font-size: 13px;
  color: #6b7280;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.image-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e5e7eb;
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.image-preview-item:hover .image-preview-remove {
  opacity: 1;
}

/* Discount Preview */
.discount-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #fef3c7;
  border-radius: 8px;
  margin-top: 12px;
  font-size: 14px;
  color: #92400e;
}

.discount-preview i {
  font-size: 16px;
}

.discount-preview strong {
  color: #b45309;
}

/* Checkbox Group */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  color: #374151;
  user-select: none;
}

.checkbox-label:hover {
  border-color: #667eea;
  background: #f5f7ff;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked + span,
.checkbox-label:has(input:checked) {
  border-color: #667eea;
  background: #ede9fe;
  color: #5b21b6;
}

/* Size Quantity Container */
.size-quantity-container {
  margin-top: 16px;
}

/* Variant Hint */
.variant-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  font-size: 13px;
  color: #92400e;
}

.variant-hint i {
  font-size: 16px;
}

/* Variant Inventory Table */
.variant-inventory-table {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.variant-table-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 14px;
  font-weight: 600;
}

.variant-table-header i {
  font-size: 16px;
}

.variant-inventory-table table {
  width: 100%;
  border-collapse: collapse;
}

.variant-inventory-table th,
.variant-inventory-table td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
}

.variant-inventory-table th {
  background: #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.variant-inventory-table th:first-child,
.variant-inventory-table td:first-child {
  text-align: left;
  padding-left: 16px;
}

.color-header {
  font-size: 18px;
  cursor: help;
}

.size-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 26px;
  padding: 0 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 12px;
  font-weight: 600;
  border-radius: 5px;
}

.variant-qty-input {
  width: 70px;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  text-align: center;
  transition: all 0.2s;
}

.variant-qty-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.variant-qty-input::-webkit-inner-spin-button,
.variant-qty-input::-webkit-outer-spin-button {
  opacity: 1;
}

.row-total,
.col-total {
  font-weight: 600;
  color: #374151;
  background: #f1f5f9;
}

.total-row td {
  background: #e2e8f0;
  font-weight: 600;
}

.grand-total {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
  font-size: 15px;
}

/* Variant Summary (no quantity input) */
.variant-summary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  animation: slideIn 0.2s ease-out;
}

.variant-summary-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 14px;
  font-weight: 600;
}

.variant-summary-header i {
  font-size: 16px;
}

.variant-summary-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.variant-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.variant-group label {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
}

.variant-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}

.variant-tag.size-tag {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.variant-tag.color-tag {
  background: #e2e8f0;
  color: #475569;
}

.variant-count {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #e0e7ff;
  border-radius: 8px;
  font-size: 14px;
  color: #4338ca;
}

.variant-count i {
  font-size: 16px;
}

.variant-count strong {
  font-size: 16px;
}

.variant-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fef3c7;
  border-radius: 8px;
  font-size: 13px;
  color: #92400e;
}

.variant-note i {
  font-size: 14px;
}

.variant-note a {
  color: #b45309;
  font-weight: 600;
  text-decoration: underline;
}

/* Color Picker */
.color-picker-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.color-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.color-btn:hover {
  transform: scale(1.1);
}

.color-btn.active {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.color-btn.active::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* Stock Status */
.stock-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #d1fae5;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #065f46;
  margin-top: 12px;
}

.stock-status i {
  font-size: 10px;
}

.stock-status.out-of-stock {
  background: #fee2e2;
  color: #991b1b;
}

/* Inventory Note */
.inventory-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  border-radius: 8px;
  font-size: 13px;
  color: #0369a1;
}

.inventory-note i {
  font-size: 16px;
}

.inventory-note a {
  color: #0284c7;
  font-weight: 600;
  text-decoration: underline;
}

.inventory-note a:hover {
  color: #0369a1;
}

/* Buttons */
.btn-secondary {
  padding: 10px 20px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #374151;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.btn-primary {
  padding: 10px 20px;
  border: none;
  background: #667eea;
  color: white;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  background: #5568d3;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Notification Toast */
.notification-toast {
  position: fixed;
  top: 80px;
  right: 20px;
  padding: 16px 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease-out;
}

.notification-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.notification-toast.success {
  border-left: 4px solid #48bb78;
}

.notification-toast.success i {
  color: #48bb78;
  font-size: 20px;
}

.notification-toast.error {
  border-left: 4px solid #e53e3e;
}

.notification-toast.error i {
  color: #e53e3e;
  font-size: 20px;
}

.notification-toast span {
  font-size: 14px;
  font-weight: 500;
  color: #2d3748;
}

/* Responsive */
@media (max-width: 1200px) {
  .form-layout {
    grid-template-columns: 1fr;
  }
  
  .form-sidebar {
    order: -1;
  }
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .image-preview-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .page-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-secondary,
  .btn-primary {
    width: 100%;
    justify-content: center;
  }
}
