/* SNAPback Systems - WCAG 2.2 AA Compliant Styles */
* { box-sizing: border-box; }

body {
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  background: #fff;
  color: #000;
  padding: 8px 16px;
  text-decoration: none;
  font-weight: bold;
  border: 2px solid #000;
  z-index: 9999;
}

.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
header {
  padding: 1rem;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

/* Language selector */
#lang {
  background: #333;
  color: #fff;
  border: 2px solid #666;
  padding: 0.5rem;
  font-size: 1rem;
  border-radius: 4px;
  min-width: 120px;
}

#lang:focus {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* Main content */
main {
  padding: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

main:focus { outline: none; }

/* Typography */
h2 {
  font-size: 1.375rem;
  margin: 2rem 0 1rem 0;
  font-weight: 600;
}

h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem 0;
  font-weight: 600;
}

p { margin: 0 0 1rem 0; }

/* California notice */
.california-note {
  background: #2c1810;
  border: 2px solid #ffc107;
  color: #fff3cd;
  padding: 1rem;
  border-radius: 4px;
  margin: 1rem 0;
}

/* Buttons */
.btn {
  background: #fff;
  color: #000;
  border: 2px solid #fff;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
  margin: 0.25rem;
  transition: all 0.2s ease;
}

.btn:hover, .btn:focus {
  background: #f0f0f0;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.btn:disabled {
  background: #666;
  color: #999;
  border-color: #666;
  cursor: not-allowed;
}

.btn.active {
  background: #28a745;
  border-color: #28a745;
  color: #fff;
}

.btn-secondary {
  background: #333;
  color: #fff;
  border-color: #666;
}

.btn-danger {
  background: #d63384;
  color: #fff;
  border-color: #d63384;
}

/* Mode buttons */
.mode-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.mode-buttons .btn {
  flex: 1;
  min-width: 120px;
  margin: 0;
}

/* Cards */
.card {
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem 0;
}

/* Form elements */
input, textarea, select {
  background: #222;
  color: #fff;
  border: 2px solid #666;
  padding: 12px;
  font-size: 1rem;
  border-radius: 4px;
  width: 100%;
  margin: 0.5rem 0;
}

input:focus, textarea:focus, select:focus {
  outline: 3px solid #fff;
  outline-offset: 2px;
  border-color: #fff;
}

input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
  transform: scale(1.2);
}

input[type="number"] {
  max-width: 120px;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

label {
  display: block;
  font-weight: 600;
  margin: 0.75rem 0 0.25rem 0;
}

/* Exemption form */
.q {
  margin: 1rem 0;
}

.q label {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.q label:hover {
  background: #222;
}

.exemption-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 4px;
  border: 2px solid #666;
}

.exemption-result.eligible {
  background: #0d4121;
  border-color: #28a745;
  color: #d4edda;
}

.exemption-result.not-eligible {
  background: #2c1810;
  border-color: #ffc107;
  color: #fff3cd;
}

/* Voice interface */
.transcript {
  background: #222;
  border: 1px solid #666;
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
  min-height: 100px;
  font-style: italic;
}

.voice-controls {
  display: flex;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.voice-controls label {
  margin: 0;
}

.voice-controls input {
  margin: 0;
  flex: 1;
  min-width: 80px;
}

/* Tap interface */
.tap-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.75rem 0;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.tap-row:hover {
  background: #222;
}

.tap-row label {
  flex: 1;
  margin: 0;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.tap-row .hrs {
  width: 80px;
  margin: 0;
  flex-shrink: 0;
}

/* Activities list */
.activities-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 1rem;
}

.activity-item {
  background: #222;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 1rem;
  margin: 0.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.activity-content {
  flex: 1;
}

.activity-meta {
  font-size: 0.875rem;
  color: #ccc;
  margin-top: 0.25rem;
}

.activity-remove {
  background: #d63384;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.empty-state {
  color: #999;
  font-style: italic;
  text-align: center;
}

/* Status */
#status {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 4px;
  font-weight: 600;
}

#status.success {
  background: #0d4121;
  color: #d4edda;
  border: 1px solid #28a745;
}

#status.error {
  background: #2c1810;
  color: #f8d7da;
  border: 1px solid #dc3545;
}

#status.info {
  background: #102a44;
  color: #d1ecf1;
  border: 1px solid #17a2b8;
}

/* Grid layout */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

/* Hints */
.hint {
  font-size: 0.875rem;
  color: #ccc;
  margin: 0.25rem 0;
}

/* Nudges */
details {
  margin: 1rem 0;
}

summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.5rem;
  border-radius: 4px;
  background: #222;
}

summary:hover {
  background: #333;
}

.nudges {
  margin: 1rem 0 0 0;
  padding: 0 0 0 1.5rem;
}

.nudges li {
  margin: 0.75rem 0;
  line-height: 1.4;
}

/* Footer */
footer {
  border-top: 1px solid #333;
  padding: 2rem 1rem;
  margin-top: 3rem;
  text-align: center;
  color: #ccc;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  .mode-buttons .btn {
    min-width: 100px;
  }
  
  .voice-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .activity-item {
    flex-direction: column;
    align-items: stretch;
  }
  
  .activity-remove {
    align-self: flex-end;
  }
  
  .tap-row {
    flex-wrap: wrap;
  }
  
  header {
    flex-direction: column;
    align-items: stretch;
  }
  
  #lang {
    width: 100%;
  }
}