/* ResizeKit - Tools Stylesheet */

.tool-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.tool-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 2rem 1rem;
  margin: -2rem -1rem 2rem -1rem;
  text-align: center;
}

.tool-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.tool-header p {
  font-size: 1.1rem;
  opacity: 0.95;
}

.breadcrumb {
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  color: var(--text-secondary);
  margin: 0 0.5rem;
}

/* Upload Area */
.upload-area {
  background: var(--card-bg);
  border: 3px dashed var(--primary-color);
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 2rem;
}

.upload-area:hover {
  background: var(--bg-color);
  border-color: var(--primary-dark);
}

.upload-area.dragover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary-dark);
  transform: scale(1.02);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.upload-area h3 {
  margin-bottom: 0.5rem;
}

.upload-area p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.upload-area input[type="file"] {
  display: none;
}

/* Two Column Layout */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.tool-section {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.tool-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

/* Preview Container */
.preview-container {
  background: var(--bg-color);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.preview-container img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 6px;
  object-fit: contain;
}

.preview-placeholder {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Controls */
.controls {
  margin-top: 1.5rem;
}

.control-group {
  margin-bottom: 1.5rem;
}

.control-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.control-group input[type="number"],
.control-group input[type="text"],
.control-group input[type="range"],
.control-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.3s;
}

.control-group input[type="number"]:focus,
.control-group input[type="text"]:focus,
.control-group input[type="range"]:focus,
.control-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.input-group input {
  flex: 1;
}

.input-unit {
  padding: 0.75rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  min-width: 60px;
  text-align: center;
}

.slider-value {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-left: 0.5rem;
  font-weight: 600;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.action-buttons .btn {
  flex: 1;
  min-width: 150px;
  text-align: center;
}

.btn-download {
  background-color: var(--success-color);
  color: white;
}

.btn-download:hover {
  background-color: #059669;
}

.btn-download:disabled {
  background-color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.6;
}

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

.btn-reset:hover {
  background-color: #475569;
}

/* Progress Indicator */
.progress-container {
  margin: 1.5rem 0;
  display: none;
}

.progress-container.active {
  display: block;
}

.progress-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  width: 0%;
  transition: width 0.3s;
}

/* Status Messages */
.status-message {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: none;
  font-size: 0.95rem;
}

.status-message.show {
  display: block;
}

.status-message.success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-left: 4px solid var(--success-color);
}

.status-message.error {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border-left: 4px solid var(--danger-color);
}

.status-message.info {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
  border-left: 4px solid var(--primary-color);
}

/* Info Box */
.info-box {
  background: rgba(99, 102, 241, 0.05);
  border-left: 4px solid var(--primary-color);
  padding: 1rem;
  border-radius: 6px;
  margin: 1.5rem 0;
  color: var(--text-primary);
}

.info-box strong {
  color: var(--primary-color);
}

/* File Info */
.file-info {
  background: var(--bg-color);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: none;
}

.file-info.show {
  display: block;
}

.file-info-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.file-info-item:last-child {
  border-bottom: none;
}

.file-info-label {
  font-weight: 600;
  color: var(--text-primary);
}

.file-info-value {
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }

  .tool-header h1 {
    font-size: 1.75rem;
  }

  .upload-area {
    padding: 2rem 1rem;
  }

  .action-buttons {
    flex-direction: column;
  }

  .action-buttons .btn {
    min-width: auto;
  }
}

/* Loading State */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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