/* Log History Styles */

/* Header adjustments */
.nav-back {
  display: flex;
  align-items: center;
  padding: 4px;
  margin: -4px;
  border-radius: var(--radius-md);
  transition: background 0.2s;
}

.nav-back:hover {
  background: rgba(255, 255, 255, 0.05);
}

.nav-logo {
  height: 28px;
  width: auto;
}

.page-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.header-spacer {
  width: 36px; /* Balance the back button */
}

/* Stats Summary */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  border: 1px solid var(--border);
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Filter Controls */
.filter-controls {
  margin-bottom: var(--space-md);
}

.filter-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a8a28f' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Log List */
.log-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding-bottom: 100px; /* Space for bottom nav */
}

/* Individual Log Entry */
.log-entry {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-left: 4px solid var(--state-stable);
}

.log-entry.missed {
  border-left-color: var(--state-monitoring);
  opacity: 0.7;
}

.log-entry.reaction {
  border-left-color: var(--state-escalation);
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.log-date {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.log-day {
  font-size: 0.75rem;
  color: var(--text-light);
  background: var(--bg-input);
  padding: 4px 8px;
  border-radius: 12px;
}

.log-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.log-metric {
  text-align: center;
}

.metric-value {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.metric-label {
  font-size: 0.625rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Adherence indicator */
.log-adherence {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}

.adherence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--state-stable);
}

.adherence-dot.missed {
  background: var(--state-monitoring);
}

.adherence-text {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Reaction indicator */
.log-reaction {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
  padding: var(--space-sm);
  background: rgba(198, 107, 61, 0.1);
  border-radius: var(--radius-sm);
}

.reaction-icon {
  font-size: 1rem;
}

.reaction-text {
  font-size: 0.75rem;
  color: var(--state-escalation);
}

/* Notes */
.log-notes {
  margin-top: var(--space-sm);
  padding: var(--space-sm);
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--text-light);
  font-style: italic;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
}

.empty-state.hidden {
  display: none;
}

.empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 var(--space-xs) 0;
}

.empty-subtext {
  font-size: 0.875rem;
  color: var(--text-light);
  margin: 0 0 var(--space-md) 0;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-xs) var(--space-sm);
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-item:hover,
.nav-item.active {
  color: var(--primary);
}

.nav-icon {
  font-size: 1.25rem;
}

.nav-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

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

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

/* Responsive */
@media (max-width: 480px) {
  .stats-summary {
    gap: var(--space-xs);
  }

  .stat-card {
    padding: var(--space-sm);
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .log-metrics {
    gap: var(--space-xs);
  }
}
