/* Tools Styles - Image Processing Tool Components */

/* Tool Header */
.tool-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3rem 0;
}

/* Upload Area */
.upload-area {
  border: 3px dashed #dee2e6;
  border-radius: 10px;
  text-align: center;
  transition: all var(--gg-transition-slow);
  background-color: #f8f9fa;
  cursor: pointer;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: 10px;
}

.upload-area.dragover {
  border-color: #667eea;
  background-color: rgba(102, 126, 234, 0.1);
  transform: scale(1.02);
}

.upload-area:hover {
  border-color: #667eea;
  background-color: rgba(102, 126, 234, 0.05);
}

.upload-icon {
  font-size: 2rem;
  color: #6c757d;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.upload-area.dragover .upload-icon {
  color: #667eea;
}

.file-input {
  display: none;
}

/* Tool Buttons */
.btn-upload {
  background: #667eea;
  border: none;
  color: white;
  padding: 0.75rem 2rem;
  border-radius: var(--gg-radius-button);
  font-weight: var(--gg-font-weight-semibold);
  transition: all var(--gg-transition-slow);
  min-width: var(--gg-touch-min);
  min-height: var(--gg-touch-min);
}

.btn-upload:hover, 
.btn-upload:focus {
  background: #5a67d8;
  color: white;
  transform: translateY(-2px);
}

.btn-process {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border: none;
  color: white;
  padding: 1rem 3rem;
  border-radius: var(--gg-radius-button);
  font-weight: var(--gg-font-weight-semibold);
  font-size: 1.1rem;
  transition: all var(--gg-transition-slow);
  min-width: var(--gg-touch-min);
  min-height: var(--gg-touch-min);
}

.btn-process:hover, 
.btn-process:focus {
  background: linear-gradient(135deg, #218838 0%, #1ca085 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.btn-process:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-download {
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
  border: none;
  color: white;
  padding: 1rem 3rem;
  border-radius: var(--gg-radius-button);
  font-weight: var(--gg-font-weight-semibold);
  font-size: 1.1rem;
  text-decoration: none;
  display: inline-block;
  transition: all var(--gg-transition-slow);
  min-width: var(--gg-touch-min);
  min-height: var(--gg-touch-min);
}

.btn-download:hover, 
.btn-download:focus {
  background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(23, 162, 184, 0.3);
}

/* Tool Sections */
.url-input-section {
  background: none;
  border-radius: 0;
  padding: 10px 20px 20px 20px;
  width: 100%;
}

.url-input-section .input-group {
  width: 100%;
}

.progress-container {
  display: none;
  margin: 2rem 0;
}

.progress {
  height: 20px;
  border-radius: 10px;
  background-color: #e9ecef;
}

.progress-bar {
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
}

.file-info {
  background: #e8f5e8;
  border: 1px solid #d4edda;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 2rem 0;
  display: none;
}

.file-info h5 {
  color: #155724;
  margin-bottom: 1rem;
}

.file-preview {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  box-shadow: var(--gg-shadow-card);
}

.tool-controls {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: var(--gg-shadow-card);
}

.tool-controls h5 {
  color: #495057;
  border-bottom: 2px solid #667eea;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

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

.control-group label {
  font-weight: var(--gg-font-weight-semibold);
  color: #495057;
  margin-bottom: 0.5rem;
}

/* Processing Status */
.processing-status {
  display: none;
  text-align: center;
  padding: 2rem;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 10px;
  margin: 2rem 0;
}

.processing-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Result Section */
.result-section {
  display: none;
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  border-radius: 10px;
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
}

.result-section h5 {
  color: #0c5460;
  margin-bottom: 1.5rem;
}

/* Error Messages */
.error-message {
  display: none;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 2rem 0;
  color: #721c24;
}

/* Help Section */
.help-section {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 2rem;
  margin-top: 3rem;
}

.help-section h5 {
  color: #495057;
  margin-bottom: 1rem;
}

/* Related Tools Cards */
.related-tool-card {
  transition: transform var(--gg-transition-fast);
}

.related-tool-card:hover {
  transform: translateY(-2px);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .tool-header {
    padding: 2rem 0;
  }
  
  .tool-header h1 {
    font-size: 2rem;
  }
  
  .upload-area {
    padding: 1.5rem 1rem;
    min-height: 120px;
  }
  
  .upload-area .d-flex {
    flex-wrap: nowrap !important;
    gap: 0.5rem;
  }
  
  .upload-area .text-center {
    flex-shrink: 1;
    min-width: 0;
  }
  
  .btn-upload, .btn-process, .btn-download {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    min-width: var(--gg-touch-min);
    min-height: var(--gg-touch-min);
  }
  
  .tool-controls {
    padding: 1.5rem;
  }
}

/* Legacy Browser Support */
.no-flexbox .upload-area {
  display: block;
  text-align: center;
  padding-top: 50px;
}

/* Touch Device Enhancements */
@media (hover: none) {
  .upload-area:hover {
    border-color: #dee2e6;
    background-color: #f8f9fa;
  }
  
  .btn-upload:hover, 
  .btn-process:hover, 
  .btn-download:hover {
    transform: none;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .upload-area {
    border-width: 4px;
  }
  
  .btn-upload, .btn-process, .btn-download {
    border: 2px solid;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .upload-area, 
  .btn-upload, 
  .btn-process, 
  .btn-download, 
  .processing-spinner {
    transition: none;
    animation: none;
  }
}

/* Compact Upload Area Styles */
.upload-area.compact {
  padding: 1rem;
  min-height: auto;
  border-width: 2px;
  border-style: solid;
  border-radius: 8px;
}

/* Compact Form Styles */
.form-label-sm {
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.alert-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

/* Borderless File Information */
.file-info-borderless {
  background-color: rgba(248, 249, 250, 0.5);
  border-radius: 8px;
  padding: 1rem;
  border: none;
}

/* Remove card-body spacing */
.card-body {
  padding: 0 !important;
  margin: 0 !important;
}

.upload-area.compact .upload-icon {
  font-size: 2rem;
  margin-bottom: 0;
  margin-right: 0.5rem;
}

.upload-section.compact {
  margin-bottom: 1.5rem;
}

.url-input-section.compact {
  margin-top: 1rem;
}

/* Reset settings link styling */
.reset-link {
  border-bottom: 1px dotted #6c757d;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.reset-link:hover {
  color: #495057 !important;
  border-bottom-color: #495057;
  text-decoration: none !important;
}

/* URL toggle link styling - make consistent with reset link */
#urlToggleBtn {
  border-bottom: 1px dotted #6c757d;
  transition: all 0.2s ease;
}

#urlToggleBtn:hover {
  color: #495057 !important;
  border-bottom-color: #495057;
  text-decoration: none !important;
}

/* Tool Navigation Cards - Compact styling */
.tool-nav-card {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #ffffff;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.tool-nav-card:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
  transform: translateY(-1px);
}

.tool-nav-card .card-body {
  padding: 0.5rem 0.75rem !important;
}

.tool-nav-link {
  color: #495057;
  text-decoration: none;
}

.tool-nav-link:hover {
  color: #667eea;
  text-decoration: none;
}