:root {
  --primary-color: #1e293b;
  --primary-hover: #334155;
  --bg-color: #f8fafc;
  --text-color: #1e293b;
  --border-color: #e2e8f0;
  --accent-color: #f1f5f9;
  --secondary-color: #475569;
}

html {
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  min-width: 320px !important;
  overflow-x: auto;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 320px !important;
  overflow-x: auto;
  zoom: 1;
}

.navbar {
  background-color: transparent;
  padding: 16px 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10;
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.right-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-buttons {
  display: flex;
  gap: 12px;
}

.auth-buttons .action-button {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.container {
  flex: none;
  width: 90vw;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
  min-width: 300px !important;
  width: clamp(300px, 90vw, 800px);
  overflow-x: visible;
  transform-origin: top center;
}

.form-container {
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  padding: 40px 80px;
  min-width: min-content;
  overflow-x: auto;
  min-width: 280px !important;
  max-width: 100%;
  overflow-x: visible;
  box-sizing: border-box;
}

.header {
  text-align: center;
  margin-bottom: 20px;
  /* Reduced from 40px */
}

.header h1 {
  font-family: 'Jost', sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  margin: 0 0 16px 0;
  background: linear-gradient(to right, var(--primary-color), var(--primary-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.credits {
  font-size: 1rem;
  color: var(--secondary-color);
  font-weight: 500;
}

.drop-zone-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 30px;
}

.drop-zone {
  border: 2px dashed var(--primary-color);
  border-radius: 12px;
  padding: 60px 20px;
  min-height: 160px;
  transition: all 0.3s ease;
  background-color: var(--accent-color);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  text-align: center;
}

.drop-zone-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--secondary-color);
  text-align: left;
}

.drop-zone:hover {
  background-color: #e2e8f0;
  transform: translateY(-2px);
}

.drop-zone .drop-text {
  word-break: break-word;
  max-width: 100%;
  padding: 0 20px;
}

.upload-icons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.drop-text {
  font-size: 1rem;
  line-height: 1.5;
}

.drop-subtext {
  font-size: 0.9rem;
  opacity: 0.7;
}

select {
  padding: 10px;
  font-size: 16px;
}

.action-button {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 500;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Space Grotesk', sans-serif;
}

.action-button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.action-button:active {
  transform: translateY(0);
}

.language-select {
  max-width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: white;
  color: var(--text-color);
  font-family: 'Space Grotesk', sans-serif;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231e293b'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px;
  min-width: 0;
  min-width: 120px !important;
  width: 100%;
  box-sizing: border-box;
}

.language-select::-ms-expand {
  display: none;
}

.language-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.loading {
  background-color: var(--accent-color);
  pointer-events: none;
  opacity: 0.7;
}

.error {
  color: #ef4444;
  margin: 10px;
  font-size: 0.9rem;
}

.controls {
  display: grid;
  gap: 16px;
  margin: 30px 0 16px;
}

.language-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 20px;
  align-items: end;
  width: 100%;
  min-width: min-content;
  min-width: 260px !important;
  width: 100%;
  flex-wrap: wrap;
}

.field-group {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0;
  width: 100%;
  min-width: 120px !important;
  flex: 1;
}

.field-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--secondary-color);
  margin-bottom: 8px;
}

.footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 20px;
  background-color: transparent;
  color: var(--secondary-color);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 10;
}

.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

.action-button .icon {
  fill: white;
}

.credits .icon {
  fill: var(--primary-color);
  margin-top: -2px;
}

.hidden-input {
  display: none;
}

.swap-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.swap-button:hover {
  background-color: var(--accent-color);
  transform: scale(1.1);
}

.swap-button .icon {
  width: 24px;
  height: 24px;
  margin: 0;
  fill: var(--secondary-color);
}

.drop-zone .icon.cloud {
  width: 64px;
  height: 64px;
  color: var(--secondary-color);
  transition: all 0.3s ease;
}

.drop-zone:hover .icon.cloud {
  transform: translateY(4px) scale(1.1);
}

.footer-link {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--primary-color);
}

.footer-link.heart {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
}

.heart-icon {
  width: 16px;
  height: 16px;
  fill: var(--secondary-color);
  transition: transform 0.2s ease;
  position: absolute;
  margin-bottom: 10px;
}

.footer-link.heart:hover .heart-icon {
  transform: scale(1.2);
}

@media (max-width: 640px) {
  .navbar {
    padding: 12px 0;
  }

  .navbar-container {
    padding: 12px;
    flex-direction: row;
    /* Keep horizontal on mobile */
    flex-wrap: wrap;
    gap: 12px;
  }

  .right-section {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .auth-buttons {
    width: 100%;
    justify-content: center;
    gap: 8px;
  }

  .auth-buttons .action-button {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .container {
    margin-top: 120px;
    padding: 12px;
    width: clamp(280px, 95vw, 800px);
  }

  .form-container {
    padding: 20px 40px;
    min-width: 260px;
  }

  .language-controls {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .header h1 {
    font-size: 1.8rem;
  }

  .drop-zone {
    padding: 30px 15px;
    min-height: 120px;
    gap: 12px;
  }

  .drop-zone .icon.cloud {
    width: 84px;  /* increased from 72px */
    height: 84px; /* increased from 72px */
  }

  .drop-text {
    font-size: 0.85rem;
  }

  .action-button {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .language-select {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .field-label {
    font-size: 0.85rem;
  }

  .credits {
    font-size: 0.9rem;
  }

  .credits .icon {
    width: 16px;
    height: 16px;
  }

  .swap-button {
    transform: rotate(90deg);
    margin: 0;
    order: 2;
    justify-self: center;
  }

  .swap-button:hover {
    transform: rotate(90deg) scale(1.1);
  }
}

@media (max-width: 480px) {
  html, body {
    min-width: 320px !important;
    overflow-x: hidden;
  }

  .navbar-container {
    padding: 0 12px;
  }

  .auth-buttons {
    flex-direction: column;
  }

  .auth-buttons .action-button {
    width: 100%;
    font-size: 0.8rem;
  }

  .container {
    width: clamp(280px, 98vw, 800px);
    padding: 12px;
    margin-top: 140px;
    transform: none !important;
    min-width: 280px !important;
    padding: 8px;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .form-container {
    padding: 16px 32px;
    min-width: 240px;
    min-width: 260px !important;
    padding: 16px;
  }

  .drop-zone {
    padding: 24px 12px;
    min-height: 100px;
  }

  .icon {
    width: 16px;
    height: 16px;
  }

  .drop-zone .icon.cloud {
    width: 64px;  /* increased from 48px */
    height: 64px; /* increased from 48px */
  }

  .drop-text {
    font-size: 0.8rem;
  }

  .language-select,
  .action-button {
    font-size: 0.85rem;
  }

  .heart-icon {
    width: 14px;
    height: 14px;
  }

  .language-controls {
    min-width: 240px !important;
  }
}

@media screen and (max-width: 320px) {
  .container {
    transform: scale(0.9);
    width: 100%;
    padding: 4px;
  }
}

@media (max-height: 700px) {
  .container {
    margin-top: 100px;
    margin-bottom: 80px;
  }

  .drop-zone {
    min-height: 100px;
    padding: 24px 12px;
  }
}

@media (max-height: 800px) {
  body {
    justify-content: flex-start;
  }

  .container {
    margin: 100px auto 80px;
  }
}