/* ADC Image Composer Frontend Styles */

/* Container and Layout */
.adc-image-composer-container {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #f8fafc;
  min-height: 600px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Logo */
.adc-logo {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
}

.adc-logo img {
  height: 80px;
  width: auto;
  max-width: 200px;
}

/* Main Wrapper */
.adc-composer-wrapper {
  display: flex;
  gap: 24px;
  padding: 24px;
  padding-top: 112px; /* Account for logo */
  min-height: 600px;
}

/* Control Panel */
.adc-control-panel {
  width: 320px;
  background: white;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  height: fit-content;
  flex-shrink: 0;
}

.adc-panel-section {
  margin-bottom: 32px;
}

.adc-panel-section:last-child {
  margin-bottom: 0;
}

.adc-panel-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: #1f2937;
}

/* Buttons */
.adc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  width: 100%;
  margin-bottom: 8px;
}

.adc-btn:last-child {
  margin-bottom: 0;
}

.adc-btn-primary {
  background: #0ea5e9;
  color: white;
}

.adc-btn-primary:hover:not(:disabled) {
  background: #0284c7;
}

.adc-btn-outline {
  background: transparent;
  color: #374151;
  border: 1px solid #d1d5db;
}

.adc-btn-outline:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #9ca3af;
}

.adc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.adc-icon {
  font-size: 16px;
}

/* Help Text */
.adc-help-text {
  font-size: 13px;
  color: #6b7280;
  margin: 8px 0 0 0;
  line-height: 1.4;
}

/* Info Text */
.adc-info-text {
  font-size: 14px;
  color: #374151;
}

.adc-info-text p {
  margin: 0 0 4px 0;
}

/* Instructions */
.adc-instructions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.adc-instruction-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #6b7280;
}

/* Canvas Container */
.adc-canvas-container {
  flex: 1;
  background: white;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.adc-canvas-header {
  margin-bottom: 16px;
}

.adc-canvas-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: #1f2937;
}

.adc-canvas-header p {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

/* Canvas Wrapper */
.adc-canvas-wrapper {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

/* Canvas */
.adc-canvas {
  position: relative;
  background: white;
  overflow: hidden;
}

/* Grid Overlay */
.adc-grid-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  pointer-events: none;
  background-image: linear-gradient(to right, #000 1px, transparent 1px),
    linear-gradient(to bottom, #000 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Drop Zone */
.adc-drop-zone {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #6b7280;
}

.adc-drop-zone-content {
  padding: 40px;
}

.adc-upload-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
  opacity: 0.5;
}

.adc-drop-zone p {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 500;
}

.adc-sub-text {
  font-size: 14px !important;
  font-weight: 400 !important;
  opacity: 0.8;
}

/* Images */
.adc-image {
  position: absolute;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: move;
  transition: border-color 0.2s ease;
  user-select: none;
}

.adc-image:hover,
.adc-image.adc-active {
  border-color: #0ea5e9;
}

.adc-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
  pointer-events: none;
}

/* Resize Handle */
.adc-resize-handle {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  background: #0ea5e9;
  border: 2px solid white;
  border-radius: 2px;
  cursor: se-resize;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.adc-image:hover .adc-resize-handle,
.adc-image.adc-active .adc-resize-handle {
  opacity: 1;
}

/* Remove Button */
.adc-remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: #ef4444;
  color: white;
  border: 2px solid white;
  border-radius: 50%;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.adc-remove-btn:hover {
  background: #dc2626;
}

.adc-image:hover .adc-remove-btn,
.adc-image.adc-active .adc-remove-btn {
  opacity: 1;
}

/* Modal */
.adc-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.adc-modal-content {
  background: white;
  border-radius: 8px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.adc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0 24px;
}

.adc-modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: #1f2937;
}

.adc-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.adc-close-btn:hover {
  color: #374151;
}

.adc-modal-body {
  padding: 24px;
}

.adc-modal-body img {
  max-width: 100%;
  height: auto;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
}

.adc-modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 0 24px 24px 24px;
}

.adc-modal-footer .adc-btn {
  width: auto;
  margin-bottom: 0;
}

/* Themes */
.adc-theme-dark {
  background: #1f2937;
  color: white;
}

.adc-theme-dark .adc-control-panel,
.adc-theme-dark .adc-canvas-container {
  background: #374151;
  color: white;
}

.adc-theme-dark .adc-canvas {
  background: #4b5563;
}

.adc-theme-minimal .adc-logo {
  display: none;
}

.adc-theme-minimal .adc-composer-wrapper {
  padding-top: 24px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .adc-composer-wrapper {
    flex-direction: column;
  }

  .adc-control-panel {
    width: 100%;
    order: 2;
  }

  .adc-canvas-container {
    order: 1;
  }

  .adc-canvas {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1860 / 738;
    min-height: 300px;
  }
}

@media (max-width: 768px) {
  .adc-composer-wrapper {
    padding: 16px;
    gap: 16px;
  }

  .adc-control-panel,
  .adc-canvas-container {
    padding: 16px;
  }

  .adc-logo img {
    height: 60px;
  }

  .adc-composer-wrapper {
    padding-top: 80px;
  }

  .adc-modal-content {
    margin: 16px;
    max-width: calc(100vw - 32px);
  }

  .adc-modal-header,
  .adc-modal-body,
  .adc-modal-footer {
    padding: 16px;
  }

  .adc-modal-footer {
    flex-direction: column;
  }

  .adc-modal-footer .adc-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .adc-instructions {
    gap: 8px;
  }

  .adc-instruction-item {
    font-size: 13px;
  }

  .adc-panel-section {
    margin-bottom: 24px;
  }

  .adc-canvas-header h3 {
    font-size: 16px;
  }
}

/* Print Styles */
@media print {
  .adc-image-composer-container {
    box-shadow: none;
    background: white;
  }

  .adc-control-panel {
    display: none;
  }

  .adc-canvas-container {
    width: 100%;
  }

  .adc-modal {
    display: none !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .adc-image-composer-container {
    border: 2px solid #000;
  }

  .adc-btn-outline {
    border-color: #000;
    color: #000;
  }

  .adc-image {
    border-color: #000;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .adc-btn,
  .adc-image,
  .adc-resize-handle,
  .adc-remove-btn {
    transition: none;
  }
}
