:root {
  --primary: #4361ee;
  --secondary: #3f37c9;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --light: #f8fafc;
  --dark: #0f172a;
  --gray: #64748b;
  --border: #e2e8f0;
  --radius: 16px;
  --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --light: #1e293b;
  --dark: #f1f5f9;
  --border: #334155;
  --gray: #94a3b8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--dark);
  transition: var(--transition);
  padding: 1rem;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background: var(--light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: slideUp 0.6s ease-out;
}

.header {
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

.theme-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.theme-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

.feature-tabs {
  display: flex;
  background: var(--light);
  border-bottom: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 1rem;
  background: none;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--primary);
  transition: var(--transition);
  transform: translateX(-50%);
}

.tab.active::after {
  width: 60%;
}

.tab.active {
  color: var(--primary);
  font-weight: 600;
}

.lang-display {
  text-align: center;
  padding: 1rem;
  font-weight: 600;
  color: var(--primary);
  font-size: 1.1rem;
}

.arrow {
  animation: bounce 2s infinite;
  display: inline-block;
}

.input-group {
  position: relative;
  margin: 1.5rem;
}

textarea {
  width: 100%;
  height: 150px;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  resize: vertical;
  background: var(--light);
  color: var(--dark);
  transition: var(--transition);
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15);
}

.char-count {
  position: absolute;
  bottom: 0.5rem;
  right: 1rem;
  font-size: 0.8rem;
  color: var(--gray);
}

.controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0 1.5rem 1.5rem;
}

select, .action-btn, .swap-btn {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

select {
  border: 2px solid var(--border);
  background: white;
  color: var(--dark);
}

.swap-btn {
  background: var(--warning);
  color: white;
  border: none;
  width: 50px;
  font-size: 1.2rem;
}

.action-btn.primary {
  background: var(--success);
  color: white;
  border: none;
  font-weight: 600;
}

.action-btn.primary:hover, .swap-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.output-box {
  margin: 1.5rem;
  background: #f1f5f9;
  border-radius: var(--radius);
  overflow: hidden;
  animation: fadeIn 0.5s ease-out;
}

[data-theme="dark"] .output-box {
  background: #1e293b;
}

.output-header {
  padding: 1rem;
  background: var(--primary);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.actions {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.1);
}

.output-text {
  padding: 1rem;
  min-height: 100px;
  white-space: pre-wrap;
  background: white;
  color: var(--dark);
}

[data-theme="dark"] .output-text {
  background: #0f172a;
  color: #e2e8f0;
}

.loader {
  display: none;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 1rem auto;
}

.suggestions {
  padding: 1rem;
  background: #fff8c5;
  border-left: 4px solid var(--warning);
  margin: 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.suggestion-item {
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
  .controls { flex-direction: column; }
  select, .action-btn, .swap-btn { width: 100%; }
  .header h1 { font-size: 1.5rem; }
}