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

html {
  font-size: 16px;
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
}

body {
  font-family: 'Poppins', sans-serif;
  background: #1a1a1a;
  color: #ffffff;
  min-height: 100vh;
  padding: clamp(1rem, 5vw, 2rem);
  line-height: 1.5;
}

.container {
  max-width: min(800px, 95%);
  margin: 0 auto;
  background: #2d2d2d;
  padding: clamp(1rem, 3vw, 2rem);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

h1 {
  color: #63b3ed;
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 1.75rem;
  font-weight: 500;
}

.upload-section {
  text-align: center;
  margin: 1.5rem 0;
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 2px dashed #4a5568;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.upload-section:hover, .upload-section.dragging {
  border-color: #63b3ed;
  background: rgba(99, 179, 237, 0.1);
}

.upload-section.dragging {
  border-style: solid;
}

.selected-files {
  margin-top: 1rem;
  text-align: left;
  background: #363636;
  border-radius: 8px;
  padding: 1rem;
}

.files-header {
  color: #63b3ed;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  margin: 0.25rem 0;
  background: #2d2d2d;
  border-radius: 4px;
  font-size: 0.8rem;
}

.remove-file {
  background: none;
  border: none;
  color: #fc8181;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.remove-file:hover {
  background: rgba(252, 129, 129, 0.2);
}

.button-container {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.upload-label {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.25rem;
  background: #2d3748;
  color: #63b3ed;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #4a5568;
  font-size: 0.875rem;
}

.upload-label:hover {
  transform: translateY(-2px);
  background: #3c4556;
  color: #7ab3ec;
}

.process-btn {
  margin-top: 1rem;
  padding: 0.75rem 2rem;
  background: #2d3748;
  color: #63b3ed;
  border: 1px solid #4a5568;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
}

.process-btn:hover {
  background: #3c4556;
  color: #7ab3ec;
  transform: translateY(-2px);
}

.stats-section {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.stat-item {
  background: #363636;
  padding: 1rem;
  border-radius: 8px;
  flex: 1;
}

.stat-item h3 {
  color: #63b3ed;
  font-size: 0.7rem;
  margin-bottom: 0.5rem;
}

.stat-item span {
  font-size: 1.5rem;
  font-weight: 600;
}

.upload-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  margin-right: 0.5rem;
}

#pdfInput {
  display: none;
}

.loading {
  margin-top: 1rem;
  color: #4a5568;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(66, 153, 225, 0.3);
  border-radius: 50%;
  border-top-color: #4299e1;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none;
}

#results {
  margin-top: 2rem;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.download-buttons {
  display: flex;
  gap: 1rem;
}

.download-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #2d3748;
  color: #48bb78;
  border: 1px solid #4a5568;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.download-btn:hover {
  background: #3c4556;
  color: #5fd08a;
}

.download-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.email-list {
  background: #1a1a1a;
  border-radius: 8px;
  padding: 1rem;
  max-height: min(400px, 60vh);
  overflow-y: auto;
}

.email-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  margin: 0.25rem 0;
  background: #363636;
  border-radius: 4px;
  font-size: 0.7rem;
}

.email-actions {
  display: flex;
  gap: 0.5rem;
}

.email-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: #3c4556;
  border-radius: 4px;
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 0.8125rem;
}

.email-link.send {
  color: #63b3ed;
  border: 1px solid #4a5568;
}

.email-link.send:hover {
  background: #3c4556;
  color: #fc8181;
}

.email-link.send svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}