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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
  min-height: 100vh;
  padding: 2rem;
  color: #333;
}

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

.header {
  background: linear-gradient(135deg, #2c5364 0%, #203a43 100%);
  color: white;
  padding: 3rem 2rem 2rem;
  text-align: center;
  position: relative;
}

.github-link {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.github-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.github-icon {
  width: 24px;
  height: 24px;
  filter: invert(1);
}

.title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.worker-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
}

.worker-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fbbf24;
  animation: pulse 2s ease-in-out infinite;
}

.worker-status.ready {
  background: #10b981;
  animation: none;
}

.worker-status.loading {
  background: #fbbf24;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.worker-text {
  font-weight: 500;
}

.main-content {
  padding: 2rem;
}

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

.file-input-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.file-input {
  display: none;
}

.file-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  border: 3px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.3s ease;
}

.file-label:hover {
  border-color: #2c5364;
  background: #f1f5f9;
  transform: translateY(-2px);
}

.file-input-wrapper.drag-over .file-label {
  border-color: #10b981;
  background: #d1fae5;
  border-style: solid;
  transform: scale(1.02);
}

.file-input:focus + .file-label {
  outline: 2px solid #2c5364;
  outline-offset: 2px;
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: #2c5364;
  margin-bottom: 1rem;
}

.file-label-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.file-label-hint {
  font-size: 0.9rem;
  color: #64748b;
}

.status {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.3s ease;
}

.status.info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.status.processing {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  animation: pulse 2s ease-in-out infinite;
}

.status.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.status.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.output-section {
  margin-top: 2rem;
  min-height: 100px;
}

.comparison-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.media-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.media-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1e293b;
  text-align: center;
  margin: 0;
}

.media-preview {
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.media-size {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2c5364;
}

.video-preview {
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.conversion-info {
  background: #f8fafc;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: grid;
  gap: 1rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 600;
  color: #475569;
}

.info-value {
  font-weight: 700;
  color: #1e293b;
  font-size: 1.1rem;
}

.download-button {
  background: linear-gradient(135deg, #2c5364 0%, #203a43 100%);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(44, 83, 100, 0.3);
  color: white;
  display: block;
  margin-bottom: 16px;
  padding: 1rem 2rem;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  width: 100%;
}

.download-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(44, 83, 100, 0.4);
}

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

.ios-instructions {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.ios-instructions p {
  margin: 0.5rem 0;
  color: #1e40af;
  font-size: 0.9rem;
  line-height: 1.5;
}

.ios-instructions p:first-child {
  font-weight: 600;
}

.footer {
  background: #f8fafc;
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 16px;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: #64748b;
  border-top: 1px solid #e2e8f0;
}

@media screen and (max-width: 640px) {
  .footer {
    flex-direction: column;
    gap: 8px;
  }
}

.footer a {
  color: #2c5364;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: #203a43;
  text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
  .comparison-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .media-title {
    font-size: 1.1rem;
  }

  .media-size {
    font-size: 1rem;
  }
}

@media (max-width: 640px) {
  body {
    padding: 1rem;
  }

  .title {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .main-content {
    padding: 1.5rem;
  }

  .file-label {
    padding: 2rem 1rem;
  }

  .upload-icon {
    width: 40px;
    height: 40px;
  }

  .comparison-container {
    gap: 1.5rem;
  }
}
