/* Custom styles for HEIC2Photo.com */
:root {
  --brand-primary: #14b8a6;
  --brand-secondary: #f97316;
  --brand-light: #5eead4;
  --brand-dark: #0f766e;
}

/* Dark mode customizations */
.dark {
  --brand-primary: #14b8a6;
  --brand-secondary: #fb923c;
  --brand-light: #2dd4bf;
  --brand-dark: #0d9488;
}

/* Animated gradient background */
.gradient-bg {
  background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
}

.dark .gradient-bg {
  background-image: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Drop zone animations */
.drop-zone {
  border: 2px dashed #cbd5e1;
  transition: all 0.3s ease;
  background-color: rgba(255, 255, 255, 0.7);
}

.drop-zone.compact {
  padding: 1.5rem;
}

.drop-zone.compact svg:first-child,
.drop-zone.compact h3,
.drop-zone.compact p,
.drop-zone.compact button {
  display: none;
}

.drop-zone.compact::after {
  content: '+ Drop more files or click to add';
  color: var(--brand-primary);
  font-weight: 500;
}

.dark .drop-zone {
  border-color: #475569;
  background-color: rgba(30, 41, 59, 0.7);
}

.drop-zone:hover {
  border-color: var(--brand-primary);
  transform: scale(1.01);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.drop-zone.dragover {
  background-color: rgba(20, 184, 166, 0.1);
  border-color: var(--brand-primary);
  transform: scale(1.02);
}

.dark .drop-zone.dragover {
  background-color: rgba(20, 184, 166, 0.2);
}

/* Button animations */
.btn-primary {
  background-color: var(--brand-primary);
  transition: all 0.2s ease;
  transform: translateY(0);
}

.btn-primary:hover {
  background-color: var(--brand-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(20, 184, 166, 0.2);
}

.btn-secondary {
  background-color: var(--brand-secondary);
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: #ea580c;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.2);
}

/* Success animation */
@keyframes checkmark {
  0% { transform: scale(0) rotate(45deg); }
  50% { transform: scale(1.2) rotate(45deg); }
  100% { transform: scale(1) rotate(45deg); }
}

.checkmark {
  animation: checkmark 0.5s ease forwards;
}

/* Progress bar animation */
@keyframes progress {
  0% { width: 0%; }
  100% { width: 100%; }
}

.progress-bar {
  animation: progress 2s ease-in-out forwards;
}

/* Card hover effects */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .4s;
  border-radius: 34px;
}

.dark .slider {
  background-color: #475569;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--brand-primary);
}

input:checked + .slider:before {
  transform: translateX(32px);
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* Delay animation for staggered effects */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* Converting pulse animation */
@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.converting {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Fade out animation */
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-20px); }
}

.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

/* Spin animation for loading states */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

/* Bounce animation for success */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.bounce {
  animation: bounce 0.5s ease;
}

/* Result item entrance */
.result-item {
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
}

/* Error toast styling */
.error-toast {
  backdrop-filter: blur(8px);
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
  .btn-primary,
  .btn-secondary,
  .download-btn {
    min-height: 48px;
    min-width: 48px;
  }

  .drop-zone {
    min-height: 200px;
  }
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .drop-zone {
    padding: 2rem 1rem;
  }

  .drop-zone h3 {
    font-size: 1.125rem;
  }
}

/* Slider custom styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
}

.dark input[type="range"] {
  background: #475569;
}

input[type="range"]::-webkit-slider-runnable-track {
  background: transparent;
  height: 8px;
  border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  background: var(--brand-primary);
  height: 22px;
  width: 22px;
  border-radius: 50%;
  margin-top: -7px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

input[type="range"]::-moz-range-track {
  background: #e2e8f0;
  height: 8px;
  border-radius: 4px;
}

.dark input[type="range"]::-moz-range-track {
  background: #475569;
}

input[type="range"]::-moz-range-thumb {
  background: var(--brand-primary);
  height: 22px;
  width: 22px;
  border-radius: 50%;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease;
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.1);
}

/* MS Edge/IE slider styling */
input[type="range"]::-ms-track {
  background: transparent;
  border-color: transparent;
  color: transparent;
  height: 8px;
}

input[type="range"]::-ms-fill-lower {
  background: var(--brand-primary);
  border-radius: 4px;
}

input[type="range"]::-ms-fill-upper {
  background: #e2e8f0;
  border-radius: 4px;
}

.dark input[type="range"]::-ms-fill-upper {
  background: #475569;
}

input[type="range"]::-ms-thumb {
  background: var(--brand-primary);
  height: 22px;
  width: 22px;
  border-radius: 50%;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
