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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

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

header {
  text-align: center;
  margin-bottom: 40px;
}

header h1 {
  font-size: 2.5rem;
  color: #2c3e50;
  margin-bottom: 10px;
}

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

/* Upload Section */
.upload-section {
  margin-bottom: 40px;
}

.upload-area {
  border: 2px dashed #bdc3c7;
  border-radius: 10px;
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: white;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: #3498db;
  background-color: #ecf0f1;
}

.upload-content {
  pointer-events: none;
}

.upload-icon {
  width: 60px;
  height: 60px;
  color: #7f8c8d;
  margin-bottom: 20px;
}

.upload-info {
  font-size: 0.9rem;
  color: #95a5a6;
  margin-top: 10px;
}

/* Keywords Section */
.keywords-section {
  margin-bottom: 40px;
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.keywords-section h2 {
  margin-bottom: 20px;
  color: #2c3e50;
}

.keyword-input-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

#keyword-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 5px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

#keyword-input:focus {
  outline: none;
  border-color: #3498db;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.keyword-tag {
  background-color: #3498db;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.keyword-tag .remove {
  cursor: pointer;
  font-weight: bold;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.btn-primary {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-secondary {
  background-color: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

/* Preview Section */
.preview-section {
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.preview-section h2 {
  margin-bottom: 20px;
  color: #2c3e50;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.preview-item {
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  overflow: hidden;
  background-color: #f8f9fa;
}

.preview-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.preview-filename {
  padding: 10px;
  font-size: 14px;
  word-break: break-all;
  background-color: white;
  border-top: 1px solid #e0e0e0;
}

.preview-filename .old-name {
  color: #7f8c8d;
  text-decoration: line-through;
  font-size: 12px;
  display: block;
  margin-bottom: 4px;
}

.preview-filename .new-name {
  color: #27ae60;
  font-weight: 500;
}

/* Status Messages */
.upload-status {
  margin-top: 20px;
  text-align: center;
}

.status-success {
  color: #27ae60;
}

.status-errors {
  color: #e74c3c;
}

.status-errors p {
  margin: 5px 0;
}

/* AI Suggestions */
.ai-suggestions {
  margin-top: 20px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 5px;
}

.ai-suggestions h3 {
  margin-bottom: 15px;
  color: #2c3e50;
  font-size: 1.1rem;
}

#suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.suggestion-tag {
  background-color: #ecf0f1;
  color: #2c3e50;
  padding: 6px 12px;
  border: 1px solid #bdc3c7;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.suggestion-tag:hover {
  background-color: #3498db;
  color: white;
  border-color: #3498db;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-content {
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  text-align: center;
}

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

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

.error-message {
  color: #e74c3c;
  text-align: center;
  padding: 40px;
  font-size: 1.1rem;
}

.download-section {
  text-align: center;
}

#download-status {
  margin-top: 15px;
  font-size: 1rem;
}

#download-status.status-success {
  color: #27ae60;
}

#download-status.status-error {
  color: #e74c3c;
}