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

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
  padding-top: 60px; /* Account for fixed navbar */
}

/* Navbar Styles */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}

.navbar-brand h1 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.navbar-subtitle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.125rem;
}

.navbar-subtitle .stat-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
}

.navbar-subtitle .stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
}

.navbar-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
  justify-content: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.stat-value {
  font-weight: 600;
  color: #1f2937;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
}

.stat-passed .stat-value {
  color: #10b981;
}

.stat-failed .stat-value {
  color: #ef4444;
}

.stat-divider {
  color: #d1d5db;
  font-weight: 300;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.config-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #6b7280;
  transition: all 0.2s ease;
}

.config-toggle-btn:hover {
  background: #e5e7eb;
  color: #374151;
  border-color: #9ca3af;
}

.config-icon {
  font-size: 0.875rem;
}

.config-text {
  font-size: 0.75rem;
  font-weight: 500;
}

/* Config Section */
.config-section {
  margin-top: 1rem;
  margin-left: 2rem;
  margin-right: 2rem;
  margin-bottom: 2rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow: hidden;
}

.config-content {
  padding: 1.5rem;
}

.config-content h3 {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  color: #2c3e50;
  font-weight: 600;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.config-item {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.config-item-wide {
  grid-column: 1 / -1;
}

.config-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.config-value {
  font-size: 0.875rem;
  color: #374151;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  word-break: break-word;
}

.config-adapter,
.config-viewport,
.config-reporter {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background: white;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.config-adapter:last-child,
.config-viewport:last-child,
.config-reporter:last-child {
  margin-bottom: 0;
}

.config-adapter strong,
.config-viewport strong,
.config-reporter strong {
  color: #3b82f6;
  font-weight: 600;
}

.config-detail {
  color: #6b7280;
  font-size: 0.8rem;
  font-style: italic;
}

@media (max-width: 768px) {
  .config-grid {
    grid-template-columns: 1fr;
  }
  
  .config-item-wide {
    grid-column: 1;
  }
}

.filter-bar {
  background: white;
  padding: 1rem 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
  margin-top: 2rem;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.875rem;
}

.filter-group {
  display: flex;
  gap: 0.5rem;
}

.filter-btn, .clear-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #e5e7eb;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.filter-btn:hover, .clear-btn:hover {
  background: #f3f4f6;
}

.filter-btn.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.filter-select {
  padding: 0.5rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.875rem;
  background: white;
  cursor: pointer;
}

.test-list {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 2rem;
}

.test-card {
  background: white;
  margin-bottom: 0.5rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border: 1px solid #e5e7eb;
  overflow: hidden;
  transition: all 0.2s ease;
}

.test-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}

.test-card.passed { 
  border-left: 3px solid #10b981; 
}
.test-card.failed { 
  border-left: 3px solid #ef4444; 
}
.test-card.capture-failed { 
  border-left: 3px solid #f59e0b; 
}

.test-header {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  min-height: 60px;
}

.test-header:hover {
  background: rgba(0,0,0,0.02);
}

.test-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.test-status {
  flex-shrink: 0;
}

.status-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
}

.status-dot[data-status="passed"] { background: #10b981; }
.status-dot[data-status="failed"] { background: #ef4444; }
.status-dot[data-status="capture-failed"] { background: #f59e0b; }

.test-content {
  flex: 1;
  min-width: 0;
}

.test-title {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-weight: 600;
  color: #1f2937;
  font-size: 0.875rem;
  line-height: 1.4;
  margin-bottom: 0.125rem;
  word-break: break-all;
}

.test-id {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.test-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: #6b7280;
  flex-wrap: wrap;
}

.test-browser, .test-viewport {
  background: #f8f9fa;
  color: #6b7280;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid #e5e7eb;
}

.test-diff {
  background: #fef2f2;
  color: #dc2626;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid #fecaca;
}

.test-actions {
  flex-shrink: 0;
}

.expand-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0.5rem;
  color: #6b7280;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.expand-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.expand-btn.expanded {
  transform: rotate(180deg);
  background: #f3f4f6;
  color: #374151;
}

.expand-icon {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.test-details {
  padding: 1.5rem;
  border-top: 1px solid #e5e7eb;
  user-select: none;
}

.image-comparison {
  margin-bottom: 1rem;
}

.image-viewer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.image-viewer.single {
  grid-template-columns: 1fr;
  justify-items: center;
}

.image-panel {
  text-align: center;
}

.image-panel h4 {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
  text-transform: uppercase;
}

.image-panel img {
  max-width: 100%;
  width: auto;
  height: auto;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s;
}

/* Comparison Controls */
.comparison-controls {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.view-mode-switcher {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.mode-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #e5e7eb;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.mode-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.mode-btn.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

/* Side by Side View */
.side-by-side {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: start;
}

.side-by-side .image-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.side-by-side img {
  max-width: 100%;
  width: auto;
  height: auto;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

/* Slider View */
.slider-view {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.slider-view img {
  width: 100%;
  height: auto;
  display: block;
}

.slider-view .base-img {
  position: relative;
  z-index: 1;
}

.slider-view .current-img {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

.slider-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #3b82f6;
  cursor: ew-resize;
  z-index: 3;
  border-radius: 4px;
  box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

.slider-divider:hover {
  background: #2563eb;
  width: 6px;
}

/* Overlay View */
.overlay-view {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.overlay-view img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.overlay-img {
  position: absolute;
  top: 0;
  left: 0;
}

.opacity-slider {
  width: 100%;
  margin-top: 1rem;
  height: 6px;
  border-radius: 4px;
  background: #e5e7eb;
  outline: none;
  -webkit-appearance: none;
}

.opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.opacity-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.test-metadata {
  display: flex;
  gap: 2rem;
  font-size: 0.875rem;
  color: #6b7280;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.test-stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
}

.test-stat-value {
  font-weight: 600;
  color: #1f2937;
  font-size: 0.875rem;
}

.test-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
}

.no-results {
  text-align: center;
  padding: 3rem;
  color: #6b7280;
  font-size: 1.125rem;
}

/* Missing Image Placeholder */
.missing-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  background: #f8f9fa;
  border: 1px dashed #e5e7eb;
  border-radius: 6px;
  color: #6b7280;
  text-align: center;
  padding: 0.75rem;
}

.missing-image-placeholder .placeholder-icon {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
  opacity: 0.6;
}

.missing-image-placeholder .placeholder-text {
  font-size: 0.75rem;
  font-weight: 500;
  color: #9ca3af;
}

/* Slider placeholder specific styles */
.missing-image-placeholder.slider-placeholder {
  position: relative;
  z-index: 1;
  min-height: 150px;
  width: 100%;
}

/* Overlay placeholder specific styles */
.missing-image-placeholder.overlay-placeholder {
  position: relative;
  z-index: 1;
  min-height: 150px;
  width: 100%;
}


@media (max-width: 768px) {
  .navbar {
    padding: 0.5rem 1rem;
    flex-wrap: wrap;
    min-height: auto;
  }
  
  .navbar-brand h1 {
    font-size: 1.125rem;
  }
  
  .navbar-subtitle {
    margin-top: 0.25rem;
  }
  
  .navbar-subtitle .stat-value {
    font-size: 0.8rem;
  }
  
  .navbar-subtitle .stat-label {
    font-size: 0.7rem;
  }
  
  .navbar-stats {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: 1rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
  }
  
  .stat-item {
    font-size: 0.8rem;
  }
  
  .stat-label {
    font-size: 0.7rem;
  }
  
  .navbar-actions {
    order: 2;
  }
  
  .config-section {
    margin-left: 1rem;
    margin-right: 1rem;
  }
  
  .test-header {
    padding: 0.75rem 1rem;
    min-height: 50px;
  }
  
  .test-main {
    gap: 0.75rem;
  }
  
  .test-meta {
    gap: 0.5rem;
  }
  
  .test-browser, .test-viewport, .test-diff {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
  }
  
  .test-title {
    font-size: 0.8rem;
  }
  
  .test-id {
    font-size: 0.7rem;
  }
  
  .image-viewer, .side-by-side {
    grid-template-columns: 1fr;
  }
  
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group {
    width: 100%;
  }
  
  .meta-info {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .meta-right {
    align-self: flex-end;
  }
}
