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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

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

.header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
  color: #07b0a2;
}

.icon {
  color: #07b0a2;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
}

.subtitle {
  text-align: center;
  color: #4b5563;
  margin-bottom: 32px;
  font-size: 1rem;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  margin-bottom: 24px;
}

.toggle-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #e0f7f5;
  border-radius: 8px;
  border: 2px solid #07b0a2;
  margin-bottom: 16px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #07b0a2;
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.toggle-label {
  font-weight: 600;
  color: #07b0a2;
  cursor: pointer;
}

.info-text {
  color: #07b0a2;
  font-size: 0.875rem;
  margin-bottom: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

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

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

input[type="text"],
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: #07b0a2;
  box-shadow: 0 0 0 3px rgba(7, 176, 162, 0.1);
}

textarea {
  resize: vertical;
}

.textarea-wrapper {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.copy-btn.copied {
  background: #e0f7f5;
  border-color: #07b0a2;
}

.copy-btn svg {
  display: block;
  color: #6b7280;
}

.help-text {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 4px;
}

.output-box {
  width: 100%;
  min-height: 256px;
  padding: 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f9fafb;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 0.875rem;
  color: #374151;
}

.output-box:empty::before {
  content: "English transliteration will appear here automatically...";
  color: #9ca3af;
  font-style: italic;
}

.generate-btn {
  width: 100%;
  padding: 20px;
  background: linear-gradient(135deg, #07b0a2 0%, #059c8e 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(7, 176, 162, 0.3);
}

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

.generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.output-header h3 {
  font-size: 1.125rem;
  color: #1f2937;
}

.copy-btn-secondary {
  padding: 8px 16px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: #374151;
  transition: all 0.2s;
}

.copy-btn-secondary:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.code-output {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.code-output pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 0.75rem;
  color: #374151;
  font-family: "Courier New", monospace;
}

.preview-output {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  max-height: 600px;
  overflow-y: auto;
}

.hidden {
  display: none;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.5rem;
  }

  .card {
    padding: 20px;
  }
}
