﻿/* ============================================
   TOOL INTERFACE STYLES
   Uses CSS variables from main.001.css
   ============================================ */

/* Tool Interface Container */
.tool-interface {
 max-width: 700px;
 margin: 0 auto;
}

/* Upload Zone - 30% Secondary + 10% Accent on interaction */
.upload-zone {
 border: 3px dashed var(--color-border);
 border-radius: 12px;
 padding: 60px 20px;
 text-align: center;
 background: var(--color-secondary);
 transition: all 0.3s ease;
 cursor: pointer;
}

 .upload-zone:hover {
  border-color: var(--color-primary);
  background: var(--color-surface);
 }

 .upload-zone.drag-over {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
  transform: scale(1.02);
 }

.upload-content {
 pointer-events: none;
}

.upload-icon {
 font-size: 3.5rem;
 margin-bottom: 20px;
 opacity: 0.7;
}

.upload-zone p {
 color: var(--color-text-secondary);
 margin: 12px 0;
 font-size: 0.95rem;
}

.file-hint {
 font-size: 0.85rem;
 color: var(--color-text-tertiary);
 margin-top: 16px;
}

/* Primary Button - 10% Accent */
.btn-primary {
 padding: 14px 32px;
 font-size: 16px;
 border: 2px solid var(--color-primary);
 border-radius: 8px;
 background: var(--color-surface);
 color: var(--color-primary);
 cursor: pointer;
 font-weight: 600;
 transition: all 0.2s ease;
 font-family: inherit;
 pointer-events: auto;
}

 .btn-primary:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
 }

 .btn-primary:active {
  transform: translateY(0);
 }

/* Success Button - 10% Accent */
.btn-success {
 background: var(--color-accent);
 color: white;
 padding: 14px 32px;
 font-size: 16px;
 border: none;
 border-radius: 8px;
 cursor: pointer;
 font-weight: 600;
 transition: all 0.2s ease;
 width: 100%;
 margin-top: 20px;
 box-shadow: var(--shadow-sm);
 font-family: inherit;
}

 .btn-success:hover:not(:disabled) {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
 }

 .btn-success:active:not(:disabled) {
  transform: translateY(0);
 }

 .btn-success:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
 }

/* Secondary Buttons */
.btn-secondary {
 padding: 8px 16px;
 font-size: 14px;
 border: 2px solid var(--color-primary);
 border-radius: 6px;
 background: transparent;
 color: var(--color-primary);
 cursor: pointer;
 font-weight: 600;
 transition: all 0.2s ease;
 font-family: inherit;
}

 .btn-secondary:hover {
  background: var(--color-primary);
  color: white;
 }

 .btn-secondary:active {
  transform: scale(0.98);
 }

/* Tool Options - 30% Secondary */
.tool-options {
 background: var(--color-surface);
 border: 1px solid var(--color-border);
 padding: 20px;
 border-radius: 8px;
 margin: 20px 0;
 box-shadow: var(--shadow-sm);
}

 .tool-options label {
  display: block;
  margin-bottom: 8px;
  margin-top: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: 0.95rem;
 }

  .tool-options label:first-child {
   margin-top: 0;
  }

  .tool-options label input[type="checkbox"] {
   margin-right: 8px;
   cursor: pointer;
  }

 .tool-options select,
 .tool-options input[type="number"],
 .tool-options input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--color-border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-family: inherit;
  transition: border-color 0.2s;
 }

  .tool-options select:focus,
  .tool-options input[type="number"]:focus,
  .tool-options input[type="text"]:focus {
   outline: none;
   border-color: var(--color-primary);
  }

 .tool-options input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--color-border);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
 }

  .tool-options input[type="range"]::-webkit-slider-thumb {
   -webkit-appearance: none;
   appearance: none;
   width: 20px;
   height: 20px;
   border-radius: 50%;
   background: var(--color-primary);
   cursor: pointer;
   transition: all 0.2s;
  }

  .tool-options input[type="range"]::-moz-range-thumb {
   width: 20px;
   height: 20px;
   border-radius: 50%;
   background: var(--color-primary);
   cursor: pointer;
   border: none;
   transition: all 0.2s;
  }

  .tool-options input[type="range"]::-webkit-slider-thumb:hover {
   transform: scale(1.2);
   box-shadow: 0 0 0 4px var(--color-secondary);
  }

  .tool-options input[type="range"]::-moz-range-thumb:hover {
   transform: scale(1.2);
   box-shadow: 0 0 0 4px var(--color-secondary);
  }

 .tool-options input[type="color"] {
  width: 60px;
  height: 40px;
  padding: 4px;
  border: 2px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  background: var(--color-surface);
 }

/* Quality/Range Value Display */
#qualityValue,
#dimensionsValue {
 display: inline-block;
 margin-left: 12px;
 font-weight: 600;
 color: var(--color-primary);
 font-size: 1rem;
}

/* File List - 30% Secondary */
.file-list {
 background: var(--color-surface);
 border: 1px solid var(--color-border);
 padding: 20px;
 border-radius: 12px;
 margin: 20px 0;
 box-shadow: var(--shadow-sm);
}

 .file-list h3 {
  margin-bottom: 12px;
  color: var(--color-text-primary);
  font-size: 1rem;
 }

 .file-list p {
  color: var(--color-text-secondary);
  margin: 8px 0;
  font-size: 0.9rem;
 }

.file-item {
 display: flex;
 justify-content: space-between;
 align-items: center;
 padding: 12px;
 border-bottom: 1px solid var(--color-border);
 color: var(--color-text-primary);
}

 .file-item:last-child {
  border-bottom: none;
 }

 .file-item span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 12px;
 }

 .file-item button {
  background: var(--color-error);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
 }

  .file-item button:hover {
   opacity: 0.85;
  }

/* Result Messages - 10% Status Colors */
.result {
 margin-top: 20px;
 padding: 16px 20px;
 border-radius: 8px;
 text-align: center;
 font-weight: 600;
 box-shadow: var(--shadow-sm);
}

 .result.success {
  background: var(--color-success);
  color: white;
 }

 .result.error {
  background: var(--color-error);
  color: white;
 }

 .result.info {
  background: var(--color-info);
  color: white;
 }

 .result.warning {
  background: var(--color-warning);
  color: white;
 }

/* Image Preview - 30% Secondary */
#imagePreview {
 background: var(--color-secondary);
 border: 1px solid var(--color-border);
 padding: 20px;
 border-radius: 12px;
 max-width: 800px;
 margin: 20px auto;
 box-shadow: var(--shadow-sm);
}

#cropImage {
 max-width: 100%;
 display: block;
 border-radius: 8px;
}

#cropInfo {
 font-size: 14px;
 font-weight: 600;
 color: var(--color-text-primary);
 text-align: center;
 margin-top: 10px;
}

/* Aspect Ratio Button Grid */
.tool-options .aspect-ratio-grid {
 display: grid;
 grid-template-columns: repeat(4, 1fr);
 gap: 10px;
 margin-bottom: 15px;
}

/* Progress Indicator (optional) */
.progress-bar {
 width: 100%;
 height: 6px;
 background: var(--color-border);
 border-radius: 3px;
 overflow: hidden;
 margin: 10px 0;
}

.progress-bar-fill {
 height: 100%;
 background: var(--color-accent);
 transition: width 0.3s ease;
}

/* Loading Spinner (optional) */
.spinner {
 display: inline-block;
 width: 20px;
 height: 20px;
 border: 3px solid var(--color-border);
 border-top-color: var(--color-primary);
 border-radius: 50%;
 animation: spin 0.6s linear infinite;
 margin-right: 8px;
 vertical-align: middle;
}

@keyframes spin {
 to {
  transform: rotate(360deg);
 }
}

/* File Size Badge */
.file-size-badge {
 display: inline-block;
 padding: 4px 8px;
 background: var(--color-secondary);
 border-radius: 4px;
 font-size: 0.75rem;
 font-weight: 600;
 color: var(--color-text-secondary);
 margin-left: 8px;
}

/* Tooltip (optional) */
.tooltip {
 position: relative;
 display: inline-block;
 cursor: help;
}

 .tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  background: var(--color-text-primary);
  color: var(--color-surface);
  font-size: 0.85rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  margin-bottom: 8px;
 }

 .tooltip:hover::after {
  opacity: 1;
 }

/* Responsive Adjustments */
@media (max-width: 768px) {
 .tool-interface {
  max-width: 100%;
 }

 .upload-zone {
  padding: 40px 20px;
 }

 .upload-icon {
  font-size: 2.5rem;
 }

 .btn-primary,
 .btn-success {
  padding: 12px 24px;
  font-size: 15px;
 }

 .tool-options {
  padding: 16px;
 }

  .tool-options .aspect-ratio-grid {
   grid-template-columns: repeat(2, 1fr);
  }

 .file-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
 }

  .file-item span {
   margin-right: 0;
  }

  .file-item button {
   align-self: flex-end;
  }
}

@media (max-width: 480px) {
 .upload-zone {
  padding: 30px 15px;
 }

 .tool-options .aspect-ratio-grid {
  grid-template-columns: 1fr;
 }
}
