* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: Arial, sans-serif;
  background: radial-gradient(circle at top, #f7f7fb, #eff1f8);
  color: #111827;
  padding: 24px;
}

@media (max-width: 768px) {
  body {
    padding: 16px;
    justify-content: center;
  }
}

.page-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 640px;
}

h1 {
  font-size: clamp(32px, 4vw, 48px);
  text-align: center;
  margin: 0 0 32px 0;
  width: 100%;
}

@media (max-width: 768px) {
  h1 {
    font-size: clamp(24px, 6vw, 32px);
    margin: 0 0 24px 0;
  }
}

.upload-container {
  width: min(640px, 100%);
  background: #ffffffdd;
  border-radius: 20px;
  box-shadow: 0 20px 45px -20px rgba(15, 23, 42, 0.65);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  backdrop-filter: blur(8px);
}

@media (max-width: 768px) {
  .upload-container {
    padding: 20px;
    gap: 16px;
    border-radius: 16px;
  }
}

.dropzone {
  border: 2px dashed #6366f1;
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  transition: all 0.2s ease;
  background: rgba(99, 102, 241, 0.04);
  cursor: pointer;
  position: relative;
  display: block;
  overflow: hidden;
}

@media (max-width: 768px) {
  .dropzone {
    padding: 32px 16px;
    border-radius: 12px;
  }
}

.dropzone:focus,
.dropzone:focus-within {
  outline: none;
  border: 2px dashed #6366f1;
}

.dropzone.dragover {
  background: rgba(99, 102, 241, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -24px rgba(99, 102, 241, 0.65);
}

.dropzone input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  z-index: 1;
}

.dropzone input[type="file"]:focus,
.dropzone input[type="file"]:active,
.dropzone input[type="file"]:hover,
.dropzone input[type="file"]:focus-visible,
.dropzone input[type="file"]::-webkit-file-upload-button {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

.dropzone input[type="file"]::-webkit-file-upload-button {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.dropzone p {
  margin: 8px 0;
  color: #4b5563;
  font-size: 16px;
}

.dropzone p.strong {
  font-weight: 600;
  color: #1f2937;
  font-size: 18px;
}

button {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
  button {
    padding: 16px 24px;
    font-size: 16px;
    min-height: 48px;
    width: 100%;
  }
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px -24px rgba(99, 102, 241, 0.8);
}

button:disabled {
  background: #cbd5f5;
  cursor: not-allowed;
  box-shadow: none;
}

.button-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 24px;
}

.status {
  font-size: 15px;
  color: #374151;
  line-height: 1.5;
  word-break: break-all;
  min-height: 0;
}

.status:empty {
  display: none;
}

.status.error {
  color: #dc2626;
  font-size: 18px;
  font-weight: 500;
  white-space: pre-line;
  line-height: 1.6;
}

.status.success {
  color: #166534;
}

.file-info {
  text-align: center;
  padding: 24px;
}

.file-info h2 {
  margin: 0 0 16px 0;
  font-size: 24px;
  color: #1f2937;
}

.file-size {
  margin: 0 0 24px 0;
  color: #6b7280;
  font-size: 16px;
}

.download-button {
  display: inline-block;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
  .download-button {
    padding: 16px 24px;
    width: 100%;
    min-height: 48px;
  }
}

.download-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px -24px rgba(99, 102, 241, 0.8);
}

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

/* Error popup */
.error-popup {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #fee2e2;
  border: 2px solid #dc2626;
  border-radius: 12px;
  padding: 16px 24px;
  color: #991b1b;
  font-weight: 600;
  font-size: 15px;
  z-index: 1000;
  box-shadow: 0 10px 25px -5px rgba(220, 38, 38, 0.3);
  animation: slideDown 0.3s ease-out;
  max-width: 90%;
  text-align: center;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 768px) {
  .error-popup {
    top: 10px;
    left: 10px;
    right: 10px;
    transform: none;
    max-width: none;
    padding: 12px 16px;
    font-size: 14px;
  }
  
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .status {
    font-size: 14px;
  }
  
  .status.error {
    font-size: 16px;
  }
  
  .file-info h2 {
    font-size: 20px;
  }
  
  .file-size {
    font-size: 14px;
  }
  
  .dropzone p {
    font-size: 14px;
  }
  
  .dropzone p.strong {
    font-size: 16px;
  }
}

/* Success content */
.success-content {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.download-link-container {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.download-link-input {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-family: monospace;
  background: #f9fafb;
  color: #111827;
  cursor: text;
}

@media (max-width: 768px) {
  .download-link-input {
    width: 100%;
    min-width: 0;
    font-size: 12px;
    padding: 14px;
  }
}

.download-link-input:focus {
  outline: none;
  border-color: #6366f1;
  background: #ffffff;
}

.copy-link-button {
  padding: 12px 24px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
  .copy-link-button {
    width: 100%;
    padding: 14px 24px;
    min-height: 48px;
  }
}

.copy-link-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px -4px rgba(16, 185, 129, 0.4);
}

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

.copy-link-button.copied {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.upload-another-button {
  margin-top: 24px;
  padding: 12px 24px;
  background: transparent;
  color: #6366f1;
  border: 2px solid #6366f1;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
  .upload-another-button {
    width: 100%;
    padding: 14px 24px;
    min-height: 48px;
  }
}

.upload-another-button:hover {
  background: #6366f1;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 8px 16px -4px rgba(99, 102, 241, 0.4);
}

/* Download progress */
.download-progress {
  margin-top: 24px;
  text-align: center;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  font-weight: 500;
}

@media (max-width: 768px) {
  .status {
    font-size: 14px;
  }
  
  .status.error {
    font-size: 16px;
  }
  
  .file-info h2 {
    font-size: 20px;
  }
  
  .file-size {
    font-size: 14px;
  }
  
  .dropzone p {
    font-size: 14px;
  }
  
  .dropzone p.strong {
    font-size: 16px;
  }
  
  .error-popup {
    top: 10px;
    left: 10px;
    right: 10px;
    transform: none;
    max-width: none;
    padding: 12px 16px;
    font-size: 14px;
  }
  
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .progress-text {
    font-size: 12px;
  }
  
  .button-container {
    margin-top: 16px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 12px;
  }
  
  h1 {
    font-size: 22px;
    margin: 0 0 20px 0;
  }
  
  .upload-container {
    padding: 16px;
    gap: 12px;
  }
  
  .dropzone {
    padding: 24px 12px;
  }
  
  .file-info {
    padding: 16px;
  }
}
