/* Shelter Adoption Matcher - Caregiver PWA Styles */
:root {
  --primary: #4a90a4;
  --primary-dark: #357a8c;
  --secondary: #6c757d;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #333333;
  --text-light: #666666;
  --border: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

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

#app {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: var(--primary);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header h1 {
  font-size: 1.3rem;
  font-weight: 600;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
}

.status-dot.offline {
  background: var(--danger);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 20px;
}

.section {
  display: none;
}

.section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Search Section */
.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-box input {
  flex: 1;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--primary);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.animal-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.animal-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.animal-card img {
  width: 70px;
  height: 70px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--border);
}

.animal-card .info {
  flex: 1;
}

.animal-card h4 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.animal-card p {
  font-size: 0.9rem;
  color: var(--text-light);
}

.animal-card .has-notes {
  font-size: 0.75rem;
  color: var(--success);
  margin-top: 4px;
}

/* Selected Animal */
.selected-animal {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.animal-photo {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--border);
}

.animal-info {
  flex: 1;
}

.animal-info h3 {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.animal-info p {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Questions Panel */
.questions-panel {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.questions-panel h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--primary);
}

.instructions {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.questions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.questions-list li {
  font-size: 0.95rem;
  line-height: 1.4;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.questions-list li:last-child {
  border-bottom: none;
}

.q-num {
  color: var(--primary);
  font-weight: 600;
  margin-right: 4px;
}

/* Recorder Panel */
.recorder-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.recording-indicator {
  display: none;
  align-items: center;
  gap: 10px;
  color: var(--danger);
  font-weight: 500;
}

.recording-indicator.active {
  display: flex;
}

.pulse {
  width: 12px;
  height: 12px;
  background: var(--danger);
  border-radius: 50%;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.btn-record {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 4px 20px rgba(74, 144, 164, 0.4);
}

.btn-record:hover {
  transform: scale(1.05);
}

.btn-record.recording {
  background: var(--danger);
  animation: recordPulse 2s infinite;
}

@keyframes recordPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(220, 53, 69, 0.4); }
  50% { box-shadow: 0 4px 40px rgba(220, 53, 69, 0.6); }
}

.record-icon {
  font-size: 3rem;
}

.record-text {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Review Section */
.transcript-box {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.transcript-box h4 {
  color: var(--primary);
  margin-bottom: 8px;
}

.transcript-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-light);
  white-space: pre-wrap;
}

.parsed-notes {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.parsed-notes h4 {
  color: var(--primary);
  margin-bottom: 12px;
}

.notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.note-item {
  padding: 8px 0;
}

.note-item.full-width {
  grid-column: 1 / -1;
}

.note-item label {
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
}

.note-item p {
  font-size: 0.95rem;
}

.action-buttons {
  display: flex;
  gap: 12px;
}

/* Buttons */
.btn {
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, opacity 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: white;
  flex: 1;
}

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

.btn-secondary {
  background: var(--secondary);
  color: white;
  flex: 1;
}

.btn-text {
  background: none;
  color: var(--primary);
  padding: 8px;
}

/* Success Section */
.success-message {
  text-align: center;
  padding: 40px 20px;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 20px;
}

.success-message h2 {
  color: var(--success);
  margin-bottom: 12px;
}

.success-message p {
  color: var(--text-light);
  margin-bottom: 24px;
}

/* Offline Queue */
.offline-queue {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--warning);
  color: #333;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
}

.offline-queue.visible {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Loading Overlay */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.9);
  z-index: 1000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 400px) {
  .notes-grid {
    grid-template-columns: 1fr;
  }
  
  .btn-record {
    width: 140px;
    height: 140px;
  }
  
  .record-icon {
    font-size: 2.5rem;
  }
}
