/* Label Designer Styles */

/* Canvas Preview Container */
.label-canvas-container {
  position: relative;
  border: 2px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0.5rem;
  overflow: hidden;
}

/* Canvas with Grid Background */
.label-canvas {
  position: relative;
  background: white;
  background-image: 
    linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  margin: 20px auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Label Objects */
.label-object {
  position: absolute;
  border: 1px solid #6b7280;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.label-object:hover {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  z-index: 9999 !important;
}

.label-object.rectangle {
  background: rgba(0, 123, 255, 0.05);
}

.label-object.text_block {
  font-size: 0.75rem;
  overflow: hidden;
}

.label-object.image {
  background: rgba(76, 175, 80, 0.05);
}

/* Z-order Badge */
.label-object .z-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #1f2937;
  color: white;
  padding: 0 0.25rem;
  font-size: 0.625rem;
  line-height: 1.25rem;
  font-weight: 500;
  pointer-events: none;
}

/* Object List Items */
.object-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  background: #f9fafb;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
}

.object-list-item:hover {
  background: #f3f4f6;
}

.object-list-item .object-type-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.object-list-item .object-type-badge.rectangle {
  background: #dbeafe;
  color: #1e40af;
}

.object-list-item .object-type-badge.text_block {
  background: #fef3c7;
  color: #92400e;
}

.object-list-item .object-type-badge.image {
  background: #d1fae5;
  color: #065f46;
}

.object-list-item .object-type-badge.pictogram_block {
  background: #d1fae5;
  color: #065f46;
}

.object-list-item .object-type-badge.color_block {
  background: #e9d5ff;
  color: #6b21a8;
}

/* PDF Status Alerts */
.pdf-status-complete {
  animation: fadeIn 0.3s ease-in;
}

.pdf-status-processing {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Loading Spinner */
.loading-spinner {
  border: 2px solid #f3f4f6;
  border-top-color: #3b82f6;
  border-radius: 50%;
  width: 1rem;
  height: 1rem;
  animation: spin 0.6s linear infinite;
  display: inline-block;
  margin-right: 0.5rem;
}

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

/* Admin Grid Layout for Backgrounds */
.background-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.background-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.background-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.background-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.background-card .card-info {
  padding: 0.75rem;
  background: white;
}

/* Responsive Canvas - Now handled via percentage-based sizing in the view */
