/* PWA Test App Styles */
:root {
  --primary-color: #2196F3;
  --secondary-color: #FFC107;
  --success-color: #4CAF50;
  --error-color: #f44336;
  --warning-color: #FF9800;
  --text-primary: #212121;
  --text-secondary: #757575;
  --background: #fafafa;
  --surface: #ffffff;
  --border: #e0e0e0;
  --shadow: 0 2px 4px rgba(0,0,0,0.1);
  --border-radius: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Header Styles */
.navbar {
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand h1 {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 600;
}

.install-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.3s ease;
}

.install-btn:hover {
  background: #1976D2;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Status Bar */
.status-bar {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-bottom: 2rem;
  display: flex;
  gap: 2rem;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.status-value {
  font-weight: 500;
}

/* Test Grid */
.test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.test-card {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.test-card h2 {
  margin-bottom: 1rem;
  color: var(--primary-color);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.test-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.test-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 120px;
}

.test-btn:hover {
  background: #1976D2;
  transform: translateY(-1px);
}

.test-btn:active {
  transform: translateY(0);
}

.test-btn:disabled {
  background: var(--text-secondary);
  cursor: not-allowed;
  transform: none;
}

/* Results */
.results {
  margin-top: 1rem;
  padding: 1rem;
  background: #f5f5f5;
  border-radius: var(--border-radius);
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.4;
  max-height: 300px;
  overflow-y: auto;
}

.results:empty {
  display: none;
}

.success {
  color: var(--success-color);
}

.error {
  color: var(--error-color);
}

.warning {
  color: var(--warning-color);
}

.info {
  color: var(--primary-color);
}

/* Camera Preview */
.camera-preview {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  z-index: 1000;
  max-width: 90vw;
  max-height: 90vh;
}

.camera-preview video {
  max-width: 100%;
  max-height: 60vh;
  border-radius: var(--border-radius);
}

.camera-controls {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.drop-zone.drag-over {
  border-color: var(--primary-color);
  background: rgba(33, 150, 243, 0.1);
  color: var(--primary-color);
}

/* Test All Container */
.test-all-container {
  text-align: center;
  margin: 2rem 0;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.test-all-btn {
  background: var(--success-color);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.test-all-btn:hover {
  background: #43A047;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.clear-btn {
  background: var(--warning-color);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.clear-btn:hover {
  background: #F57C00;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

/* Footer */
footer {
  background: var(--surface);
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

footer p {
  margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .navbar {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
  }

  .container {
    padding: 1rem;
  }

  .status-bar {
    flex-direction: column;
    gap: 1rem;
  }

  .test-grid {
    grid-template-columns: 1fr;
  }

  .test-buttons {
    flex-direction: column;
  }

  .test-btn {
    min-width: auto;
  }

  .test-all-container {
    flex-direction: column;
    align-items: center;
  }

  .camera-preview {
    width: 95vw;
    height: 95vh;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --background: #121212;
    --surface: #1e1e1e;
    --border: #333333;
    --shadow: 0 2px 4px rgba(0,0,0,0.3);
  }

  .results {
    background: #2a2a2a;
  }
}

/* Animation for test results */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results p {
  animation: slideIn 0.3s ease;
}

/* Loading spinner */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-secondary);
  border-radius: 50%;
  border-top: 2px solid var(--primary-color);
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-fill {
  height: 100%;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

/* Notification styles */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  max-width: 300px;
  z-index: 1001;
  animation: slideIn 0.3s ease;
}

.notification.success {
  border-left: 4px solid var(--success-color);
}

.notification.error {
  border-left: 4px solid var(--error-color);
}

.notification.warning {
  border-left: 4px solid var(--warning-color);
}

.notification.info {
  border-left: 4px solid var(--primary-color);
}