/* Image Converter CSS */
:root {
  /* Light Theme Colors */
  --primary-color: #6366f1;
  --primary-hover: #5855eb;
  --secondary-color: #8b5cf6;
  --accent-color: #06b6d4;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;
  
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  --gradient-secondary: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  
  /* Animation Variables */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Dark Theme Colors */
[data-theme="dark"] {
  --primary-color: #818cf8;
  --primary-hover: #7c3aed;
  --secondary-color: #a78bfa;
  --accent-color: #22d3ee;
  --success-color: #34d399;
  --warning-color: #fbbf24;
  --error-color: #f87171;
  
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-inverse: #0f172a;
  
  --border-color: #334155;
  --border-hover: #475569;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3);
  
  --gradient-primary: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #22d3ee 100%);
  --gradient-secondary: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

/* Background Animation */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.floating-shapes {
  position: relative;
  width: 100%;
  height: 100%;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: var(--gradient-primary);
  opacity: 0.1;
  animation: float 20s infinite linear;
}

.shape-1 {
  width: 80px;
  height: 80px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.shape-2 {
  width: 120px;
  height: 120px;
  top: 60%;
  left: 80%;
  animation-delay: -5s;
}

.shape-3 {
  width: 60px;
  height: 60px;
  top: 80%;
  left: 20%;
  animation-delay: -10s;
}

.shape-4 {
  width: 100px;
  height: 100px;
  top: 10%;
  left: 70%;
  animation-delay: -15s;
}

.shape-5 {
  width: 140px;
  height: 140px;
  top: 40%;
  left: 50%;
  animation-delay: -8s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  33% {
    transform: translateY(-30px) rotate(120deg);
  }
  66% {
    transform: translateY(15px) rotate(240deg);
  }
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid var(--border-color);
  transition: transform 0.2s ease-out, background-color 0.3s ease-out, box-shadow 0.3s ease-out;
  transform: translateY(0);
}

.header.hidden {
  transform: translateY(-100%);
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .header {
  background: rgba(15, 23, 42, 0.8);
}

[data-theme="dark"] .header.scrolled {
  background: rgba(15, 23, 42, 0.95);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color);
  transition: all var(--transition-normal);
}

.logo a {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo i {
  font-size: 1.8rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Navigation */
.nav {
  display: flex;
  gap: 0.8rem;
  flex-wrap: nowrap;
  align-items: center;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--primary-color);
  color: var(--text-inverse);
}

/* Theme Toggle */
.theme-toggle {
  position: relative;
}

.theme-btn {
  position: relative;
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.theme-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.theme-btn i {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all var(--transition-normal);
  font-size: 1.2rem;
}

.theme-btn .fa-sun {
  opacity: 1;
}

.theme-btn .fa-moon {
  opacity: 0;
}

[data-theme="dark"] .theme-btn .fa-sun {
  opacity: 0;
}

[data-theme="dark"] .theme-btn .fa-moon {
  opacity: 1;
}

/* Main Content */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4rem;
  padding: 2rem 0;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 0;
  animation: fadeInUp 1s ease-out;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.title-line {
  display: block;
  animation: slideInLeft 0.8s ease-out;
}

.title-line.highlight {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation-delay: 0.2s;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-weight: 300;
  opacity: 0.9;
  animation: fadeInUp 1s ease-out 0.4s both;
}

/* Converter Card */
.converter-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
  animation: fadeInUp 1s ease-out 0.6s both;
}

.converter-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-header h2 i {
  color: var(--primary-color);
}

.card-stats {
  display: flex;
  gap: 1.5rem;
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat i {
  color: var(--primary-color);
}

/* Form Styles */
.converter-form {
  margin-bottom: 2rem;
}

.input-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.input-group {
  position: relative;
}

/* File Upload Styles */
.file-upload-wrapper {
  position: relative;
  width: 100%;
}

.file-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  border: 2px dashed var(--border-color);
  border-radius: 16px;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all var(--transition-normal);
  min-height: 200px;
}

.file-upload-label:hover {
  border-color: var(--primary-color);
  background: var(--bg-tertiary);
}

.file-upload-label.dragover {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: var(--text-inverse);
}

.upload-icon {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  transition: all var(--transition-normal);
}

.file-upload-label:hover .upload-icon {
  transform: scale(1.1);
}

.upload-text {
  text-align: center;
}

.upload-text h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.upload-text p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.file-size {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.file-preview {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: none;
}

.file-preview.active {
  display: block;
}

.file-preview-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.file-preview-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.file-preview-details h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.file-preview-details p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Batch Processing Options */
.batch-options {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.batch-mode {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.batch-mode label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.batch-select {
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition-normal);
}

.batch-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Files List Styles */
.files-list {
  margin: 2rem 0;
  animation: fadeInUp 0.5s ease-out;
}

.files-list h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.files-list h3 i {
  color: var(--primary-color);
}

.files-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.file-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  transition: all var(--transition-normal);
  position: relative;
}

.file-item:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

.file-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex: 1;
}

.file-preview-img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.file-details h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  word-break: break-word;
}

.file-details p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

.file-remove {
  background: var(--error-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.7rem;
  transition: all var(--transition-normal);
}

.file-remove:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.file-settings {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.file-format-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.file-format-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.file-format-select {
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.8rem;
  transition: all var(--transition-normal);
}

.file-format-select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.file-quality-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.file-quality-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.file-quality-slider {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--border-color);
  outline: none;
  -webkit-appearance: none;
}

.file-quality-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.file-quality-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.file-quality-value {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Batch Settings */
.batch-settings {
  margin-top: 1rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
}

.setting-group {
  margin-bottom: 1.5rem;
}

.setting-group:last-child {
  margin-bottom: 0;
}

.setting-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.setting-group label i {
  color: var(--primary-color);
}

/* Resize Controls */
.resize-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.resize-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: var(--transition-normal);
}

.resize-option:hover {
  border-color: var(--primary-color);
}

.resize-option input[type="radio"] {
  margin: 0;
}

.resize-option label {
  margin: 0;
  font-weight: 500;
  cursor: pointer;
}

.resize-input {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
  width: 100px;
}

.resize-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Watermark Controls */
.watermark-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.watermark-input {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition-normal);
}

.watermark-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.watermark-settings {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.watermark-select {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
  flex: 1;
}

.watermark-color {
  width: 50px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
}

.watermark-opacity {
  flex: 1;
  margin: 0;
}

/* Comparison Controls */
.comparison-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comparison-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-normal);
}

.comparison-checkbox:hover {
  border-color: var(--primary-color);
}

.comparison-checkbox input[type="checkbox"] {
  margin: 0;
}

.comparison-checkbox span {
  font-weight: 500;
}

.comparison-qualities {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.quality-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-primary);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-normal);
}

.quality-option:hover {
  background: var(--bg-secondary);
}

.quality-option input[type="checkbox"] {
  margin: 0;
}

.quality-option span {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Format Selection */
.format-selection {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid var(--border-color);
}

.format-selection h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.format-selection h3 i {
  color: var(--primary-color);
}

.format-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.format-group, .quality-group, .size-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.format-group label, .quality-group label, .size-group label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.format-select, .resize-select {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition-normal);
}

.format-select:focus, .resize-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Quality Slider */
.quality-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.quality-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.quality-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.quality-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
  transition: all var(--transition-normal);
}

.quality-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
}

/* Custom Size Inputs */
.custom-size {
  margin-top: 1rem;
}

.size-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.size-input {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.size-input label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.size-input input {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition-normal);
}

.size-input input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.aspect-ratio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.aspect-ratio label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.aspect-ratio input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
}

/* Preset Sizes */
.preset-sizes {
  margin-top: 1rem;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.preset-btn {
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: center;
}

.preset-btn:hover {
  background: var(--primary-color);
  color: var(--text-inverse);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.preset-btn.active {
  background: var(--primary-color);
  color: var(--text-inverse);
  border-color: var(--primary-color);
}

/* Convert Button */
.convert-btn {
  position: relative;
  width: 100%;
  padding: 1.25rem 2rem;
  background: var(--gradient-primary);
  color: var(--text-inverse);
  border: none;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.convert-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.convert-btn:active {
  transform: translateY(0);
}

.convert-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity var(--transition-normal);
}

.btn-loader {
  position: absolute;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.loader-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.convert-btn.loading .btn-text {
  opacity: 0;
}

.convert-btn.loading .btn-loader {
  opacity: 1;
}

/* Result Section */
.result-section {
  margin-top: 2rem;
  animation: slideDown 0.5s ease-out;
}

.result-card {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--success-color);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.success-icon {
  width: 50px;
  height: 50px;
  background: var(--success-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  animation: bounceIn 0.6s ease-out;
}

.result-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.result-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.result-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Comparison Section */
.comparison-section {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

.comparison-section h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.comparison-section h4 i {
  color: var(--primary-color);
}

.comparison-container {
  width: 100%;
}

.image-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.original-image, .converted-image {
  text-align: center;
}

.original-image h5, .converted-image h5 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.preview-image {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  margin-bottom: 1rem;
}

.image-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Download Section */
.download-section {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

.download-section h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.download-section h4 i {
  color: var(--primary-color);
}

.download-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.download-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
}

.download-btn.primary {
  background: var(--gradient-primary);
  color: var(--text-inverse);
}

.download-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.download-btn.secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.download-btn.secondary:hover {
  background: var(--bg-tertiary);
  transform: translateY(-2px);
}

/* Stats Section */
.stats-section {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

.stats-section h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.stats-section h4 i {
  color: var(--primary-color);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-item label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
}

/* Error Section */
.error-section {
  margin-top: 2rem;
  animation: slideDown 0.5s ease-out;
}

.error-card {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error-color);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.error-icon {
  width: 40px;
  height: 40px;
  background: var(--error-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

.error-content h3 {
  color: var(--error-color);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.error-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Features Section */
.features {
  background: var(--bg-secondary);
  border-radius: 20px;
  padding: 3rem;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
}

.features h2 {
  text-align: center;
  color: var(--text-primary);
  font-size: 2rem;
  margin-bottom: 2rem;
  font-weight: 600;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  transition: all var(--transition-normal);
  border: 1px solid var(--border-color);
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease-out forwards;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }

.feature-card:hover {
  transform: translateY(-5px);
  background: var(--bg-card-hover);
}

.feature-icon {
  width: 80px;
  height: 80px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: white;
  font-size: 2rem;
  transition: all var(--transition-normal);
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
}

.feature-card h3 {
  color: var(--text-primary);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Footer */
.footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  animation: fadeInUp 1s ease-out 1s both;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-normal);
}

.footer-links a:hover {
  color: var(--primary-color);
}

/* Ensure footer links are properly colored in dark mode */
[data-theme="dark"] .footer-links a {
  color: var(--text-secondary);
}

[data-theme="dark"] .footer-links a:hover {
  color: var(--primary-color);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  animation: slideInRight 0.3s ease-out;
  transition: all var(--transition-normal);
}

.toast.success {
  border-left: 4px solid var(--success-color);
}

.toast.error {
  border-left: 4px solid var(--error-color);
}

.toast-icon {
  font-size: 1.2rem;
}

.toast.success .toast-icon {
  color: var(--success-color);
}

.toast.error .toast-icon {
  color: var(--error-color);
}

.toast-message {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .container {
    max-width: 100%;
    padding: 0 20px;
  }
  
  .upload-card {
    padding: 2rem;
  }
}

@media (max-width: 1024px) {
  .container {
    padding: 0 15px;
  }
  
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .options-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .upload-card {
    padding: 1.5rem;
  }
  
  .hero-title {
    font-size: 3rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
  
  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .nav-link {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }
  
  .nav-link i {
    font-size: 0.8rem;
  }
  
  .hero {
    padding: 2rem 0;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .converter-card {
    padding: 1.5rem;
  }
  
  .card-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .card-stats {
    justify-content: center;
  }
  
  .drop-area {
    padding: 2rem 1rem;
    min-height: 150px;
  }
  
  .upload-icon {
    font-size: 2rem;
  }
  
  .conversion-options-section {
    padding: 1.5rem;
  }
  
  .format-selection {
    padding: 1.5rem;
  }
  
  .batch-options {
    padding: 1rem;
  }
  
  .files-container {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
  
  .file-item {
    padding: 0.8rem;
  }
  
  .options-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .custom-size-inputs {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .custom-size-inputs span {
    display: none;
  }
  
  .image-comparison {
    flex-direction: column;
    gap: 1rem;
  }
  
  .image-box {
    text-align: center;
  }
  
  .conversion-stats .info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .download-options {
    flex-direction: column;
    gap: 1rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .feature-card {
    padding: 1.5rem;
  }
  
  .feature-card h3 {
    font-size: 1.2rem;
  }
  
  .feature-card p {
    font-size: 0.9rem;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .toast-container {
    left: 20px;
    right: 20px;
  }
  
  .toast {
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 10px;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 0.9rem;
  }
  
  .converter-card {
    padding: 1rem;
  }
  
  .format-selection {
    padding: 1rem;
  }
  
  .batch-options {
    padding: 0.8rem;
  }
  
  .file-item {
    padding: 0.6rem;
  }
  
  .file-preview-img {
    width: 40px;
    height: 40px;
  }
  
  .drop-area {
    padding: 1.5rem 0.75rem;
    min-height: 120px;
  }
  
  .upload-icon {
    font-size: 1.5rem;
  }
  
  .conversion-options-section {
    padding: 1rem;
  }
  
  .nav {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .nav-link {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    justify-content: center;
  }
  
  .features {
    padding: 1.5rem 1rem;
  }
  
  .features h2 {
    font-size: 1.5rem;
  }
  
  .feature-card {
    padding: 1rem;
  }
  
  .feature-card h3 {
    font-size: 1.1rem;
  }
  
  .feature-card p {
    font-size: 0.85rem;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 360px) {
  .container {
    padding: 0 8px;
  }
  
  .hero-title {
    font-size: 1.8rem;
  }
  
  .converter-card {
    padding: 0.75rem;
  }
  
  .drop-area {
    padding: 1rem 0.5rem;
    min-height: 100px;
  }
  
  .upload-icon {
    font-size: 1.25rem;
  }
  
  .conversion-options-section {
    padding: 0.75rem;
  }
  
  .feature-card {
    padding: 0.75rem;
  }
  
  .feature-card h3 {
    font-size: 1rem;
  }
  
  .feature-card p {
    font-size: 0.8rem;
  }
}
