/* ═══════════════════════════════════════════════
   LIFE ROUTINE HISTORY STYLES
   ═══════════════════════════════════════════════ */

/* ─── DATE SELECTOR ──────────────────────────────── */
.lr-date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.lr-nav-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lr-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.lr-date-display {
  flex: 1;
}

.lr-date-display input[type="date"] {
  width: 100%;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-family: inherit;
  cursor: pointer;
}

.lr-date-display input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

/* ─── VIEW TOGGLES ─────────────────────────────────── */
.lr-view-toggles {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.lr-view-toggle {
  flex: 1;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
}

.lr-view-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lr-view-toggle.active {
  background: rgba(99, 102, 241, 0.3);
  border-color: rgba(99, 102, 241, 0.5);
  color: white;
}

/* ─── WEEK SELECTOR ──────────────────────────────── */
.lr-week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.lr-week-display {
  flex: 1;
  text-align: center;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

/* ─── HISTORY DATA CONTAINER ──────────────────────── */
.lr-history-data {
  padding: 1rem;
}

.lr-history-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lr-history-header h2 {
  font-size: 1.5rem;
  color: white;
  margin: 0;
}

/* ─── HISTORY SECTIONS ──────────────────────────────── */
.lr-history-section {
  margin-bottom: 1.5rem;
}

.lr-history-section h3 {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.75rem;
}

/* ─── HABITS ───────────────────────────────────────── */
.lr-history-habits {
  display: grid;
  gap: 0.5rem;
}

.lr-history-habit {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.lr-history-habit.done {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.lr-habit-icon {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.7);
}

.lr-history-habit.done .lr-habit-icon {
  color: #22c55e;
}

/* ─── TIMELINE ─────────────────────────────────────── */
.lr-history-timeline {
  display: grid;
  gap: 0.5rem;
}

.lr-history-time-entry {
  display: flex;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.lr-time-label {
  min-width: 3rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

.lr-time-activity {
  flex: 1;
  color: rgba(255, 255, 255, 0.9);
}

/* ─── JOURNAL ──────────────────────────────────────── */
.lr-history-journal {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ─── SCORE ────────────────────────────────────────── */
.lr-history-score {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.lr-score-bar {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.lr-score-bar.lr-score-1 {
  background: linear-gradient(90deg, #22c55e 0%, #22c55e 33%, rgba(255, 255, 255, 0.1) 33%);
}

.lr-score-bar.lr-score-2 {
  background: linear-gradient(90deg, #22c55e 0%, #22c55e 66%, rgba(255, 255, 255, 0.1) 66%);
}

.lr-score-bar.lr-score-3 {
  background: linear-gradient(90deg, #22c55e 0%, #22c55e 100%);
}

.lr-score-text {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

/* ─── NO DATA ──────────────────────────────────────── */
.lr-history-no-data {
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ─── WEEK SUMMARY ─────────────────────────────────── */
.lr-week-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.75rem;
}

.lr-week-day {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lr-week-day:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.lr-week-day.has-data {
  border-color: rgba(99, 102, 241, 0.3);
}

.lr-week-day-name {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
}

.lr-week-day-date {
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.5rem;
}

.lr-week-day-score {
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.lr-week-day-score.lr-score-1 {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.lr-week-day-score.lr-score-2 {
  background: rgba(34, 197, 94, 0.4);
  color: #22c55e;
}

.lr-week-day-score.lr-score-3 {
  background: rgba(34, 197, 94, 0.6);
  color: #22c55e;
}

.lr-week-day-habits {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ─── RESPONSIVE ───────────────────────────────────── */
@media (max-width: 768px) {
  .lr-week-summary {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
  }

  .lr-week-day {
    padding: 0.75rem 0.5rem;
  }

  .lr-week-day-date {
    font-size: 1.25rem;
  }
}
