/* Design tokens */
/* Background: #F5F5F5, Text: #000000, Accent: #FF007F, Font: Inter */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #F5F5F5;
  color: #000000;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1.5rem 0;
  letter-spacing: -0.02em;
}

/* Date bar */
#date-bar {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

#date-bar label {
  font-weight: 500;
  font-size: 0.875rem;
  white-space: nowrap;
}

#date-bar input[type="date"],
#date-bar select {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  background: #fff;
  color: #000;
  cursor: pointer;
}

#date-bar select {
  min-width: 110px;
}

/* Record section */
#record-section {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  padding: 1rem 0 2rem;
}

#mic-btn {
  width: 100%;
  height: 72px;
  border-radius: 40px;
  border: 2px solid #000;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: #000;
  letter-spacing: -0.01em;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  outline: none;
}

#mic-btn:hover {
  background: #f0f0f0;
}

/* Pulsing animation when recording */
#mic-btn.recording {
  background: #FF007F;
  border-color: #FF007F;
  color: #fff;
  animation: pulse 1.2s ease-in-out infinite;
}

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

#timer {
  font-size: 1rem;
  font-weight: 500;
  color: #000;
  font-variant-numeric: tabular-nums;
}

/* iOS fallback */
#ios-fallback {
  padding: 1rem 0;
}

.fallback-label {
  color: #666;
  font-size: 0.875rem;
  margin: 0 0 0.5rem 0;
}

#fallback-text {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.75rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  resize: vertical;
  margin-bottom: 0.75rem;
}

#fallback-submit {
  background: #000;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}

#fallback-submit:hover {
  background: #222;
}

/* Processing section */
#processing-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 0;
  color: #444;
  font-size: 0.9375rem;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #ddd;
  border-top-color: #FF007F;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Card section */
.card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.field-group {
  margin-bottom: 1rem;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-group label {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
  color: #000;
}

.field-group select,
.field-group input[type="text"],
.field-group input[type="number"],
.field-group textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.5rem 0.625rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  color: #000;
  background: #fff;
  resize: vertical;
  transition: border-color 0.15s;
}

.field-group select:focus,
.field-group input[type="text"]:focus,
.field-group input[type="number"]:focus,
.field-group textarea:focus {
  outline: none;
  border-color: #FF007F;
}

.transcript-group label {
  color: #666;
}

.transcript-display {
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 0.5rem 0.625rem;
  font-size: 0.875rem;
  color: #555;
  min-height: 2.5rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Card actions */
.card-actions {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.btn-primary {
  background: #000;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: #222;
}

.btn-secondary {
  background: transparent;
  color: #000;
  border: 1px solid #000;
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: #f0f0f0;
}

/* Status bar */
#status-bar {
  text-align: center;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.9375rem;
  margin-top: 1rem;
}

#status-bar.success {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #a5d6a7;
}

#status-bar.error {
  background: #fce4ec;
  color: #880e4f;
  border: 1px solid #f48fb1;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Mobile: ensure no horizontal scroll on 375px+ */
@media (max-width: 420px) {
  .container {
    padding: 1rem;
  }

  #date-bar {
    gap: 0.5rem;
  }

  .card-actions {
    flex-direction: column-reverse;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    text-align: center;
  }
}
