/* Smart Product Editor - LA CRÈME DE LA CRÈME */
/* Sprint 9.3 Phase 2A: Professional Inline Editor */

.smart-editor-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-out;
}

.smart-editor-container {
  background: white;
  width: 95%;
  max-width: 1400px;
  height: 90vh;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.smart-editor-header {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.smart-editor-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.smart-editor-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  height: calc(100% - 80px);
  overflow: hidden;
}

/* Left: Edit Form */
.editor-form {
  padding: 30px;
  overflow-y: auto;
  border-right: 1px solid #e5e5ea;
}

.form-section {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 2px solid #f2f2f7;
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section h3 {
  font-size: 1.2rem;
  margin: 0 0 20px 0;
  color: #1d1d1f;
  font-weight: 600;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #1d1d1f;
  font-size: 0.95rem;
}

.form-input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e5e5ea;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s;
  box-sizing: border-box;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-input:read-only {
  background: #f8f9fa;
  cursor: not-allowed;
}

/* Read-only field styling */
.readonly-field {
  padding: 12px;
  background: #f8f9fa;
  border: 2px solid #e5e5ea;
  border-radius: 8px;
  font-size: 1rem;
  color: #1d1d1f;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.readonly-field em {
  color: #86868b;
  font-style: italic;
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: #86868b;
  font-size: 0.85rem;
}

/* Color Tags */
.color-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f2f2f7;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.color-tag {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.tag-remove {
  background: rgba(255, 255, 255, 0.3);
  border: none;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  transition: all 0.2s;
}

.tag-remove:hover {
  background: rgba(255, 255, 255, 0.5);
}

.btn-add-tag {
  padding: 6px 12px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-add-tag:hover {
  background: #0056b3;
  transform: translateY(-2px);
}

/* Image Gallery */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.image-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #e5e5ea;
}

.image-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.image-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 5px;
}

.badge-primary {
  background: #007bff;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: white;
  transform: scale(1.1);
}

.image-upload-box {
  border: 2px dashed #e5e5ea;
  border-radius: 12px;
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #f8f9fa;
}

.image-upload-box:hover {
  border-color: #007bff;
  background: #f0f7ff;
}

.upload-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.upload-text {
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 4px;
}

.image-upload-box small {
  color: #86868b;
  font-size: 0.85rem;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* Editor Actions */
.editor-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid #f2f2f7;
}

/* Right: Live Preview */
.editor-preview {
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-header {
  background: white;
  padding: 20px 30px;
  border-bottom: 1px solid #e5e5ea;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #1d1d1f;
}

.preview-tabs {
  display: flex;
  gap: 10px;
}

.preview-tab {
  padding: 8px 16px;
  background: #f2f2f7;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.preview-tab.active {
  background: #007bff;
  color: white;
}

.preview-tab:hover:not(.active) {
  background: #e5e5ea;
}

.preview-content {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
}

/* Product Card Preview */
.product-card-preview {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-width: 350px;
  margin: 0 auto;
}

.product-image-preview {
  position: relative;
  width: 100%;
  height: 250px;
  background: #f8f9fa;
}

.product-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-featured {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #30d158;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.product-info-preview {
  padding: 20px;
}

.product-info-preview h3 {
  margin: 0 0 10px 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1d1d1f;
}

.product-info-preview p {
  color: #86868b;
  font-size: 0.95rem;
  margin-bottom: 15px;
}

.product-price-preview {
  margin-bottom: 15px;
}

.product-price-preview .price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #007bff;
}

.btn-contact-preview {
  width: 100%;
  padding: 12px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

/* Product Detail Preview */
.product-detail-preview {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-detail-preview h2 {
  margin: 0 0 15px 0;
  font-size: 2rem;
  font-weight: 600;
  color: #1d1d1f;
}

.detail-price {
  font-size: 2rem;
  font-weight: 700;
  color: #007bff;
  margin-bottom: 20px;
}

.detail-description {
  color: #515154;
  line-height: 1.8;
  font-size: 1.05rem;
  margin-bottom: 30px;
}

.detail-description h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: #1d1d1f;
}

.detail-specs {
  margin-top: 30px;
}

.detail-specs h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: #1d1d1f;
}

.detail-specs table {
  width: 100%;
  border-collapse: collapse;
}

.detail-specs table tr {
  border-bottom: 1px solid #e5e5ea;
}

.detail-specs table td {
  padding: 12px 8px;
  font-size: 0.95rem;
}

.detail-specs table td:first-child {
  width: 40%;
  color: #86868b;
}

.detail-specs table td:last-child {
  color: #1d1d1f;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .smart-editor-body {
    grid-template-columns: 1fr;
  }

  .editor-preview {
    display: none;
  }
}

@media (max-width: 768px) {
  .smart-editor-container {
    width: 100%;
    height: 100vh;
    border-radius: 0;
  }

  .editor-form {
    padding: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .editor-actions {
    flex-direction: column;
  }

  .editor-actions .btn {
    width: 100%;
  }
}
