/**
 * ImageComprezor - Custom Styles
 * Additional styles beyond Tailwind CSS
 */

:root {
  --primary-color: #3B82F6;
  --primary-dark: #2563EB;
  --success-color: #10B981;
  --warning-color: #F59E0B;
  --error-color: #EF4444;
  --text-color: #1F2937;
  --text-color-light: #6B7280;
  --bg-color: #F9FAFB;
  --card-color: #FFFFFF;
  --border-color: #E5E7EB;
  --shadow-color: rgba(0, 0, 0, 0.1);
}

.dark {
  --primary-color: #3B82F6;
  --primary-dark: #2563EB;
  --success-color: #10B981;
  --warning-color: #F59E0B;
  --error-color: #EF4444;
  --text-color: #F9FAFB;
  --text-color-light: #9CA3AF;
  --bg-color: #111827;
  --card-color: #1F2937;
  --border-color: #374151;
  --shadow-color: rgba(0, 0, 0, 0.3);
}

/* Apply dark mode */
.dark body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Custom range input styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: var(--border-color);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px var(--shadow-color);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px var(--shadow-color);
}

/* Custom checkbox styling */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  position: relative;
  background-color: transparent;
}

input[type="checkbox"]:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Custom radio button styling */
input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  outline: none;
  cursor: pointer;
  position: relative;
  background-color: transparent;
}

input[type="radio"]:checked {
  border-color: var(--primary-color);
}

input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary-color);
}

/* Drag and drop area */
.drag-area {
  border: 2px dashed var(--border-color);
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.drag-area.active {
  border-color: var(--primary-color);
  background-color: rgba(59, 130, 246, 0.05);
}

/* Comparison slider enhancements */
.comparison-slider {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px var(--shadow-color);
}

.comparison-slider .slider-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 5px var(--shadow-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.comparison-slider .slider-handle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-left: 2px solid var(--primary-color);
  border-right: 2px solid var(--primary-color);
}

/* Progress bar */
.progress-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--border-color);
  overflow: hidden;
}

.progress-bar .progress {
  height: 100%;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

/* File card */
.file-card {
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all 0.3s ease;
}

.file-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px var(--shadow-color);
}

/* Tooltip */
.tooltip {
  position: relative;
}

.tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem;
  background: var(--text-color);
  color: white;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 10;
  margin-bottom: 0.5rem;
}

/* Loading spinner */
.loading-spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid rgba(59, 130, 246, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
}

.badge-error {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .comparison-slider .slider-handle::after {
    width: 24px;
    height: 24px;
  }
  
  input[type="range"]::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
  }
  
  input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
  }
}