/* ============================================
   TOOL STYLES - Pro Compressor
   ============================================ */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-primary-dark: #0f0f12;
  --bg-secondary-dark: #1a1a1f;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-primary-dark: #f9fafb;
  --text-secondary-dark: #9ca3af;
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --success-color: #10b981;
  --border-color: #e2e8f0;
  --border-color-dark: #2d2d35;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-primary: var(--bg-primary-dark);
  --bg-secondary: var(--bg-secondary-dark);
  --text-primary: var(--text-primary-dark);
  --text-secondary: var(--text-secondary-dark);
  --border-color: var(--border-color-dark);
}

/* Tool Section */
.tool-section {
  padding: 40px 20px;
  background: var(--bg-secondary);
  transition: var(--transition-smooth);
}

.tool-section__container {
  max-width: 800px;
  margin: 0 auto;
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 20px;
  padding: 40px 24px;
  text-align: center;
  background: var(--bg-primary);
  transition: var(--transition-smooth);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.upload-area:hover {
  border-color: var(--primary-color);
  background: rgba(59, 130, 246, 0.02);
}

.upload-area--dragover {
  border-color: var(--primary-color);
  background: rgba(59, 130, 246, 0.08);
  transform: scale(1.01);
}

.upload-area--has-file {
  border-color: var(--success-color);
  background: rgba(16, 185, 129, 0.05);
}

.upload-area__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.upload-area__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  color: var(--primary-color);
  transition: var(--transition-smooth);
}

.upload-area:hover .upload-area__icon {
  transform: translateY(-4px);
}

.upload-area__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  transition: var(--transition-smooth);
}

.upload-area__subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  transition: var(--transition-smooth);
}

.upload-area__formats {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.upload-area__format {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 4px 10px;
  border-radius: 20px;
  transition: var(--transition-smooth);
}

[data-theme="dark"] .upload-area__format {
  background: var(--bg-secondary-dark);
}

/* File Info */
.file-info {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-primary);
  border-radius: 16px;
  margin-top: 20px;
  border: 1px solid var(--border-color);
  animation: slideUp 0.3s ease-out;
  width: 100%;
}

.file-info--visible {
  display: flex;
}

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

.file-info__icon {
  width: 44px;
  height: 44px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-info__icon svg {
  width: 22px;
  height: 22px;
  color: var(--primary-color);
}

.file-info__details {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.file-info__name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.file-info__size {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.file-info__remove {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.file-info__remove:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.05);
}

.file-info__remove svg {
  width: 18px;
  height: 18px;
}

/* Compression Controls */
.compression-controls {
  display: none;
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-primary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  animation: slideUp 0.3s ease-out;
  width: 100%;
}

.compression-controls--visible {
  display: block;
}

.compression-controls__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.compression-controls__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.compression-controls__value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary-color);
  background: rgba(59, 130, 246, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
}

.compression-controls__slider {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-secondary);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.compression-controls__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
  transition: var(--transition-smooth);
}

.compression-controls__slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
}

.compression-controls__slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.compression-controls__hints {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.6875rem;
  color: var(--text-secondary);
}

/* Output Format Selection */
.output-format {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.output-format--visible {
  display: block;
}

.output-format__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: block;
}

.output-format__select {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 44px;
}

.output-format__select:hover {
  border-color: var(--primary-color);
}

.output-format__select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Action Buttons */
.tool-actions {
  display: none;
  gap: 12px;
  margin-top: 20px;
  width: 100%;
}

.tool-actions--visible {
  display: flex;
  flex-direction: column;
}

@media (min-width: 480px) {
  .tool-actions {
    flex-direction: row;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
  flex: 1;
}

.btn--primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn--primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn--primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn--secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn--secondary:hover {
  background: var(--border-color);
}

.btn__icon {
  width: 18px;
  height: 18px;
}

/* Progress Indicator */
.compression-progress {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 28px;
  background: var(--bg-primary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  margin-top: 20px;
  width: 100%;
}

.compression-progress--visible {
  display: flex;
}

.compression-progress__spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--bg-secondary);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.compression-progress__text {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Result Section */
.compression-result {
  display: none;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  background: var(--bg-primary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  margin-top: 20px;
  animation: slideUp 0.3s ease-out;
  width: 100%;
}

.compression-result--visible {
  display: flex;
}

.compression-result__header {
  text-align: center;
}

.compression-result__title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--success-color);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.compression-result__subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.compression-result__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.compression-result__stat {
  text-align: center;
  padding: 14px 8px;
  background: var(--bg-secondary);
  border-radius: 12px;
}

.compression-result__stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.compression-result__stat-label {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.compression-result__download {
  width: 100%;
}

/* Responsive */
@media (max-width: 640px) {
  .tool-section {
    padding: 32px 16px;
  }
  
  .upload-area {
    padding: 32px 20px;
  }
  
  .upload-area__icon {
    width: 48px;
    height: 48px;
  }
  
  .upload-area__title {
    font-size: 1rem;
  }
  
  .upload-area__subtitle {
    font-size: 0.8125rem;
  }
  
  .compression-controls {
    padding: 16px;
  }
  
  .compression-result {
    padding: 20px;
  }
  
  .compression-result__stat {
    padding: 12px 6px;
  }
  
  .compression-result__stat-value {
    font-size: 0.875rem;
  }
  
  .btn {
    padding: 12px 20px;
    font-size: 0.875rem;
  }
}
