.tool-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Upload Section */
.upload-section {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.upload-section h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.3rem;
  text-align: center;
}

.upload-area {
  border: 3px dashed rgba(102, 126, 234, 0.3);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary-color);
  background: rgba(102, 126, 234, 0.05);
  transform: translateY(-2px);
}

.upload-content {
  pointer-events: none;
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.upload-text {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.upload-hint {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Editor Section */
.editor-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Tools Panel */
.tools-panel {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  height: fit-content;
}

.tools-panel h3 {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  text-align: center;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.tool-group {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.tool-group h4 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.tool-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tool-btn {
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 2px solid rgba(102, 126, 234, 0.2);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.tool-btn:hover {
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.tool-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.tool-btn[data-active="true"] {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: white;
  border-color: var(--primary-color);
}

/* Quality Slider */
#qualitySlider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(102, 126, 234, 0.2);
  outline: none;
  -webkit-appearance: none;
}

#qualitySlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
}

#qualitySlider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
}

/* Aspect Ratio Select */
#aspectRatio, #outputFormat {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid rgba(102, 126, 234, 0.2);
  border-radius: var(--border-radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition);
}

#aspectRatio:focus, #outputFormat:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Preview Section */
.preview-section {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.preview-section h3 {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  text-align: center;
}

.preview-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.image-container {
  position: relative;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  overflow: hidden;
}

#imageCanvas {
  max-width: 100%;
  max-height: 500px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

/* Crop Overlay */
.crop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: crosshair;
}

.crop-area {
  position: absolute;
  border: 2px solid var(--primary-color);
  background: rgba(102, 126, 234, 0.1);
  cursor: move;
  min-width: 50px;
  min-height: 50px;
}

.crop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--primary-color);
  border: 2px solid white;
  border-radius: 50%;
}

.crop-handle.nw {
  top: -6px;
  left: -6px;
  cursor: nw-resize;
}

.crop-handle.ne {
  top: -6px;
  right: -6px;
  cursor: ne-resize;
}

.crop-handle.sw {
  bottom: -6px;
  left: -6px;
  cursor: sw-resize;
}

.crop-handle.se {
  bottom: -6px;
  right: -6px;
  cursor: se-resize;
}

/* Image Info */
.image-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 1rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.info-value {
  color: var(--text-primary);
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

/* Download Section */
.download-section {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.download-section h3 {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  text-align: center;
}

.download-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.download-btn {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Utility Classes */
.hidden {
  display: none;
}

/* Animations */
@keyframes processImage {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

.processing {
  animation: processImage 0.5s ease-out;
}

/* Responsive Design */
@media (max-width: 968px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .upload-area {
    padding: 1.5rem 1rem;
  }
  
  .upload-icon {
    font-size: 2rem;
  }
  
  .upload-text {
    font-size: 1rem;
  }
  
  .tools-grid {
    grid-template-columns: 1fr;
  }
  
  .download-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .download-btn,
  .tool-btn {
    width: 100%;
  }
  
  .image-info {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .tool-container {
    padding: 0 1rem;
  }
  
  .upload-area {
    padding: 1rem 0.5rem;
  }
  
  .tools-panel,
  .preview-section,
  .download-section {
    padding: 1rem;
  }
  
  .tool-group {
    padding: 1rem;
  }
  
  .info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
} 