* {
  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: 2rem;
  color: #333;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  text-align: center;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

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

main {
  padding: 2rem;
}

.input-mode-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.mode-button {
  flex: 1;
  padding: 0.75rem 1.5rem;
  background: #f0f0f0;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #666;
}

.mode-button:hover {
  background: #e8e8e8;
  border-color: #667eea;
}

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

.emoji-section {
  margin-bottom: 2rem;
}

.emoji-input-container {
  padding: 2rem;
  background: #f8f9ff;
  border-radius: 12px;
  border: 2px solid #e0e0e0;
}

.emoji-input-container label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: #333;
  font-size: 1.1rem;
}

#emojiInput {
  width: 100%;
  padding: 1rem;
  font-size: 2rem;
  text-align: center;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  transition: border-color 0.3s ease;
}

#emojiInput:focus {
  outline: none;
  border-color: #667eea;
}

.emoji-preview-container {
  margin-top: 2rem;
}

.emoji-preview-container h3 {
  margin-bottom: 1rem;
  color: #333;
}

.emoji-preview {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 2rem;
  background: #f9f9f9;
  text-align: center;
  font-size: 8rem;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

.upload-area:hover {
  border-color: #764ba2;
  background: #f0f2ff;
}

.upload-area.dragover {
  border-color: #764ba2;
  background: #e8ebff;
  transform: scale(1.02);
}

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

.upload-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.upload-hint {
  font-size: 0.9rem;
  color: #666;
}

.preview-section {
  margin-top: 2rem;
}

.preview-section h3 {
  margin-bottom: 1rem;
  color: #333;
}

.preview-container {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem;
  background: #f9f9f9;
  text-align: center;
}

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

.options-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f8f9ff;
  border-radius: 12px;
}

.options-section h3 {
  margin-bottom: 1rem;
  color: #333;
}

.option-group {
  margin-bottom: 1rem;
}

.option-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #555;
}

.option-group select,
.option-group input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.option-group select:focus,
.option-group input:focus {
  outline: none;
  border-color: #667eea;
}

.convert-button {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: 1rem;
}

.convert-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.convert-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.result-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #f0fff4;
  border: 2px solid #4ade80;
  border-radius: 12px;
}

.result-section h3 {
  margin-bottom: 1rem;
  color: #166534;
}

#resultFiles {
  margin-bottom: 1rem;
}

.file-item {
  padding: 0.75rem;
  background: white;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.file-name {
  font-weight: 600;
  color: #333;
}

.download-button {
  width: 100%;
  padding: 0.75rem;
  background: #4ade80;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-bottom: 1rem;
}

.download-button:hover {
  background: #22c55e;
}

.download-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #667eea;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  transition: background 0.3s ease;
}

.download-link:hover {
  background: #764ba2;
}

.error-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #fef2f2;
  border: 2px solid #ef4444;
  border-radius: 12px;
}

.error-message {
  color: #dc2626;
  font-weight: 600;
}

#individualDownloads {
  margin-top: 1rem;
}

/* Ad Slot Styles */
.ad-slot {
  margin: 1.5rem 0;
  text-align: center;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot-top {
  margin-top: 0;
  margin-bottom: 2rem;
}

.ad-slot-bottom {
  margin-top: 2rem;
  margin-bottom: 0;
}

.ad-slot-sidebar {
  display: none;
}

/* Show sidebar ad on larger screens */
@media (min-width: 1200px) {
  .main-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
  }
  
  .ad-slot-sidebar {
    display: block;
    position: sticky;
    top: 2rem;
    height: fit-content;
    margin: 0;
  }
  
  .ad-slot-sidebar ins {
    display: block;
    width: 300px;
  }
}

.ad-slot-conversion {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #f8f9ff;
  border-radius: 8px;
  border: 2px dashed #667eea;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hide ads on very small screens */
@media (max-width: 480px) {
  .ad-slot-top,
  .ad-slot-sidebar {
    display: none;
  }
  
  .ad-slot-conversion {
    display: block !important; /* Always show conversion ad */
  }
}

