* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 2rem 0;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 2.5rem;
  color: #667eea;
  margin-bottom: 0.5rem;
}

header p {
  font-size: 1.1rem;
  color: #666;
}

main {
  padding: 3rem 0;
}

.upload-section {
  margin-bottom: 3rem;
}

.upload-area {
  background: white;
  border-radius: 16px;
  padding: 3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin-bottom: 2rem;
}

.dropzone {
  border: 3px dashed #667eea;
  border-radius: 12px;
  padding: 4rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #f8f9ff;
}

.dropzone:hover {
  border-color: #764ba2;
  background: #f0f2ff;
  transform: translateY(-2px);
}

.dropzone svg {
  color: #667eea;
  margin-bottom: 1rem;
}

.dropzone h3 {
  color: #333;
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.dropzone p {
  color: #666;
  font-size: 1rem;
}

.file-limit {
  font-size: 0.9rem !important;
  color: #999 !important;
  margin-top: 0.5rem;
}

.quality-control {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #f8f9ff;
  border-radius: 12px;
}

.quality-control label {
  display: block;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #333;
  font-size: 1.1rem;
}

#quality {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: #ddd;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

#quality::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

#quality::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.quality-hint {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #666;
}

.previews-grid,
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.preview-item,
.result-item {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.preview-item:hover,
.result-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.preview-item img,
.result-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.preview-item h4,
.result-item h4 {
  color: #333;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  word-break: break-all;
}

.preview-item button,
.result-item a {
  width: 100%;
  padding: 0.75rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  margin-top: 0.5rem;
}

.preview-item button:hover,
.result-item a:hover {
  background: #764ba2;
}

.error {
  color: #e74c3c;
  background: #fadbd8;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.stats {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #f8f9ff;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #666;
}

.stats strong {
  color: #333;
}

.features {
  background: white;
  border-radius: 16px;
  padding: 3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.features h2 {
  text-align: center;
  color: #333;
  margin-bottom: 3rem;
  font-size: 2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature {
  text-align: center;
  padding: 1.5rem;
}

.feature h3 {
  color: #667eea;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.feature p {
  color: #666;
  line-height: 1.6;
}

footer {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 2rem 0;
  margin-top: 3rem;
  text-align: center;
}

.ad-container {
  max-width: 800px;
  margin: 0 auto 2rem;
}

.ad-placeholder {
  background: #f0f0f0;
  border: 2px dashed #ccc;
  padding: 2rem;
  border-radius: 8px;
  color: #999;
  font-size: 0.9rem;
}

footer p {
  color: #666;
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }
  
  .upload-area {
    padding: 2rem 1rem;
  }
  
  .dropzone {
    padding: 3rem 1rem;
  }
  
  .features {
    padding: 2rem 1rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
}
