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

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-tertiary: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --accent: #f6821f;
  --accent-hover: #ff9a3d;
  --border: rgba(255, 255, 255, 0.1);
  --success: #22c55e;
  --error: #ef4444;
  --code-bg: #1e1e1e;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  background: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Navigation */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.25rem;
}

.logo {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 0;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

/* Page Header */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Sections */
.section {
  margin-bottom: 3rem;
}

.section h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.section h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-secondary);
}

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

/* Artifact List */
.artifact-list {
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.artifact-list li {
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* Code Block */
.code-block {
  background: var(--code-bg);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.code-block pre {
  margin: 0;
}

.code-block code {
  background: none;
  padding: 0;
  color: #e6e6e6;
}

/* Parameters Table */
.params-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.params-table th,
.params-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.params-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-secondary);
}

.params-table td {
  color: var(--text-secondary);
}

.params-table td:first-child {
  white-space: nowrap;
}

.params-table td code {
  color: var(--accent);
}

/* Browser Grid */
.browser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.browser-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.browser-icon {
  font-size: 2rem;
}

.browser-name {
  font-weight: 500;
}

/* Upload Area */
.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--bg-secondary);
  transition: all 0.2s;
  cursor: pointer;
}

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

.upload-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.upload-text {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

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

.upload-button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.upload-button:hover {
  background: var(--accent-hover);
}

/* Upload Status */
.upload-status,
.upload-success,
.upload-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.status-icon,
.success-icon,
.error-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.status-text,
.success-text,
.error-text {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.progress-bar {
  width: 100%;
  max-width: 300px;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s;
}

.view-results-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--success);
  color: white;
  border-radius: 8px;
  font-weight: 500;
}

.retry-btn {
  padding: 0.75rem 1.5rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
}

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

/* Results List */
.results-list {
  display: grid;
  gap: 1rem;
}

.result-card {
  display: flex;
  gap: 1.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: all 0.2s;
  color: var(--text-primary);
}

.result-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.result-screenshot {
  width: 200px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.result-screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}

.result-url {
  font-weight: 600;
  font-size: 1.1rem;
  word-break: break-all;
}

.result-meta {
  display: flex;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.result-browser {
  text-transform: capitalize;
}

.result-id {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* No Results */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.no-results p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.upload-link {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  font-weight: 500;
}

/* Loading */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.error {
  text-align: center;
  padding: 2rem;
  color: var(--error);
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
  .top-nav {
    flex-direction: column;
    gap: 1rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .result-card {
    flex-direction: column;
  }

  .result-screenshot {
    width: 100%;
    height: 180px;
  }

  .params-table {
    display: block;
    overflow-x: auto;
  }
}
