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

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #16a34a;
  --error: #dc2626;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  max-width: 540px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

.subtitle {
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.tool-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.tool-card h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary);
  background: var(--gray-50);
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: var(--gray-400);
  margin-bottom: 1rem;
}

.upload-content p {
  color: var(--gray-700);
}

.upload-content .link {
  color: var(--primary);
  cursor: pointer;
}

.upload-content .hint {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: 0.5rem;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius);
}

.file-icon {
  width: 24px;
  height: 24px;
  color: var(--primary);
  flex-shrink: 0;
}

#file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--gray-500);
  transition: color 0.2s;
}

.btn-icon:hover {
  color: var(--gray-700);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

.options {
  margin-top: 1.5rem;
}

.options label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.rotation-buttons {
  display: flex;
  gap: 0.5rem;
}

.rotation-btn {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  background: white;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.rotation-btn:hover {
  border-color: var(--primary);
}

.rotation-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.progress {
  margin-top: 1.5rem;
}

.progress-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.3s;
}

#progress-text {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: 0.5rem;
  text-align: center;
}

.actions {
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
}

.btn-secondary {
  background: white;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background: var(--gray-50);
}

.download {
  text-align: center;
  padding: 1rem 0;
}

.success-icon {
  width: 48px;
  height: 48px;
  color: var(--success);
  margin-bottom: 0.5rem;
}

.download p {
  color: var(--gray-700);
  margin-bottom: 1rem;
}

.download .btn {
  margin-bottom: 0.5rem;
}

.error {
  text-align: center;
  padding: 1rem 0;
}

.error p {
  color: var(--error);
  margin-bottom: 1rem;
}

footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.hidden {
  display: none !important;
}

@media (max-width: 480px) {
  .container {
    padding: 1rem;
  }

  .tool-card {
    padding: 1rem;
  }

  .upload-area {
    padding: 1.5rem 1rem;
  }
}
