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

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #161616;
  --bg-tertiary: #1f1f1f;
  --border-primary: #2a2a2a;
  --border-secondary: #3a3a3a;
  --text-primary: #ffffff;
  --text-secondary: #a1a1a1;
  --text-muted: #6a6a6a;
  --accent-primary: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --success-hover: #059669;
  --error: #ef4444;
  --error-bg: #1f1415;
  --error-border: #2d1b1f;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-primary);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.header-icon {
  color: var(--accent-primary);
}

header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.upload-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
}

.upload-area {
  border: 2px dashed var(--border-secondary);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 2rem;
  background: var(--bg-tertiary);
}

.upload-area:hover {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.05);
}

.upload-area.dragover {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.1);
  transform: scale(1.02);
}

.upload-icon {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.upload-icon svg {
  transition: color 0.3s ease;
}

.upload-area:hover .upload-icon svg {
  color: var(--accent-primary);
}

.browse-text {
  color: var(--accent-primary);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}

.file-types {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.size-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.size-controls label {
  font-weight: 500;
  color: var(--text-secondary);
}

.size-controls input {
  width: 80px;
  padding: 0.75rem;
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
  text-align: center;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: inherit;
  transition: all 0.3s ease;
}

.size-controls input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

button {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

button:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.preview {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.preview h3 {
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  font-weight: 600;
}

.preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 12px;
  border: 1px solid var(--border-secondary);
}

.results {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
}

.results h3 {
  color: var(--success);
  margin-bottom: 2rem;
  font-size: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.success-icon {
  color: var(--success);
}

.download-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 320px;
  margin: 0 auto;
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  transition: all 0.3s ease;
  font-family: inherit;
}

.download-btn:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
}

.download-btn .icon {
  transition: transform 0.3s ease;
}

.download-btn:hover .icon {
  transform: translateY(-1px);
}

.download-all {
  background: var(--success) !important;
  color: white !important;
  border-color: var(--success) !important;
  font-weight: 600;
}

.download-all:hover {
  background: var(--success-hover) !important;
  border-color: var(--success-hover) !important;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3) !important;
}

.loading {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
}

.loading p {
  color: var(--text-secondary);
  margin-top: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-secondary);
  border-top: 3px solid var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  text-align: center;
  font-weight: 500;
}

footer {
  margin-top: auto;
  padding-top: 3rem;
  text-align: center;
  border-top: 1px solid var(--border-primary);
}

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

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: var(--accent-primary);
}

.footer-icon {
  transition: transform 0.3s ease;
}

.footer-link:hover .footer-icon {
  transform: translate(1px, -1px);
}

.hidden {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  .upload-form,
  .preview,
  .results,
  .loading {
    padding: 1.5rem;
  }
  
  .options {
    flex-direction: column;
    align-items: stretch;
  }
  
  .size-controls {
    justify-content: center;
  }
  
  .download-links {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0.75rem;
  }
  
  header {
    margin-bottom: 2rem;
  }
  
  header h1 {
    font-size: 1.75rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .upload-area {
    padding: 2rem 1rem;
  }
  
  .upload-form,
  .preview,
  .results,
  .loading {
    padding: 1rem;
  }
}