/* Image Grid Splitter Specific Styles */

.grid-split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

@media (max-width: 992px) {
  .grid-split-layout {
    grid-template-columns: 1fr;
  }
}

/* Upload Area & Preview */
.upload-area {
  margin-top: var(--space-md);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 0;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  background: rgba(10, 14, 26, 0.3);
  min-height: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.upload-area:hover, .upload-area.dragover {
  border-color: var(--accent-primary);
  background: rgba(108, 99, 255, 0.05);
}

.upload-placeholder {
  padding: var(--space-xl);
  pointer-events: none;
}

.upload-icon {
  font-size: 3.5rem;
  margin-bottom: var(--space-sm);
  display: block;
}

/* Preview Image within a perfect square container */
.preview-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.image-preview {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Important: this mimics the center crop */
  filter: brightness(0.85);
}

/* Dashed 3x3 Grid Overlay */
.grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  z-index: 5;
  pointer-events: none;
}

.grid-cell {
  border: 1px dashed rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 2rem;
  font-weight: bold;
  text-shadow: 0 2px 5px rgba(0,0,0,0.8);
}

.btn-clear {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: rgba(239, 71, 111, 0.9);
  color: white;
  border: none;
  z-index: 10;
}

.btn-clear:hover {
  background: var(--accent-danger);
}

/* Alerts */
.alert {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: rgba(108, 99, 255, 0.1);
  border-left: 4px solid var(--accent-primary);
}

.spinner {
  display: inline-block;
  animation: spin 1.5s linear infinite;
}

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