/* ===========================================
   Image Optimizer Pro - Professional Clean Theme
   =========================================== */

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Light Theme Colors - Clean & Professional */
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --primary-ultralight: #f8fafc;
  
  --secondary: #06b6d4;
  --secondary-dark: #0891b2;
  --secondary-light: #cffafe;
  
  /* Status Colors */
  --success: #10b981;
  --success-dark: #059669;
  --success-light: #d1fae5;
  
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --warning-light: #fef3c7;
  
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --danger-light: #fee2e2;
  
  --info: #3b82f6;
  --info-dark: #2563eb;
  --info-light: #dbeafe;
  
  /* Neutral Colors - Light & Airy */
  --white: #ffffff;
  --off-white: #fdfdfd;
  
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-150: #f0f0f0;
  --gray-200: #e5e5e5;
  --gray-250: #dbdbdb;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;
  
  /* Shadows - Soft & Clean */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 
            0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 
               0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 
               0 10px 10px -5px rgba(0, 0, 0, 0.01);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 35px 60px -15px rgba(0, 0, 0, 0.12);
  
  /* Border Radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Layout */
  --container-max: 1200px;
  --header-height: 80px;
  --sidebar-width: 280px;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
}

/* Dark Theme */
[data-theme="dark"] {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #312e81;
  --primary-ultralight: #1e1b4b;
  
  --secondary: #06b6d4;
  --secondary-dark: #0891b2;
  --secondary-light: #164e63;
  
  /* Status Colors Dark */
  --success: #10b981;
  --success-dark: #047857;
  --success-light: #064e3b;
  
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --warning-light: #78350f;
  
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --danger-light: #7f1d1d;
  
  --info: #3b82f6;
  --info-dark: #2563eb;
  --info-light: #1e3a8a;
  
  /* Neutral Colors Dark */
  --white: #0f172a;
  --off-white: #1e293b;
  
  --gray-50: #1e293b;
  --gray-100: #334155;
  --gray-150: #475569;
  --gray-200: #475569;
  --gray-250: #64748b;
  --gray-300: #64748b;
  --gray-400: #94a3b8;
  --gray-500: #cbd5e1;
  --gray-600: #e2e8f0;
  --gray-700: #f1f5f9;
  --gray-800: #f8fafc;
  --gray-900: #ffffff;
  
  /* Shadows Dark */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 
            0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 
               0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 
               0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --shadow-2xl: 0 35px 60px -15px rgba(0, 0, 0, 0.6);
}

/* Base Styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease;
}

[data-theme="dark"] body {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* Header Tips */
.header-tips {
  background: var(--info-light);
  border: 1px solid var(--info);
  border-radius: var(--radius);
  padding: 12px 20px;
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--info-dark);
  animation: fadeInUp 0.5s ease;
}

.header-tips i {
  color: var(--info);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000;
}

.theme-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--white);
  border: 1.5px solid var(--gray-250);
  color: var(--gray-700);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.theme-toggle-btn:hover {
  transform: rotate(15deg);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .theme-toggle-btn {
  background: var(--gray-700);
  border-color: var(--gray-600);
  color: var(--gray-300);
}

/* App Shell */
.app-shell {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 48px;
  padding-top: 40px;
}

.app-header::after {
  content: '';
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
}

.app-header h1 {
  font-size: 2.875rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.app-header p {
  font-size: 1.125rem;
  color: var(--gray-600);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
  font-weight: 400;
}

/* Card Design */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.card-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  padding-left: 16px;
}

.card-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 2px;
}

.card-title i {
  color: var(--primary);
  font-size: 1.125rem;
}

/* ========== UPLOAD AREA ========== */
.upload-area {
  position: relative;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-xl);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-ultralight);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.upload-area.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  animation: gentlePulse 2s infinite;
}

@keyframes gentlePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.1);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
  }
}

/* Upload Icon - Responsive */
.upload-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  color: var(--primary);
  transition: var(--transition);
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.upload-area:hover .upload-icon {
  transform: translateY(-5px) scale(1.05);
  color: var(--primary-dark);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

/* Upload Text */
.upload-text-main {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
  line-height: 1.3;
}

.upload-text-sub {
  font-size: 1rem;
  color: var(--gray-600);
  margin-bottom: 24px;
  font-weight: 400;
  line-height: 1.5;
}

/* Upload Button */
.custom-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 14px 28px;
  border-radius: var(--radius-lg);
  font-weight: 600;
  margin: 20px 0;
  pointer-events: none;
  box-shadow: var(--shadow);
  font-size: 1rem;
  transition: var(--transition);
  border: none;
}

.upload-hint {
  font-size: 0.875rem;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 10px 16px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-weight: 500;
  line-height: 1.4;
}

/* File Input */
#fileInput {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 100;
}

/* File Info */
.file-info {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 100%);
  border: 2px solid var(--primary);
  border-radius: var(--radius-xl);
  padding: 20px 28px;
  display: none;
  align-items: center;
  justify-content: space-between;
  animation: gentleSlideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 24px;
  box-shadow: var(--shadow);
}

@keyframes gentleSlideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.file-info-header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 1.125rem;
}

.file-info-header i {
  font-size: 1.25rem;
  color: var(--success);
}

/* Settings Grid */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.setting-box {
  background: var(--gray-50);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
  position: relative;
}

.setting-box:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.setting-box label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 20px;
  font-size: 1.0625rem;
}

.setting-box label i {
  color: var(--primary);
  width: 20px;
  text-align: center;
}

/* Form Elements */
select, input[type="number"] {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  background: var(--white);
  font-size: 0.9375rem;
  color: var(--gray-800);
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

select:focus, input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 44px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
}

/* Checkboxes */
.setting-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 8px;
  transition: var(--transition-fast);
  border-radius: var(--radius-sm);
}

.setting-inline:hover {
  background: var(--gray-100);
}

.setting-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--gray-400);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: var(--white);
}

.setting-inline input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.setting-inline input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 11px;
  font-weight: bold;
}

.setting-inline span {
  font-size: 0.9375rem;
  color: var(--gray-700);
  font-weight: 500;
  flex: 1;
}

/* Slider */
.slider-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding: 0 4px;
}

input[type="range"] {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--gray-300);
  outline: none;
  -webkit-appearance: none;
  transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

.slider-value {
  min-width: 48px;
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
  text-align: center;
  padding: 6px 10px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
}

/* Resize Inputs */
.resize-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 8px 0;
}

.resize-row span:first-child {
  color: var(--gray-600);
  font-size: 0.9375rem;
  min-width: 40px;
  font-weight: 500;
}

.resize-row input[type="number"] {
  flex: 1;
  max-width: 120px;
  padding: 10px 12px;
  font-weight: 600;
}

/* ZIP Toggle */
.zip-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--primary-light);
  border-radius: var(--radius);
  border: 2px solid var(--primary);
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.zip-toggle:hover {
  background: var(--primary);
  color: white;
}

.zip-toggle:hover .zip-icon {
  color: white;
}

.zip-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.zip-icon {
  font-size: 1rem;
  color: var(--primary);
  transition: var(--transition);
}

/* Card Header */
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.preview-actions {
  display: flex;
  gap: 12px;
}

/* Preview Grid */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  max-height: 500px;
  overflow-y: auto;
  padding: 8px;
  margin-top: 20px;
}

.preview-grid::-webkit-scrollbar {
  width: 6px;
}

.preview-grid::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 3px;
}

.preview-grid::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 3px;
  transition: var(--transition);
}

.preview-grid::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* Preview Item */
.preview-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
  height: 190px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.preview-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.preview-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  flex-shrink: 0;
  transition: var(--transition);
}

.preview-item:hover img {
  transform: scale(1.02);
}

.preview-item > div:last-child {
  padding: 12px;
  border-top: 1px solid var(--gray-100);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.file-name {
  font-size: 0.8125rem;
  color: var(--gray-800);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.file-size {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* Preview Checkbox */
.preview-item input[type="checkbox"] {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 10;
  border: 2px solid var(--gray-400);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: var(--white);
  transition: var(--transition);
}

.preview-item input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.preview-item input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 11px;
  font-weight: bold;
}

/* Remove Button */
.remove-single-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: var(--transition);
  z-index: 10;
  font-size: 0.75rem;
}

.preview-item:hover .remove-single-btn {
  opacity: 1;
}

.remove-single-btn:hover {
  background: var(--danger-dark);
  transform: scale(1.1);
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.5s ease;
}

.empty-state i {
  font-size: 3.5rem;
  color: var(--gray-300);
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--gray-600);
}

.empty-state small {
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: var(--radius-lg);
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  letter-spacing: 0.3px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: var(--transition-slow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:hover::after {
  left: 100%;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: var(--shadow) !important;
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: var(--gray-200);
  border-color: var(--gray-400);
  color: var(--gray-900);
  transform: translateY(-1px);
}

.btn-small {
  background: var(--gray-200);
  color: var(--gray-700);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-small:hover {
  background: var(--gray-300);
  color: var(--gray-900);
}

/* Progress Bars */
.progress-box {
  background: var(--gray-50);
  padding: 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  animation: gentleSlideDown 0.4s ease;
}

.progress-text {
  font-size: 0.9375rem;
  color: var(--gray-700);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.progress-text span:last-child {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9375rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
  transition: width 0.3s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.2) 50%, 
    transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Success Popup */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.popup-card {
  background: var(--white);
  border-radius: var(--radius-2xl);
  padding: 40px 32px;
  width: 90%;
  max-width: 480px;
  text-align: center;
  box-shadow: var(--shadow-2xl);
  animation: popupSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

@keyframes popupSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.popup-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--gray-100);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--gray-600);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 300;
  line-height: 1;
}

.popup-close:hover {
  background: var(--gray-200);
  color: var(--gray-900);
  transform: rotate(90deg);
}

.popup-image {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 24px;
  animation: gentleFloat 3s ease-in-out infinite;
}

@keyframes gentleFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.popup-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 12px;
}

.popup-card p {
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 24px;
  font-size: 1rem;
}

.popup-donate-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--warning) 0%, #f97316 100%);
  color: white;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  box-shadow: var(--shadow);
  border: none;
  cursor: pointer;
  margin: 0 auto;
}

.popup-donate-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Notification */
.notification {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 380px;
  backdrop-filter: blur(10px);
  border-left: 4px solid;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification-success {
  background: rgba(16, 185, 129, 0.95);
  color: white;
  border-left-color: var(--success-dark);
}

.notification-warning {
  background: rgba(245, 158, 11, 0.95);
  color: white;
  border-left-color: var(--warning-dark);
}

.notification-info {
  background: rgba(79, 70, 229, 0.95);
  color: white;
  border-left-color: var(--primary-dark);
}

.notification i {
  font-size: 1.125rem;
}

.notification span {
  flex: 1;
  font-weight: 500;
  font-size: 0.9375rem;
}

/* Ads Container */
.ads-container {
  margin: 32px auto;
  max-width: 800px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Loading Spinner */
.fa-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ================= RESPONSIVE DESIGN ================= */

/* Desktop Large */
@media (min-width: 1536px) {
  .app-shell {
    padding: 48px 32px 80px;
  }
  
  .app-header h1 {
    font-size: 3.5rem;
  }
  
  .upload-area {
    padding: 60px 40px;
    min-height: 320px;
  }
  
  .upload-icon {
    width: 100px;
    height: 100px;
    font-size: 3rem;
  }
  
  .upload-text-main {
    font-size: 1.5rem;
  }
  
  .upload-text-sub {
    font-size: 1.125rem;
  }
}

/* Desktop */
@media (max-width: 1535px) and (min-width: 1024px) {
  .app-shell {
    padding: 40px 28px 72px;
  }
  
  .app-header h1 {
    font-size: 3rem;
  }
  
  .upload-area {
    padding: 56px 36px;
    min-height: 300px;
  }
  
  .upload-icon {
    width: 90px;
    height: 90px;
    font-size: 2.75rem;
  }
}

/* Tablet */
@media (max-width: 1023px) and (min-width: 768px) {
  .app-shell {
    padding: 32px 20px 56px;
  }
  
  .app-header {
    padding-top: 32px;
    margin-bottom: 40px;
  }
  
  .app-header h1 {
    font-size: 2.5rem;
  }
  
  .app-header p {
    font-size: 1.0625rem;
  }
  
  .card {
    padding: 28px;
    margin-bottom: 24px;
  }
  
  .upload-area {
    padding: 48px 32px;
    min-height: 280px;
  }
  
  .upload-icon {
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
  }
  
  .upload-text-main {
    font-size: 1.375rem;
  }
  
  .upload-text-sub {
    font-size: 1rem;
  }
  
  .custom-upload-btn {
    padding: 14px 28px;
    font-size: 1rem;
  }
  
  .preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }
  
  .settings-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* Mobile Large */
@media (max-width: 767px) and (min-width: 480px) {
  .app-shell {
    padding: 24px 16px 40px;
  }
  
  .app-header {
    padding-top: 24px;
    margin-bottom: 32px;
  }
  
  .app-header h1 {
    font-size: 2rem;
  }
  
  .app-header p {
    font-size: 1rem;
    padding: 0 8px;
  }
  
  .card {
    padding: 24px;
    margin-bottom: 20px;
  }
  
  .card-title {
    font-size: 1.25rem;
    margin-bottom: 24px;
  }
  
  .upload-area {
    padding: 40px 24px;
    min-height: 260px;
  }
  
  .upload-icon {
    width: 70px;
    height: 70px;
    font-size: 2.25rem;
    margin-bottom: 16px;
  }
  
  .upload-text-main {
    font-size: 1.25rem;
  }
  
  .upload-text-sub {
    font-size: 0.9375rem;
    margin-bottom: 20px;
  }
  
  .custom-upload-btn {
    padding: 12px 24px;
    font-size: 0.9375rem;
    margin: 16px 0;
  }
  
  .upload-hint {
    font-size: 0.8125rem;
    padding: 8px 14px;
  }
  
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    max-height: 400px;
  }
  
  .preview-item {
    height: 180px;
  }
  
  .preview-item img {
    height: 110px;
  }
  
  .btn-primary {
    padding: 14px 24px;
    font-size: 1rem;
  }
  
  .theme-toggle {
    top: 16px;
    right: 16px;
  }
  
  .theme-toggle-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

/* Mobile Small */
@media (max-width: 479px) {
  .app-shell {
    padding: 20px 12px 32px;
  }
  
  .app-header {
    padding-top: 20px;
    margin-bottom: 28px;
  }
  
  .app-header h1 {
    font-size: 1.75rem;
  }
  
  .app-header p {
    font-size: 0.9375rem;
  }
  
  .card {
    padding: 20px;
    margin-bottom: 16px;
  }
  
  .card-title {
    font-size: 1.125rem;
    margin-bottom: 20px;
  }
  
  .upload-area {
    padding: 32px 20px;
    min-height: 240px;
  }
  
  .upload-icon {
    width: 60px;
    height: 60px;
    font-size: 2rem;
    margin-bottom: 14px;
  }
  
  .upload-text-main {
    font-size: 1.125rem;
  }
  
  .upload-text-sub {
    font-size: 0.875rem;
    margin-bottom: 16px;
  }
  
  .custom-upload-btn {
    padding: 10px 20px;
    font-size: 0.875rem;
    margin: 14px 0;
  }
  
  .upload-hint {
    font-size: 0.75rem;
    padding: 8px 12px;
    margin-top: 12px;
  }
  
  .preview-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-height: 350px;
  }
  
  .preview-item {
    height: 160px;
  }
  
  .preview-item img {
    height: 100px;
  }
  
  .preview-item > div:last-child {
    padding: 10px;
  }
  
  .file-name {
    font-size: 0.75rem;
  }
  
  .file-size {
    font-size: 0.6875rem;
  }
  
  .btn-primary {
    padding: 12px 20px;
    font-size: 0.9375rem;
  }
  
  .btn-secondary, .btn-small {
    padding: 8px 14px;
    font-size: 0.8125rem;
  }
  
  .theme-toggle {
    top: 12px;
    right: 12px;
  }
  
  .theme-toggle-btn {
    width: 36px;
    height: 36px;
    font-size: 0.9375rem;
  }
  
  .popup-card {
    padding: 24px 20px;
    margin: 12px;
  }
  
  .popup-card h3 {
    font-size: 1.25rem;
  }
  
  .popup-image {
    width: 100px;
    height: 100px;
  }
  
  .notification {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
    padding: 14px 16px;
  }
}

/* Print Styles */
@media print {
  .theme-toggle,
  .upload-area,
  .btn-primary,
  .btn-secondary,
  .popup-overlay,
  .ads-container,
  .notification,
  .card::before,
  .progress-box,
  .file-info {
    display: none !important;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    page-break-inside: avoid;
    margin-bottom: 16px !important;
  }
  
  body {
    background: white !important;
    color: #000 !important;
  }
  
  .app-header h1 {
    -webkit-text-fill-color: #000 !important;
    color: #000 !important;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root, [data-theme="dark"] {
    --primary: #0000ff;
    --secondary: #008080;
    --gray-200: #000;
    --gray-300: #111;
    --gray-700: #fff;
  }
  
  .card {
    border: 2px solid var(--gray-900);
  }
  
  button, select, input {
    border: 2px solid currentColor;
  }
  
  .upload-area {
    border: 3px dashed currentColor;
  }
}

/* ================= NAVIGATION BAR ================= */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .navbar {
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid var(--gray-700);
}

.navbar-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Navbar Home Link */
.navbar-home {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--primary-light);
  color: var(--primary-dark);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: var(--transition);
  border: 1px solid transparent;
}

.navbar-home:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.navbar-home i {
  font-size: 1rem;
}

[data-theme="dark"] .navbar-home {
  background: var(--primary-light);
  color: var(--primary);
}

[data-theme="dark"] .navbar-home:hover {
  background: var(--primary);
  color: white;
}

/* Navbar Logo */
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--gray-900);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.navbar-logo i {
  color: var(--primary);
  font-size: 1.25rem;
}

[data-theme="dark"] .navbar-logo {
  color: var(--gray-300);
}

/* Navbar Actions */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Toggle trong navbar */
#themeToggleBtn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--gray-100);
  border: 1.5px solid var(--gray-250);
  color: var(--gray-700);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  transition: var(--transition);
}

#themeToggleBtn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: rotate(15deg);
}

[data-theme="dark"] #themeToggleBtn {
  background: var(--gray-700);
  border-color: var(--gray-600);
  color: var(--gray-300);
}

/* Điều chỉnh app-header để không bị navbar che */
.app-header {
  margin-top: 32px; /* Thêm margin-top để không bị navbar che */
}

/* Responsive cho navbar */
@media (max-width: 1024px) {
  .navbar-container {
    padding: 0 20px;
  }
  
  .navbar-logo span {
    display: none; /* Ẩn text trên tablet/mobile */
  }
  
  .navbar-logo {
    position: static;
    transform: none;
  }
}

@media (max-width: 768px) {
  .navbar-container {
    padding: 0 16px;
    height: 56px;
  }
  
  .navbar-home span {
    display: none; /* Chỉ hiện icon trên mobile */
  }
  
  .navbar-home {
    padding: 10px;
    width: 44px;
    height: 44px;
    justify-content: center;
  }
  
  .navbar-logo {
    font-size: 1rem;
  }
  
  .app-header {
    margin-top: 24px;
  }
}

@media (max-width: 480px) {
  .navbar-container {
    padding: 0 12px;
  }
  
  #themeToggleBtn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .app-header {
    margin-top: 20px;
  }
}

/* Print styles - Ẩn navbar khi in */
@media print {
  .navbar {
    display: none !important;
  }
  
  .app-header {
    margin-top: 0 !important;
  }
}

/* ================= NEW FEATURES STYLES ================= */

/* Rename Preview Modal */
.rename-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  animation: fadeIn 0.3s ease;
}

.rename-preview-content {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
}

.rename-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.rename-preview-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
}

.rename-preview-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.rename-preview-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

.rename-preview-item .original {
  flex: 1;
  font-size: 0.875rem;
  color: var(--gray-600);
  text-decoration: line-through;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rename-preview-item .arrow {
  color: var(--primary);
  font-size: 0.875rem;
}

.rename-preview-item .new {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--success);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Filter Preview Badge */
.filter-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary);
  color: white;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 5;
  pointer-events: none;
}

/* Watermark Preview */
.watermark-preview {
  position: absolute;
  bottom: 10px;
  right: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  font-weight: 600;
  pointer-events: none;
  z-index: 5;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Comparison View */
.comparison-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.comparison-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--gray-200);
}

.comparison-item .label {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
}

/* Stats Card */
.stats-card {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 24px;
  border: 2px solid var(--primary);
}

.stats-card h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
}

.stat {
  text-align: center;
  background: var(--white);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
}

/* Before/After Slider */
.before-after-slider {
  position: relative;
  height: 400px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-top: 20px;
}

.before-after-slider img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  top: 0;
  left: 0;
}

.slider-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: var(--primary);
  cursor: col-resize;
  z-index: 10;
}

.slider-handle::before {
  content: '↔';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* Enhanced Preview */
.preview-item.enhanced {
  position: relative;
}

.preview-item.enhanced .preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.preview-item.enhanced:hover .preview-overlay {
  opacity: 1;
}

.preview-overlay-content {
  text-align: center;
  color: white;
}

.preview-overlay-content i {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--primary);
}

/* Responsive cho tính năng mới */
@media (max-width: 768px) {
  .comparison-container {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .before-after-slider {
    height: 300px;
  }
  
  .rename-preview-content {
    padding: 24px;
    margin: 16px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .before-after-slider {
    height: 200px;
  }
}

/* ================= FOOTER STYLES ================= */
.app-footer {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  margin-top: 60px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .app-footer {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-700);
}

.footer-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 48px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}

.footer-section {
  display: flex;
  flex-direction: column;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.footer-logo i {
  font-size: 2rem;
  color: var(--primary);
  background: var(--primary-light);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-logo span {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-900);
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-description {
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--gray-100);
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: var(--transition);
  font-size: 1.125rem;
}

.social-link:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.footer-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--gray-600);
  text-decoration: none;
  font-size: 0.95rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-links a:hover {
  color: var(--primary);
  transform: translateX(5px);
}

.footer-links a::before {
  content: '→';
  opacity: 0;
  transition: var(--transition);
}

.footer-links a:hover::before {
  opacity: 1;
}

.footer-bottom {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  padding: 24px 0;
}

[data-theme="dark"] .footer-bottom {
  background: var(--gray-100);
  border-top: 1px solid var(--gray-700);
}

.footer-bottom-content {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.copyright {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin: 0;
}

.company-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.company-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.footer-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.badge {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--gray-200);
  transition: var(--transition);
}

.badge:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.badge i {
  font-size: 0.75rem;
}

/* Responsive Footer */
@media (max-width: 1024px) {
  .footer-container {
    gap: 32px;
    padding: 40px 24px;
  }
}

@media (max-width: 768px) {
  .app-footer {
    margin-top: 40px;
  }
  
  .footer-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 24px;
    padding: 32px 20px;
  }
  
  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  
  .footer-badges {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px 16px;
  }
  
  .footer-logo span {
    font-size: 1.25rem;
  }
  
  .footer-description {
    font-size: 0.9rem;
  }
  
  .badge {
    font-size: 0.75rem;
    padding: 5px 10px;
  }
}

/* Print Styles - Ẩn footer khi in */
@media print {
  .app-footer {
    display: none !important;
  }
}

/* ================= SMART SCROLL HIGHLIGHT ================= */
.highlight-section {
    animation: gentleHighlight 1.5s ease-in-out;
    position: relative;
    z-index: 1;
}

@keyframes gentleHighlight {
    0% {
        box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.05),
                    0 2px 4px -1px rgba(79, 70, 229, 0.03);
        border-color: var(--gray-200);
    }
    20% {
        box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.1),
                    0 4px 6px -2px rgba(79, 70, 229, 0.05);
        border-color: var(--primary);
    }
    80% {
        box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.1),
                    0 4px 6px -2px rgba(79, 70, 229, 0.05);
        border-color: var(--primary);
    }
    100% {
        box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.05),
                    0 2px 4px -1px rgba(79, 70, 229, 0.03);
        border-color: var(--gray-200);
    }
}

/* Arrow indicator cho scroll */
.scroll-hint {
    position: fixed;
    right: 30px;
    bottom: 100px;
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.scroll-hint.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-hint:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* Quality Hint Styles */
.quality-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--success);
}

[data-theme="dark"] .quality-hint {
  background: var(--gray-100);
}

.format-info {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--info);
}

[data-theme="dark"] .format-info {
  background: var(--gray-100);
}

/* Preserve Warning */
#preserveWarning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  transition: var(--transition);
}

#preserveWarning i {
  margin-top: 2px;
  flex-shrink: 0;
}

#preserveWarning span {
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Process Info */
#processInfo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

#processInfo i {
  color: var(--info);
}

#processInfoText {
  font-weight: 500;
}

/* Format Colors */
.format-jpeg { color: #3b82f6; }
.format-png { color: #10b981; }
.format-webp { color: #f59e0b; }
.format-avif { color: #ef4444; }

/* Security Badge trong footer */
.footer-security {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.security-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--success-light);
  border-radius: var(--radius);
  border: 1px solid var(--success);
  font-size: 0.8rem;
  color: var(--success-dark);
}

.security-badge i {
  color: var(--success-dark);
  font-size: 0.9rem;
}

[data-theme="dark"] .security-badge {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--success);
}

/* Metadata Notice Styles */
.metadata-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  background: var(--info-light);
  border-radius: var(--radius);
  border-left: 3px solid var(--info);
  margin-top: 12px;
  animation: fadeIn 0.5s ease;
}

.metadata-notice i {
  color: var(--info-dark);
  margin-top: 2px;
  flex-shrink: 0;
}

.metadata-notice span {
  font-size: 0.8rem;
  color: var(--info-dark);
  line-height: 1.4;
}