:root {
  --primary-gradient: #667eea;
  --primary-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  --hover-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  --border-radius: 12px;
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 2.5rem;
}

.filename {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
}

.app-title,
.app-title span,
button,
.btn {
  white-space: nowrap;
}

body {
  background: #667eea;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--spacing-md);
  overflow: hidden;
  margin-bottom: 20px;
}

.app-header {
  margin-bottom: 20px;
}

.app-header .header-content {
  max-width: 1200px;
  margin: 0 auto;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.upload-container {
  background-color: white;
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  box-shadow: var(--primary-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  position: relative;
  flex: 1;
  overflow: hidden;
}

.history-container {
  flex: 1;
  overflow-y: auto;
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.5);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.history-container::-webkit-scrollbar {
  width: 6px;
}

.history-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.history-container::-webkit-scrollbar-thumb {
  background: var(--primary-gradient);
  border-radius: 3px;
}

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.history-item {
  background: white;
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.history-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--primary-shadow);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
}

.filename {
  font-weight: 500;
  color: #2d3748;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: var(--spacing-sm);
}

.filesize {
  color: #718096;
  font-size: var(--font-size-sm);
  white-space: nowrap;
}

.progress-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

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

.action-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
  flex-shrink: 0;
  padding: var(--spacing-md);
  background: transparent;
}

.action-group > * {
  height: 48px;
  min-height: 48px;
}

.action-group hl-button::part(button),
.action-group hl-file-input::part(label) {
  height: 100%;
  width: 100%;
}

.btn {
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  font-size: var(--font-size-md);
  background: #28a745;
  color: white;
  box-shadow: var(--primary-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
}

.btn:hover {
  background: #218838;
  transform: translateY(-1px);
  box-shadow: var(--hover-shadow);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  background: #e2e8f0;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.file-input {
  display: none;
}

.status {
  position: relative;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  animation: slideIn 0.3s ease;
  z-index: 1000;
  box-shadow: var(--primary-shadow);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  background: white;
  margin-bottom: var(--spacing-md);
}

.status.success {
  background-color: #f0fff4;
  color: #2f855a;
  border-left: 4px solid #2f855a;
}

.status.error {
  background-color: #fff5f5;
  color: #c53030;
  border-left: 4px solid #c53030;
}

.status::before {
  content: '';
  width: 16px;
  height: 16px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.status.success::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%232f855a'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

.status.error::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23c53030'%3E%3Cpath fill-rule='evenodd' d='M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@media (max-width: 768px) {
  :root {
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
    --font-size-xl: 1.75rem;
  }

  body {
    height: 100%;
    overflow: hidden;
    padding: 10px;
  }

  .container {
    padding: var(--spacing-sm);
  }

  .app-title {
    font-size: 1.75rem;
  }

  .app-subtitle {
    font-size: 1rem;
  }

  .upload-container {
    padding: var(--spacing-md);
  }

  .history-container {
    padding: var(--spacing-sm);
  }

  .history-item {
    padding: var(--spacing-sm);
  }

  .filename {
    font-size: 0.9rem;
  }

  .filesize {
    font-size: 0.8rem;
  }

  .action-group {
    padding: var(--spacing-sm);
    gap: var(--spacing-sm);
  }

  .btn {
    padding: var(--spacing-sm);
    font-size: 0.9rem;
  }

  .status {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-sm);
  }
}

@media (max-width: 480px) {
  .app-title {
    font-size: 1.5rem;
  }

  .app-subtitle {
    font-size: 0.9rem;
  }

  .action-group {
    grid-template-columns: 1fr;
  }

  .btn {
    font-size: 0.85rem;
  }
}
