/* AI Photo Restoration Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

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

h1 {
  text-align: center;
  color: white;
  font-size: 3rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

h2 {
  text-align: center;
  color: white;
  font-size: 1.5rem;
  margin-bottom: 30px;
  opacity: 0.9;
}

p {
  text-align: center;
  color: white;
  margin-bottom: 40px;
  font-size: 1.1rem;
  opacity: 0.8;
}

.form-container {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  margin-bottom: 40px;
}

.form-group {
  margin-bottom: 25px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 1.1rem;
}

textarea, select, input[type="text"], input[type="file"] {
  width: 100%;
  padding: 15px;
  border: 2px solid #e1e5e9;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  font-family: inherit;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.file-input {
  padding: 20px;
  border: 2px dashed #667eea;
  background: #f8f9ff;
  cursor: pointer;
}

.file-input:hover {
  border-color: #5a6fd8;
  background: #f0f2ff;
}

textarea:focus, select:focus, input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Upload Preview Styles */
.upload-preview {
  margin-top: 15px;
}

.preview-container {
  text-align: center;
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
}

.preview-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.preview-info {
  margin: 15px 0 0 0;
  color: #666;
  font-size: 0.9rem;
}

.upload-status {
  margin: 10px 0;
  color: #667eea;
  font-weight: 600;
}

/* Comparison Styles */
.comparison-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 30px;
  align-items: center;
  margin: 30px 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 15px;
}

.comparison-item {
  text-align: center;
}

.comparison-item h4 {
  margin-bottom: 15px;
  color: #333;
  font-size: 1.1rem;
}

.comparison-image {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.comparison-image:hover {
  transform: scale(1.02);
  cursor: pointer;
}

.comparison-arrow {
  font-size: 2rem;
  color: #667eea;
  font-weight: bold;
}

/* Gallery Restoration Styles */
.restoration-item {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 15px;
  transition: transform 0.3s ease;
}

.restoration-item:hover {
  transform: translateY(-5px);
}

.gallery-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.gallery-before, .gallery-after {
  position: relative;
  text-align: center;
}

.gallery-before img, .gallery-after img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 5px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.gallery-before img:hover, .gallery-after img:hover {
  opacity: 0.8;
}

.gallery-label {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Enhanced Form Controls */
.damage-select {
  background: white;
  cursor: pointer;
}

.strength-slider {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: #ddd;
  outline: none;
  margin: 10px 0;
}

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

.strength-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #666;
  margin-top: 5px;
}

.slider-labels span:nth-child(2) {
  font-weight: 600;
  color: #667eea;
}

.generate-btn {
  width: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 18px 30px;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.generate-btn:active {
  transform: translateY(0);
}

.generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.loading {
  text-align: center;
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  margin-bottom: 40px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading p {
  color: #666;
  margin: 0;
}

.result {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  margin-bottom: 40px;
  display: none;
}

.result.show {
  display: block;
}

.result img {
  width: 100%;
  max-width: 600px;
  height: auto;
  border-radius: 10px;
  margin: 20px auto;
  display: block;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.result-info {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
}

.result-links {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.result-links a {
  display: inline-block;
  padding: 10px 20px;
  background: #667eea;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.result-links a:hover {
  background: #5a6fd8;
}

.error {
  background: #fee;
  border: 2px solid #fcc;
  border-radius: 10px;
  padding: 20px;
  color: #c33;
  margin: 20px 0;
}

.success {
  background: #efe;
  border: 2px solid #cfc;
  border-radius: 10px;
  padding: 20px;
  color: #363;
  margin: 20px 0;
}

.gallery {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.gallery h3 {
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}

.gallery-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.gallery-item {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  transition: transform 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-5px);
}

.gallery-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 10px;
}

.gallery-item .prompt {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .form-container {
    padding: 25px;
  }
  
  .result-links {
    flex-direction: column;
  }
  
  .result-links a {
    text-align: center;
  }
  
  .comparison-container {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }
  
  .comparison-arrow {
    transform: rotate(90deg);
    font-size: 1.5rem;
  }
  
  .gallery-comparison {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}