/* ============================================================
   EMM Features CSS v3.0 — Extra styles for new features
   ============================================================ */

/* ── Tip Bar ── */
.emm-tip-bar {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #6ee7b7;
  border-left: 4px solid #10b981;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: #065f46;
  margin-bottom: 20px;
}
[data-emm-theme="dark"] .emm-tip-bar {
  background: #022c22;
  border-color: #065f46;
  color: #6ee7b7;
}

/* ── Heatmap Grid ── */
.emm-heatmap {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
  margin: 12px 0;
}
.emm-heatmap-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s;
}
.emm-heatmap-cell:hover { transform: scale(1.15); z-index: 1; }
.emm-heatmap-cell .emm-heatmap-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #e2e8f0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 99;
  pointer-events: none;
}
.emm-heatmap-cell:hover .emm-heatmap-tip { display: block; }

/* ── Trophy Room ── */
.emm-trophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.emm-trophy-item {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 2px solid #fbbf24;
  border-radius: 12px;
  padding: 20px 14px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.emm-trophy-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(251,191,36,0.3);
}
.emm-trophy-item.emm-trophy-locked {
  background: #f8fafc;
  border-color: #e2e8f0;
  opacity: 0.5;
  filter: grayscale(1);
}
.emm-trophy-icon { font-size: 36px; line-height: 1; }
.emm-trophy-name { font-size: 12px; font-weight: 700; color: #92400e; margin-top: 6px; }
.emm-trophy-date { font-size: 10px; color: #b45309; margin-top: 3px; }
[data-emm-theme="dark"] .emm-trophy-item {
  background: linear-gradient(135deg, #451a03, #78350f);
  border-color: #d97706;
}
[data-emm-theme="dark"] .emm-trophy-name { color: #fde68a; }

/* ── Health Score Bar ── */
.emm-health-ring {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px;
}
.emm-health-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 28px;
  font-weight: 900;
  border: 6px solid currentColor;
  flex-shrink: 0;
}
.emm-health-factors { flex: 1; }
.emm-health-factor {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--emm-border);
  font-size: 13px;
}
.emm-health-factor:last-child { border-bottom: none; }

/* ── Sparkline ── */
.emm-sparkline-wrap { overflow-x: auto; }
.emm-sparkline canvas { display: block; }

/* ── Prediction Card ── */
.emm-predict-card {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #93c5fd;
  border-radius: 12px;
  padding: 20px;
}
[data-emm-theme="dark"] .emm-predict-card {
  background: linear-gradient(135deg, #1e3a5f, #1e40af33);
  border-color: #1d4ed8;
}
.emm-predict-value { font-size: 32px; font-weight: 900; color: #1d4ed8; }
.emm-predict-trend-up   { color: #ef4444; }
.emm-predict-trend-down { color: #22c55e; }
.emm-predict-trend-stable { color: #64748b; }

/* ── Receipt animation ── */
@keyframes emmSlideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.emm-receipt-animated { animation: emmSlideDown 0.4s ease; }

/* ── Live Bill Calculator ── */
.emm-livecalc {
  background: var(--emm-card-bg);
  border: 2px solid var(--emm-primary);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 4px 20px rgba(14,165,233,0.12);
}
.emm-livecalc-result {
  font-size: 36px;
  font-weight: 900;
  color: var(--emm-primary);
  text-align: center;
  margin: 16px 0;
  transition: all 0.3s;
}

/* ── WhatsApp share ── */
.emm-whatsapp-btn {
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.emm-whatsapp-btn:hover { background: #128c7e; color: #fff; }

/* ── QR Code ── */
.emm-qr-wrap {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--emm-border);
  border-radius: 10px;
  padding: 12px;
}

/* ── Year comparison ── */
.emm-compare-legend {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
}
.emm-compare-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 4px;
}

/* ── Mini game ── */
.emm-game-container {
  background: #0f172a;
  border-radius: 12px;
  padding: 20px;
  color: #e2e8f0;
  text-align: center;
  font-family: 'Courier New', monospace;
  user-select: none;
}
.emm-game-board {
  display: grid;
  gap: 4px;
  margin: 16px auto;
  width: fit-content;
}
.emm-game-cell {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid #334155;
  background: #1e293b;
}
.emm-game-cell:hover { background: #334155; border-color: #0ea5e9; }
.emm-game-cell.matched { background: #14532d; border-color: #22c55e; animation: emm-pop 0.3s; }
@keyframes emm-pop { 0%{transform:scale(1)}50%{transform:scale(1.3)}100%{transform:scale(1)} }

/* ── Voice command ── */
.emm-voice-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--emm-primary);
  color: #fff;
  border: none;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(14,165,233,0.4);
  transition: all 0.2s;
}
.emm-voice-btn:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(14,165,233,0.6); }
.emm-voice-btn.listening {
  background: #ef4444;
  animation: emm-pulse 1s infinite;
}
@keyframes emm-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50%      { box-shadow: 0 0 0 12px rgba(239,68,68,0); }
}

/* ── Auto-refresh badge ── */
.emm-refresh-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #dcfce7;
  color: #15803d;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
}
[data-emm-theme="dark"] .emm-refresh-badge { background: #14532d; color: #86efac; }

/* ── Leaderboard podium animation ── */
@keyframes emm-rise {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.emm-lb-podium > div {
  animation: emm-rise 0.5s ease forwards;
}
.emm-lb-podium > div:nth-child(1) { animation-delay: 0.1s; }
.emm-lb-podium > div:nth-child(2) { animation-delay: 0.2s; }
.emm-lb-podium > div:nth-child(3) { animation-delay: 0.3s; }

/* ── Dark/Light toggle button ── */
#emm-dark-toggle {
  font-size: 18px;
  padding: 6px 12px;
  line-height: 1;
}

/* ── Animated counter ── */
.emm-counter { display: inline-block; }

/* ── Carbon badge ── */
.emm-carbon-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #dcfce7;
  color: #15803d;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
}
.emm-carbon-badge.high { background: #fef2f2; color: #dc2626; }
.emm-carbon-badge.medium { background: #fefce8; color: #92400e; }
[data-emm-theme="dark"] .emm-carbon-badge { background: #14532d; color: #86efac; }
