/* Aisthetix Virtual Try-On Widget Styles */

/* CSS Variables for theming */
:root {
  --aisthetix-primary: #000000;
  --aisthetix-primary-hover: #333333;
  --aisthetix-secondary: #f5f5f5;
  --aisthetix-secondary-hover: #e5e5e5;
  --aisthetix-text: #1a1a1a;
  --aisthetix-text-muted: #666666;
  --aisthetix-border: #e0e0e0;
  --aisthetix-error: #dc2626;
  --aisthetix-success: #16a34a;
  --aisthetix-overlay: rgba(0, 0, 0, 0.5);
  --aisthetix-radius: 8px;
  --aisthetix-radius-lg: 16px;
  --aisthetix-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --aisthetix-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Modal Overlay */
.aisthetix-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--aisthetix-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 16px;
  animation: aisthetix-fade-in 0.2s ease;
  isolation: isolate;
}

@keyframes aisthetix-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Modal Content */
.aisthetix-modal-content {
  background: white;
  border-radius: var(--aisthetix-radius-lg);
  box-shadow: var(--aisthetix-shadow-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: aisthetix-slide-up 0.3s ease;
}

@keyframes aisthetix-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.aisthetix-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--aisthetix-border);
  flex-shrink: 0;
}

.aisthetix-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--aisthetix-text);
  margin: 0;
}

.aisthetix-modal-close {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--aisthetix-text-muted);
  border-radius: var(--aisthetix-radius);
  transition: all 0.2s;
}

.aisthetix-modal-close:hover {
  background: var(--aisthetix-secondary);
  color: var(--aisthetix-text);
}

.aisthetix-modal-close svg {
  width: 20px;
  height: 20px;
}

.aisthetix-modal-body {
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* Buttons */
.aisthetix-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--aisthetix-radius);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.aisthetix-btn svg {
  width: 18px;
  height: 18px;
}

.aisthetix-btn-primary {
  background: var(--aisthetix-primary);
  color: white;
}

.aisthetix-btn-primary:hover {
  background: var(--aisthetix-primary-hover);
}

.aisthetix-btn-secondary {
  background: var(--aisthetix-secondary);
  color: var(--aisthetix-text);
}

.aisthetix-btn-secondary:hover {
  background: var(--aisthetix-secondary-hover);
}

.aisthetix-btn-text {
  background: transparent;
  color: var(--aisthetix-text-muted);
}

.aisthetix-btn-text:hover {
  color: var(--aisthetix-text);
  background: var(--aisthetix-secondary);
}

/* Avatar Upload */
.aisthetix-avatar-upload {
  text-align: center;
}

.aisthetix-avatar-upload-header {
  margin-bottom: 16px;
}

.aisthetix-avatar-upload-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--aisthetix-text);
  margin: 0 0 8px 0;
}

.aisthetix-avatar-upload-header p {
  font-size: 14px;
  color: var(--aisthetix-text-muted);
  margin: 0;
  line-height: 1.5;
}

.aisthetix-upload-area {
  margin-bottom: 16px;
}

.aisthetix-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.aisthetix-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 24px;
  border: 2px dashed var(--aisthetix-border);
  border-radius: var(--aisthetix-radius-lg);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--aisthetix-text-muted);
}

.aisthetix-upload-label:hover {
  border-color: var(--aisthetix-primary);
  background: var(--aisthetix-secondary);
}

.aisthetix-upload-icon {
  width: 48px;
  height: 48px;
  color: var(--aisthetix-text-muted);
}

.aisthetix-upload-hint {
  font-size: 12px;
  color: var(--aisthetix-text-muted);
}

.aisthetix-preview-area {
  margin-bottom: 12px;
}

.aisthetix-preview-image {
  max-width: 100%;
  max-height: 200px;
  height: auto;
  width: auto;
  object-fit: contain;
  border-radius: var(--aisthetix-radius);
  margin: 0 auto 16px;
  display: block;
}

.aisthetix-preview-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.aisthetix-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--aisthetix-text);
  text-align: left;
  margin: 0 0 12px;
  cursor: pointer;
}

.aisthetix-consent input {
  margin-top: 2px;
  flex-shrink: 0;
}

.aisthetix-privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  background: var(--aisthetix-secondary);
  border-radius: var(--aisthetix-radius);
  font-size: 12px;
  color: var(--aisthetix-text-muted);
  text-align: left;
  margin-top: 16px;
}

.aisthetix-privacy-note svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Processing View */
.aisthetix-processing {
  text-align: center;
  padding: 20px 0;
}

.aisthetix-processing-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.aisthetix-processing-preview {
  position: relative;
  display: inline-block;
  margin: 0 auto;
}

.aisthetix-processing-image {
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--aisthetix-radius);
  opacity: 0.7;
}

.aisthetix-processing-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--aisthetix-radius);
}

.aisthetix-processing-info h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--aisthetix-text);
  margin: 0 0 8px 0;
}

.aisthetix-processing-info p {
  font-size: 14px;
  color: var(--aisthetix-text-muted);
  margin: 0 0 20px 0;
}

.aisthetix-progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.aisthetix-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--aisthetix-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.aisthetix-progress-fill {
  height: 100%;
  background: var(--aisthetix-primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.aisthetix-progress-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--aisthetix-text);
  min-width: 40px;
}

.aisthetix-processing-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.aisthetix-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--aisthetix-text-muted);
}

.aisthetix-step.active {
  color: var(--aisthetix-text);
}

.aisthetix-step.completed {
  color: var(--aisthetix-success);
}

.aisthetix-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--aisthetix-border);
}

.aisthetix-step.active .aisthetix-step-dot {
  background: var(--aisthetix-primary);
  animation: aisthetix-pulse 1s infinite;
}

.aisthetix-step.completed .aisthetix-step-dot {
  background: var(--aisthetix-success);
}

@keyframes aisthetix-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Spinner */
.aisthetix-spinner,
.aisthetix-spinner-large {
  border: 2px solid var(--aisthetix-border);
  border-top-color: var(--aisthetix-primary);
  border-radius: 50%;
  animation: aisthetix-spin 0.8s linear infinite;
}

.aisthetix-spinner {
  width: 24px;
  height: 24px;
}

.aisthetix-spinner-large {
  width: 48px;
  height: 48px;
  border-width: 3px;
}

@keyframes aisthetix-spin {
  to { transform: rotate(360deg); }
}

/* Result View */
.aisthetix-result {
  text-align: center;
}

.aisthetix-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.aisthetix-result-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--aisthetix-text);
  margin: 0;
}

.aisthetix-view-toggle {
  display: flex;
  background: var(--aisthetix-secondary);
  border-radius: var(--aisthetix-radius);
  padding: 4px;
}

.aisthetix-toggle-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: var(--aisthetix-text-muted);
  transition: all 0.2s;
}

.aisthetix-toggle-btn.active {
  background: white;
  color: var(--aisthetix-text);
  box-shadow: var(--aisthetix-shadow);
}

.aisthetix-result-content {
  margin-bottom: 20px;
}

.aisthetix-result-single {
  display: flex;
  justify-content: center;
}

.aisthetix-result-image {
  max-width: 100%;
  max-height: 400px;
  height: auto;
  width: auto;
  object-fit: contain;
  border-radius: var(--aisthetix-radius);
  box-shadow: var(--aisthetix-shadow);
}

.aisthetix-result-compare {
  display: flex;
  align-items: center;
  gap: 12px;
}

.aisthetix-compare-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aisthetix-compare-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--aisthetix-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.aisthetix-compare-image {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: var(--aisthetix-radius);
}

.aisthetix-compare-divider {
  color: var(--aisthetix-text-muted);
}

.aisthetix-compare-divider svg {
  width: 24px;
  height: 24px;
}

.aisthetix-result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.aisthetix-result-product {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--aisthetix-border);
  font-size: 13px;
  color: var(--aisthetix-text-muted);
}

/* Error View */
.aisthetix-error {
  text-align: center;
  padding: 20px 0;
}

.aisthetix-error-icon {
  margin-bottom: 16px;
}

.aisthetix-error-icon svg {
  width: 48px;
  height: 48px;
  color: var(--aisthetix-error);
}

.aisthetix-error h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--aisthetix-text);
  margin: 0 0 8px 0;
}

.aisthetix-error-message {
  padding: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--aisthetix-radius);
  color: var(--aisthetix-error);
  font-size: 14px;
  margin-bottom: 16px;
}

.aisthetix-error-suggestions {
  text-align: left;
  padding: 16px;
  background: var(--aisthetix-secondary);
  border-radius: var(--aisthetix-radius);
  margin-bottom: 20px;
}

.aisthetix-error-suggestions p {
  font-size: 14px;
  font-weight: 500;
  color: var(--aisthetix-text);
  margin: 0 0 12px 0;
}

.aisthetix-error-suggestions ul {
  margin: 0;
  padding-left: 20px;
}

.aisthetix-error-suggestions li {
  font-size: 13px;
  color: var(--aisthetix-text-muted);
  margin-bottom: 8px;
}

.aisthetix-error-suggestions li:last-child {
  margin-bottom: 0;
}

.aisthetix-error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .aisthetix-modal-content {
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }

  .aisthetix-modal-overlay {
    padding: 0;
  }

  .aisthetix-result-compare {
    flex-direction: column;
  }

  .aisthetix-compare-divider {
    transform: rotate(90deg);
  }

  .aisthetix-result-actions {
    flex-direction: column;
  }

  .aisthetix-btn {
    width: 100%;
  }
}

/* Quota Blocked View */
.aisthetix-quota-blocked {
  text-align: center;
  padding: 20px 0;
}

.aisthetix-quota-blocked-icon {
  margin-bottom: 16px;
}

.aisthetix-quota-blocked-icon svg {
  width: 48px;
  height: 48px;
  color: #f59e0b; /* Amber color for blocked state */
}

.aisthetix-quota-blocked h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--aisthetix-text);
  margin: 0 0 8px 0;
}

.aisthetix-quota-blocked-message {
  padding: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--aisthetix-radius);
  color: #92400e;
  font-size: 14px;
  margin-bottom: 16px;
}

.aisthetix-quota-blocked-info {
  padding: 12px;
  background: var(--aisthetix-secondary);
  border-radius: var(--aisthetix-radius);
  margin-bottom: 20px;
}

.aisthetix-quota-blocked-plan {
  font-size: 14px;
  color: var(--aisthetix-text-muted);
  margin: 0;
}

.aisthetix-quota-blocked-plan strong {
  color: var(--aisthetix-text);
  font-weight: 600;
}

.aisthetix-quota-blocked-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Quota Warning Banner */
.aisthetix-quota-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--aisthetix-radius);
  margin-bottom: 16px;
}

.aisthetix-quota-warning-icon {
  flex-shrink: 0;
}

.aisthetix-quota-warning-icon svg {
  width: 20px;
  height: 20px;
  color: #f59e0b;
}

.aisthetix-quota-warning-content {
  flex: 1;
}

.aisthetix-quota-warning-text {
  font-size: 14px;
  color: #92400e;
  margin: 0;
  line-height: 1.5;
}

.aisthetix-quota-warning-text strong {
  font-weight: 600;
}

/* Free Tier Badge */
.aisthetix-free-tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--aisthetix-radius);
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  color: #065f46;
  text-align: center;
}
