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

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #16a34a;
  --success-hover: #15803d;
  --error: #dc2626;
  --warning: #f59e0b;
  --bg: #0f172a;
  --bg-card: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

header {
  text-align: center;
  margin-bottom: 32px;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
}

section {
  margin-bottom: 24px;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-muted);
}

input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* File Input */
.file-input-wrapper {
  position: relative;
}

input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.file-label:hover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

.file-icon {
  font-size: 1.5rem;
}

.file-info {
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-bottom: 12px;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

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

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

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

.btn-success:hover:not(:disabled) {
  background: var(--success-hover);
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Status Messages */
.status-section {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
}

.status-section.error {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid var(--error);
  color: #fca5a5;
}

.status-section.success {
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid var(--success);
  color: #86efac;
}

.status-section.info {
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid var(--primary);
  color: #93c5fd;
}

/* Result Section */
.result-section {
  background: var(--bg);
  padding: 16px;
  border-radius: 8px;
}

.result-section h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--success);
}

.result-section p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.result-section span {
  color: var(--text);
}

/* Footer */
footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Utility */
.hidden {
  display: none !important;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  body {
    padding: 12px;
  }
  
  .container {
    padding: 24px;
  }
  
  header h1 {
    font-size: 1.5rem;
  }
}

/* Progress Section */
.progress-section {
  background: var(--bg);
  padding: 16px;
  border-radius: 8px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

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

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

.progress-list {
  max-height: 150px;
  overflow-y: auto;
}

.progress-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}

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

.progress-item-name {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 12px;
}

.progress-item-status {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.progress-item-status.processing {
  color: var(--warning);
}

.progress-item-status.success {
  color: var(--success);
}

.progress-item-status.error {
  color: var(--error);
}

/* Results Section */
.results-section {
  background: var(--bg);
  padding: 16px;
  border-radius: 8px;
}

.results-section h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--success);
}

.results-list {
  max-height: 300px;
  overflow-y: auto;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 8px;
}

.result-item:last-child {
  margin-bottom: 0;
}

.result-item.error {
  border-left: 3px solid var(--error);
}

.result-item.success {
  border-left: 3px solid var(--success);
}

.result-info {
  flex: 1;
  overflow: hidden;
  margin-right: 12px;
}

.result-name {
  display: block;
  font-size: 0.875rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-pages {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.result-error {
  font-size: 0.75rem;
  color: var(--error);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
  width: auto;
  margin-bottom: 0;
}

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

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

/* Warning status */
.status-section.warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--warning);
  color: #fcd34d;
}
