/* Image Compressor Tool - Clean & Simple */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

.imagecomp-container {
  padding: 0 2rem;
  max-width: 1200px;
  margin: 0 auto;
  font-family: 'Poppins', sans-serif;
}

.imagecomp-wrapper {
  max-width: 950px;
  margin: 0 auto;
}

.imagecomp-title {
  font-size: 3.2rem;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.imagecomp-heart {
  display: inline-block;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.imagecomp-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
}

.imagecomp-card {
  background: var(--surface);
  border-radius: var(--radius, 16px);
  box-shadow: var(--shadow);
  padding: 2rem;
  border: 1px solid var(--border);
}

/* Upload Area */
.imagecomp-upload-area {
  border: 3px dashed var(--border);
  border-radius: 12px;
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--bg);
}

.imagecomp-upload-area:hover,
.imagecomp-upload-area.drag-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.imagecomp-upload-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 1rem;
}

.imagecomp-upload-prompt {
  color: var(--text-light);
}

.imagecomp-upload-prompt strong {
  color: var(--primary);
}

.batch-badge {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.25rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* Settings */
.imagecomp-settings {
  margin-top: 2rem;
}

.imagecomp-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.imagecomp-field label {
  display: block;
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.imagecomp-range {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.imagecomp-range input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  background: transparent;
  padding: 0;
}

.imagecomp-range input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
}

.imagecomp-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  margin-top: -6px;
}

.imagecomp-range span {
  min-width: 45px;
  font-weight: 700;
  color: var(--primary);
}

.imagecomp-select {
  width: 100%;
  padding: 0.7rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
}

.imagecomp-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.imagecomp-resize {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.resize-input {
  width: 60px;
  padding: 0.7rem 0.4rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  text-align: center;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.resize-input:focus {
  outline: none;
  border-color: var(--primary);
}

.resize-input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.resize-x {
  font-weight: 700;
  color: var(--text-light);
}

.resize-toggle {
  background: var(--border);
  border: none;
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1rem;
}

.resize-toggle:hover {
  background: var(--primary);
  color: white;
}

.resize-toggle.active {
  background: var(--primary);
  color: white;
}

/* Buttons */
.imagecomp-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.imagecomp-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.imagecomp-btn:hover {
  background: var(--primary-dark, #4f46e5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.imagecomp-btn-secondary {
  background: var(--text-light);
}

.imagecomp-btn-secondary:hover {
  background: var(--text);
}

.imagecomp-btn-outline {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.imagecomp-btn-outline:hover {
  background: var(--border);
  transform: none;
  box-shadow: none;
}

/* Batch Progress */
.imagecomp-batch-progress {
  margin-bottom: 1.5rem;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #10b981);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  display: block;
  text-align: center;
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Result */
.imagecomp-result {
  margin-top: 2rem;
}

.imagecomp-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.imagecomp-panel {
  text-align: center;
}

.imagecomp-panel h3 {
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
}

.imagecomp-preview {
  position: relative;
  display: inline-block;
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
}

.imagecomp-preview img {
  max-width: 100%;
  max-height: 350px;
  display: block;
}

.imagecomp-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 0.15rem 0.7rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}

.imagecomp-badge.savings {
  background: #10b981;
  top: auto;
  bottom: 10px;
}

.imagecomp-info {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.saved-text {
  color: #10b981;
  font-weight: 600;
}

.imagecomp-result-actions {
  margin-top: 1.5rem;
}

.imagecomp-funfact {
  text-align: center;
  color: var(--text-light);
  font-style: italic;
  margin-top: 1.5rem;
  padding: 0.8rem;
  background: rgba(99, 102, 241, 0.05);
  border-radius: 12px;
}

/* Related Tools */
.imagesplit-related {
  max-width: 950px;
  margin: 3rem auto;
  padding: 2rem;
  background: var(--surface);
  border-radius: var(--radius, 16px);
  border: 1px solid var(--border);
}

.imagesplit-related h3 {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.related-category h4 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.related-category ul {
  list-style: none;
  padding: 0;
}

.related-category ul li {
  padding: 0.2rem 0;
}

.related-category ul li a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.related-category ul li a:hover {
  color: var(--primary);
}

.related-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-light);
}

/* Responsive */
@media screen and (max-width: 768px) {
  .imagecomp-container {
    padding: 1rem;
  }
  
  .imagecomp-title {
    font-size: 2.2rem;
  }
  
  .imagecomp-subtitle {
    font-size: 1rem;
  }
  
  .imagecomp-card {
    padding: 1.2rem;
  }
  
  .imagecomp-controls {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .imagecomp-comparison {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .imagecomp-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .imagecomp-btn {
    width: 100%;
    text-align: center;
  }
  
  .rating-header {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .related-grid {
    grid-template-columns: 1fr;
  }
  
  .seo-content-area h2 {
    font-size: 1.6rem;
  }
  
  .seo-content-area h3 {
    font-size: 1.2rem;
  }
}

@media screen and (max-width: 480px) {
  .imagecomp-title {
    font-size: 1.8rem;
  }
  
  .imagecomp-upload-area {
    padding: 2rem 1rem;
  }
  
  .imagecomp-upload-icon {
    font-size: 2.5rem;
  }
  
  .star {
    font-size: 1.5rem;
  }
  
  .imagecomp-preview img {
    max-height: 200px;
  }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .imagecomp-card {
    background: var(--surface);
  }
  
  .imagecomp-upload-area:hover {
    background: rgba(99, 102, 241, 0.1);
  }
}

/* ZIP Download Button */
#imagecomp-download-zip {
  background: #10b981;
}

#imagecomp-download-zip:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

#imagecomp-download-zip:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Responsive adjustments for ZIP button */
@media screen and (max-width: 768px) {
  #imagecomp-download-zip {
    width: 100%;
  }
}