/* ===== Life Progress - Modern Styles ===== */

/* Layout */
.lp-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.lp-main { min-width: 0; }
.lp-card {
  background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 18px;
  padding: 32px; box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.lp-sidebar { display: flex; flex-direction: column; gap: 20px; }

/* Form */
.lp-form { margin-bottom: 8px; }
.lp-form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.lp-form-group { display: flex; flex-direction: column; gap: 6px; }
.lp-form-group label { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.lp-form-group input, .lp-form-group select {
  padding: 10px 14px; border: 2px solid var(--border-light); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: var(--bg); color: var(--text); outline: none;
  transition: border-color 0.2s;
}
.lp-form-group input:focus, .lp-form-group select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.lp-btn {
  padding: 10px 22px; border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), #8b5cf6); color: #fff;
  font-size: 14px; font-weight: 700; font-family: inherit;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 12px rgba(79,70,229,0.3); transition: transform 0.2s, box-shadow 0.2s;
}
.lp-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(79,70,229,0.4); }
.lp-btn:active { transform: translateY(0); }

/* Hero stats */
.lp-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
.lp-hero-item {
  text-align: center; padding: 18px 12px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(99,102,241,0.10), rgba(99,102,241,0.03));
  border: 1px solid rgba(99,102,241,0.10);
}
.lp-hero-val { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1.2; }
.lp-hero-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Sections */
.lp-section { margin-bottom: 24px; }
.lp-section:last-child { margin-bottom: 0; }
.lp-section-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
  font-size: 15px; font-weight: 800; color: var(--text);
}
.lp-section-title i { color: var(--primary); font-size: 14px; }

/* Main life progress */
.lp-main-progress { }
.lp-mp-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.lp-mp-pct { font-size: 32px; font-weight: 800; color: var(--primary); }
.lp-mp-detail { font-size: 13px; color: var(--text-muted); }
.lp-mp-bar { height: 16px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.lp-mp-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Live section */
.lp-live-section { background: var(--bg-soft); border-radius: 14px; padding: 16px; }
.lp-live-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lp-live-item { display: flex; align-items: center; gap: 10px; }
.lp-live-item i { font-size: 18px; color: var(--primary); width: 24px; text-align: center; }
.lp-live-val { font-size: 18px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.lp-live-label { font-size: 12px; color: var(--text-muted); }

/* Life in Weeks grid */
.lp-grid-wrap { }
.lp-grid-legend { display: flex; gap: 18px; margin-bottom: 10px; font-size: 12px; color: var(--text-muted); }
.lp-grid-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lp-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lp-dot.lived { background: linear-gradient(135deg, #6366f1, #ec4899); }
.lp-dot.remaining { background: var(--border); }
.lp-grid {
  display: grid; grid-template-columns: repeat(52, 1fr); gap: 2px;
  background: var(--bg-soft); padding: 10px; border-radius: 10px;
}
.lp-cell { width: 100%; aspect-ratio: 1; border-radius: 2px; background: var(--border); transition: transform 0.15s; }
.lp-cell.lived { background: linear-gradient(135deg, #6366f1, #ec4899); }
.lp-cell.current { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,0.4); animation: pulse 1.5s infinite; }
.lp-cell:hover { transform: scale(1.5); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
.lp-grid-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--text-muted); }

/* Time progress bars */
.lp-bars { display: flex; flex-direction: column; gap: 14px; }
.lp-bar-item { }
.lp-bar-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.lp-bar-head span:last-child { color: var(--primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.lp-bar { height: 10px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.lp-bar-fill { height: 100%; border-radius: 999px; transition: width 0.6s ease; }
.lp-bar-fill.day { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.lp-bar-fill.week { background: linear-gradient(90deg, #10b981, #14b8a6); }
.lp-bar-fill.month { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.lp-bar-fill.year { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

/* Fun stats */
.lp-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.lp-stat {
  text-align: center; padding: 16px 10px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(99,102,241,0.08), rgba(255,255,255,0.02));
  border: 1px solid var(--border-light);
}
.lp-stat i { font-size: 18px; color: var(--primary); margin-bottom: 8px; display: block; }
.lp-stat-num { display: block; font-size: 18px; font-weight: 800; color: var(--text); line-height: 1.2; font-variant-numeric: tabular-nums; }
.lp-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: block; }

/* Life stages */
.lp-stages { display: flex; flex-direction: column; gap: 10px; }
.lp-stage { display: flex; align-items: center; gap: 12px; }
.lp-stage-name { width: 100px; font-size: 13px; font-weight: 600; color: var(--text-secondary); flex-shrink: 0; }
.lp-stage-bar { flex: 1; height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.lp-stage-fill { height: 100%; border-radius: 999px; transition: width 0.6s ease; }
.lp-stage-status { width: 60px; text-align: right; font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

/* Error */
.error-msg { margin-top: 12px; padding: 12px 16px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; color: #dc2626; font-size: 13px; font-weight: 500; display: none; }

/* Sidebar shared */
.sidebar-section { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 16px; padding: 20px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); }
.sidebar-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.sidebar-title i { color: var(--primary); font-size: 0.9rem; }
.sidebar-tools { display: flex; flex-direction: column; gap: 8px; }
.sidebar-tool { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; transition: all 0.2s ease; text-decoration: none; background: var(--bg-soft); }
.sidebar-tool:hover { background: var(--primary-50); transform: translateX(3px); }
.sidebar-tool-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 16px; flex-shrink: 0; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }
.sidebar-tool-info { flex: 1; min-width: 0; }
.sidebar-tool-name { font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.sidebar-tool-desc { font-size: 0.78rem; color: var(--text-muted); }
.ad-placeholder { width: 300px; height: 250px; flex-shrink: 0; margin: 0 auto; background: var(--bg-card); border: 2px dashed var(--border); border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; color: var(--text-muted); font-size: 0.82rem; line-height: 1.5; }
.ad-placeholder .ad-icon { font-size: 1.8rem; color: var(--text-muted); margin-bottom: 10px; opacity: 0.4; }
.ad-placeholder .ad-label { font-weight: 600; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.ad-placeholder .ad-size { font-size: 0.75rem; color: var(--text-muted); opacity: 0.6; }

/* Dark mode */
body[data-theme="dark"] .lp-card { background: var(--bg-card); border-color: var(--border); }
body[data-theme="dark"] .lp-form-group input, body[data-theme="dark"] .lp-form-group select { background: var(--bg-muted); border-color: var(--border); }
body[data-theme="dark"] .lp-hero-item { background: linear-gradient(180deg, rgba(99,102,241,0.16), rgba(99,102,241,0.05)); border-color: rgba(99,102,241,0.20); }
body[data-theme="dark"] .lp-live-section { background: var(--bg-muted); }
body[data-theme="dark"] .lp-grid { background: var(--bg-muted); }
body[data-theme="dark"] .lp-cell { background: var(--border); }
body[data-theme="dark"] .lp-mp-bar, body[data-theme="dark"] .lp-bar, body[data-theme="dark"] .lp-stage-bar { background: var(--bg-muted); }
body[data-theme="dark"] .lp-stat { background: linear-gradient(180deg, rgba(99,102,241,0.14), rgba(255,255,255,0.02)); border-color: var(--border); }
body[data-theme="dark"] .sidebar-section { background: var(--bg-card); border-color: var(--border); }
body[data-theme="dark"] .sidebar-tool { background: var(--bg-muted); }
body[data-theme="dark"] .ad-placeholder { background: var(--bg-card); border-color: var(--border); }
body[data-theme="dark"] .error-msg { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #fca5a5; }

/* ===== calc-bottom Styles (shared pattern) ===== */
.calc-bottom { padding: 12px 0 56px; }
.calc-bottom-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; margin-bottom: 18px; }
.calc-panel { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 16px; box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06); padding: 20px; }
.calc-panel-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 18px; font-weight: 800; color: var(--text); }
.calc-panel-title i { color: var(--primary); }
.calc-panel-lead { margin: 0 0 16px; color: var(--text-muted); line-height: 1.7; }
.calc-feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.calc-feature-card { border-radius: 14px; padding: 14px; background: linear-gradient(180deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.03)); border: 1px solid rgba(99, 102, 241, 0.12); }
.calc-feature-card.accent-green { background: linear-gradient(180deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.03)); border-color: rgba(16, 185, 129, 0.14); }
.calc-feature-card.accent-blue { background: linear-gradient(180deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.03)); border-color: rgba(59, 130, 246, 0.14); }
.calc-feature-card.accent-orange { background: linear-gradient(180deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.03)); border-color: rgba(245, 158, 11, 0.14); }
.calc-feature-card.accent-violet { background: linear-gradient(180deg, rgba(168, 85, 247, 0.12), rgba(168, 85, 247, 0.03)); border-color: rgba(168, 85, 247, 0.14); }
.calc-feature-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; color: #fff; background: linear-gradient(135deg, var(--primary), #8b5cf6); }
.accent-green .calc-feature-icon { background: linear-gradient(135deg, #10b981, #059669); }
.accent-blue .calc-feature-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.accent-orange .calc-feature-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.accent-violet .calc-feature-icon { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.calc-feature-name { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.calc-feature-desc { font-size: 12.5px; line-height: 1.6; color: var(--text-muted); }
.calc-feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; color: var(--text-muted); font-size: 13px; line-height: 1.7; }
.calc-feature-list i { color: #10b981; margin-right: 6px; }
.shortcut-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.shortcut-table thead th { text-align: left; padding: 10px 0; color: var(--text-muted); font-weight: 700; border-bottom: 1px solid var(--border-light); }
.shortcut-table tbody td { padding: 10px 0; border-bottom: 1px solid var(--border-light); color: var(--text); }
.shortcut-table tbody td:first-child { color: var(--primary); font-weight: 700; }
.calc-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.calc-step { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 14px; background: linear-gradient(180deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.03)); }
.calc-step-num { width: 28px; height: 28px; border-radius: 999px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary), #8b5cf6); color: #fff; font-weight: 800; font-size: 13px; }
.calc-step-title { font-weight: 800; color: var(--text); margin-bottom: 4px; }
.calc-step-desc { color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.calc-use-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.calc-use-card { border-radius: 14px; padding: 16px; border: 1px solid var(--border-light); }
.calc-use-card.warm { background: linear-gradient(180deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.03)); }
.calc-use-card.cool { background: linear-gradient(180deg, rgba(168, 85, 247, 0.12), rgba(168, 85, 247, 0.03)); }
.calc-use-card.green { background: linear-gradient(180deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.03)); }
.calc-use-card.amber { background: linear-gradient(180deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.03)); }
.calc-use-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; margin-bottom: 10px; background: linear-gradient(135deg, var(--primary), #8b5cf6); }
.warm .calc-use-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.cool .calc-use-icon { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.green .calc-use-icon { background: linear-gradient(135deg, #10b981, #059669); }
.amber .calc-use-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.calc-use-title { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.calc-use-desc { font-size: 12.5px; line-height: 1.6; color: var(--text-muted); }
.calc-knowledge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.calc-knowledge-card { border-radius: 14px; padding: 16px; background: linear-gradient(180deg, rgba(99, 102, 241, 0.08), rgba(255, 255, 255, 0.04)); border: 1px solid rgba(99, 102, 241, 0.08); }
.calc-knowledge-title { font-weight: 800; color: var(--text); margin-bottom: 8px; }
.calc-knowledge-card p { margin: 0; color: var(--text-muted); line-height: 1.7; font-size: 13px; }
.calc-cta { margin-top: 14px; border-radius: 16px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: linear-gradient(135deg, rgba(99, 102, 241, 0.10), rgba(168, 85, 247, 0.10)); border: 1px solid rgba(99, 102, 241, 0.16); }
.calc-cta-title { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.calc-cta-title i { color: #8b5cf6; margin-right: 8px; }
.calc-cta-text { color: var(--text-muted); line-height: 1.6; font-size: 13px; }
body[data-theme="dark"] .calc-cta, body[data-theme="dark"] .calc-feature-card, body[data-theme="dark"] .calc-use-card, body[data-theme="dark"] .calc-knowledge-card { border-color: var(--border); }

/* ===== Responsive ===== */
@media (max-width: 1024px) { .lp-layout { grid-template-columns: 1fr 280px; gap: 20px; } }
@media (max-width: 860px) {
  .lp-layout { grid-template-columns: 1fr; }
  .lp-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .calc-bottom-grid { grid-template-columns: 1fr; }
  .calc-feature-grid, .calc-steps, .calc-use-grid, .calc-knowledge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .lp-card { padding: 20px; }
  .lp-hero { grid-template-columns: 1fr; }
  .lp-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .lp-grid { gap: 1px; padding: 6px; }
  .lp-cell { border-radius: 1px; }
}
@media (max-width: 640px) {
  .lp-sidebar { grid-template-columns: 1fr; }
  .calc-feature-grid, .calc-steps, .calc-use-grid, .calc-knowledge-grid { grid-template-columns: 1fr; }
  .lp-form-row { flex-direction: column; align-items: stretch; }
  .lp-stage-name { width: 80px; }
}
