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

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

.container {
  max-width: 1400px;
  margin: 0 auto;
}

header {
  text-align: center;
  color: white;
  margin-bottom: 30px;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.main-content {
  display: grid;
  grid-template-columns: 450px 1fr;
  gap: 20px;
  align-items: start;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card h2 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: #2c3e50;
}

/* Model Select */
.model-select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

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

/* Drop Zone */
.drop-zone {
  border: 3px dashed #cbd5e0;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #f7fafc;
}

.drop-zone:hover {
  border-color: #667eea;
  background: #edf2f7;
}

.drop-zone.drag-over {
  border-color: #667eea;
  background: #e6f0ff;
  transform: scale(1.02);
}

.drop-zone-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.drop-zone p {
  color: #4a5568;
  margin: 5px 0;
}

.drop-zone-subtitle {
  font-size: 0.9rem;
  color: #718096;
}

/* Image Preview */
.image-preview {
  margin-top: 15px;
}

.preview-container {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.preview-container img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.remove-btn:hover {
  background: #ff4757;
  color: white;
  transform: scale(1.05);
}

/* Textarea */
textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  transition: all 0.3s ease;
}

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

/* Buttons */
.btn-primary,
.btn-secondary {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: #f7fafc;
  color: #2c3e50;
  border: 2px solid #e1e5e9;
  margin-top: 10px;
}

.btn-secondary:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
}

/* Result Card */
.result-card {
  min-height: 200px;
}

.result-area {
  min-height: auto;
}

.placeholder {
  text-align: center;
  padding: 60px 20px;
  color: #718096;
}

.placeholder-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.placeholder p {
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Result Sections */
.result-section {
  margin-bottom: 20px;
}

.result-section label {
  display: block;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
  font-size: 1rem;
}

.result-field {
  position: relative;
}

.result-field input,
.result-field textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #f7fafc;
  line-height: 2;
}

.result-field textarea {
  resize: vertical;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: white;
  border: 2px solid #667eea;
  color: #667eea;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.copy-btn:hover {
  background: #667eea;
  color: white;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

/* Sources List */
.sources-list {
  margin-top: 15px;
}

.sources-header {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 10px;
  font-size: 1rem;
}

.sources-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.source-item {
  background: #f7fafc;
  border-left: 3px solid #667eea;
  padding: 10px 15px;
  margin-bottom: 10px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.source-item:hover {
  background: #edf2f7;
  border-left-color: #764ba2;
}

.source-item a {
  text-decoration: none;
  color: #2c3e50;
  display: block;
}

.source-number {
  font-weight: 700;
  color: #667eea;
  margin-right: 8px;
}

.source-title {
  color: #667eea;
  font-weight: 500;
}

.source-item a:hover .source-title {
  text-decoration: underline;
}

.source-snippet {
  margin-top: 5px;
  font-size: 0.9rem;
  color: #718096;
  line-height: 1.4;
}

.no-sources {
  color: #a0aec0;
  font-style: italic;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  
  .result-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
  }
  
  header p {
    font-size: 1rem;
  }
  
  .card {
    padding: 15px;
  }
}
