/* ============================================
   LINUS — Dashboard Cards  ?v=4
   Expandable pastel cards · Staggered entrance (80ms)
   Adaptive ordering · Suggestion card
   ============================================ */

/* =============================================
   FEED CONTAINER
   ============================================= */
.home-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + var(--space-3xl));
}

/* =============================================
   BASE CARD — pastel, rounded, soft shadow
   ============================================= */
.dash-card {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition:
    box-shadow var(--transition-normal),
    transform var(--transition-normal);
  /* Staggered entrance animation */
  opacity: 0;
  transform: translateY(16px);
  animation: cardEntrance 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Staggered delay for each card (80ms intervals) */
.dash-card:nth-child(1) { animation-delay: 0ms; }
.dash-card:nth-child(2) { animation-delay: 80ms; }
.dash-card:nth-child(3) { animation-delay: 160ms; }
.dash-card:nth-child(4) { animation-delay: 240ms; }
.dash-card:nth-child(5) { animation-delay: 320ms; }
.dash-card:nth-child(6) { animation-delay: 400ms; }
.dash-card:nth-child(7) { animation-delay: 480ms; }

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

.dash-card:active {
  transform: scale(0.985);
}

/* =============================================
   CARD HEADER — icon + title + badge (no chevron)
   ============================================= */
.dash-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition-fast);
}

.dash-card__header:active {
  filter: brightness(0.96);
}

.dash-card__title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.dash-card__title-icon {
  font-size: 1.15em;
}

.dash-card__right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Badge on the right — semi-transparent pill */
.dash-card__badge {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.65);
  color: var(--color-text-secondary);
  letter-spacing: 0.01em;
}

/* Chevron — HIDDEN by default (remove visual) */
.dash-card__chevron {
  display: none;
}

/* =============================================
   CARD BODY — expand/collapse animation
   ============================================= */
.dash-card__body {
  max-height: 0;
  overflow: hidden;
  padding: 0 var(--space-lg);
  transition:
    max-height 350ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
    padding 350ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 250ms ease;
  opacity: 0;
}

/* ---- Open state (default for startOpen) ---- */
.dash-card--open .dash-card__body {
  max-height: 600px;
  padding: 0 var(--space-lg) var(--space-lg);
  opacity: 1;
}

/* =============================================
   PER-CARD PASTEL COLOURS
   ============================================= */
.dash-card--briefing {
  background: var(--bg-briefing);
  border: 1px solid rgba(139, 126, 200, 0.08);
}

.dash-card--wallet {
  background: var(--bg-wallet);
  border: 1px solid rgba(91, 173, 138, 0.08);
}

.dash-card--shopping {
  background: var(--bg-shopping);
  border: 1px solid rgba(232, 149, 106, 0.08);
}

.dash-card--contacts {
  background: var(--bg-contacts);
  border: 1px solid rgba(91, 155, 213, 0.08);
}

.dash-card--notes {
  background: var(--bg-notes);
  border: 1px solid rgba(212, 168, 67, 0.08);
}

.dash-card--tasks {
  background: var(--bg-tasks-card);
  border: 1px solid rgba(139, 126, 200, 0.08);
}

.dash-card--email {
  background: var(--bg-email);
  border: 1px solid rgba(212, 123, 138, 0.08);
}

/* =============================================
   BRIEFING CONTENT
   ============================================= */
.briefing-text {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: var(--leading-relaxed);
  white-space: pre-line;
}

/* Empty state inside a card */
.card-empty {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--space-lg) 0;
  font-style: italic;
}

/* =============================================
   WALLET CONTENT
   ============================================= */
.wallet-total {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.wallet-total__amount {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--accent-mint);
}

.wallet-total__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.wallet-sources {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.wallet-source {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wallet-source__info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wallet-source__name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}

.wallet-source__value {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

.wallet-source__value small {
  font-weight: var(--weight-regular);
  color: var(--color-text-muted);
}

.wallet-source__bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.wallet-source__bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wallet-source__spent {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: right;
}

/* =============================================
   SHOPPING CONTENT
   ============================================= */
.shopping-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.shopping-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xs) 0;
}

.shopping-item__check {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
  border: 2px solid var(--accent-peach-light);
  background: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-spring);
}

.shopping-item__check:hover {
  border-color: var(--accent-peach);
  background: rgba(255, 245, 238, 0.8);
}

.shopping-item__check:active {
  transform: scale(0.85);
}

.shopping-item__check.checked {
  background: var(--accent-peach);
  border-color: var(--accent-peach);
  animation: checkPop 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.shopping-item__check.checked::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
}

@keyframes checkPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.shopping-item__text {
  font-size: var(--text-sm);
  color: var(--color-text);
  flex: 1;
}

.shopping-item__qty {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: var(--weight-medium);
}

/* =============================================
   CONTACTS CONTENT — avatar row
   ============================================= */
.contacts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.contact-chip {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md) var(--space-xs) var(--space-xs);
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  transition:
    background-color var(--transition-fast),
    transform var(--transition-fast);
}

.contact-chip:active {
  background: rgba(255, 255, 255, 0.85);
  transform: scale(0.98);
}

.contact-chip__avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--accent-sky-light);
  color: var(--accent-sky);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  flex-shrink: 0;
}

.contact-chip__info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.contact-chip__name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}

.contact-chip__rel {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.contact-chip__action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: rgba(91, 155, 213, 0.08);
  transition:
    background-color var(--transition-fast),
    transform var(--transition-fast);
}

.contact-chip__action:hover {
  background: rgba(91, 155, 213, 0.16);
}

.contact-chip__action:active {
  transform: scale(0.88);
}

/* =============================================
   NOTES CONTENT
   ============================================= */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.note-item {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: var(--leading-normal);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid rgba(212, 168, 67, 0.06);
}

.note-item:last-child {
  border-bottom: none;
}

/* =============================================
   TASKS CONTENT
   ============================================= */
.tasks-today-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.task-today-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xs) 0;
}

.task-today-item--overdue {
  opacity: 1;
}

.task-today-item__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.task-today-item__dot--magnolia { background: var(--color-magnolia); }
.task-today-item__dot--casa { background: var(--color-casa); }
.task-today-item__dot--doyou { background: var(--color-doyou); }

.task-today-item__text {
  font-size: var(--text-sm);
  color: var(--color-text);
  flex: 1;
}

.task-today-item__due {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.task-today-item--overdue .task-today-item__due {
  color: var(--color-danger);
  font-weight: var(--weight-medium);
}

/* =============================================
   SUGGESTION CARD — Sugestão do Linus
   Lavender gradient · Light and Dark mode
   ============================================= */
.card-suggestion {
  background: linear-gradient(135deg, #EDE6FA 0%, #DDD2F0 50%, #CBBFE8 100%) !important;
  border: 1px solid rgba(139, 126, 200, 0.15) !important;
}

[data-theme="dark"] .card-suggestion {
  background: linear-gradient(135deg, #2A2545 0%, #1E1A38 50%, #252042 100%) !important;
  border: 1px solid rgba(155, 138, 191, 0.2) !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card-suggestion {
    background: linear-gradient(135deg, #2A2545 0%, #1E1A38 50%, #252042 100%) !important;
    border: 1px solid rgba(155, 138, 191, 0.2) !important;
  }
}

.card-suggestion .dash-card__title {
  color: var(--accent-lavender);
  font-weight: var(--weight-bold);
}

.card-suggestion .dash-card__badge {
  display: none;
}

.suggestion-text {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: var(--leading-relaxed);
  font-style: italic;
}

/* =============================================
   WAKE WORD INDICATOR
   ============================================= */
.wake-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  margin: 0 var(--space-xl) var(--space-md);
  border-radius: var(--radius-full);
  background: var(--accent-lavender-bg);
  font-size: var(--text-xs);
  color: var(--accent-lavender);
  font-weight: var(--weight-medium);
}

.wake-indicator__dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--accent-lavender);
  animation: wakePulse 2s ease-in-out infinite;
}

@keyframes wakePulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}
