/* ═══════════════════════════════════════════════════════════
   RECORD TAB — Stitch Design v2 (Focused Layout)
   3-tier: Journey Hero → This Week → History
   ═══════════════════════════════════════════════════════════ */

#tabRecord .material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ══ Section 1: Recovery Journey Hero ══ */
.rc-journey-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding: 4px 0;
}
.rc-journey-gauge {
    position: relative;
    width: 110px; height: 110px;
    flex-shrink: 0;
}
.rc-gauge-svg {
    width: 110px; height: 110px;
}
.rc-gauge-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.rc-gauge-week {
    font-size: 32px;
    font-weight: 900;
    color: #2DA89B;
    letter-spacing: -1px;
    line-height: 1;
}
.rc-gauge-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ap-text-muted, #6e7979);
    margin-top: 2px;
}
.rc-journey-info {
    flex: 1;
}
.rc-journey-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--ap-text, #1a1c1b);
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}
.rc-journey-sub {
    font-size: 15px;
    color: var(--ap-text-muted, #6e7979);
    margin-bottom: 10px;
}
.rc-journey-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
}
.rc-stat {
    color: #2DA89B;
}
.rc-stat-dot {
    color: var(--ap-text-muted, #6e7979);
}

/* ══ Section 2: Attendance (compact) ══ */
.rc-attendance-section {
    margin-bottom: 20px;
}
.rc-attendance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.rc-attendance-title-sm {
    font-size: 16px;
    font-weight: 800;
    color: var(--ap-text, #1a1c1b);
    letter-spacing: -0.3px;
}
.rc-streak-badge {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #2DA89B !important;
}
.rc-sticker-board-compact {
    background: #f4f4f1;
    border-radius: 16px;
    padding: 14px 16px;
}
[data-theme="dark"] .rc-sticker-board-compact {
    background: var(--ap-surface-1);
}

/* ══ Section 3: Checkin Hero (teal gradient) ══ */
.rc-checkin-hero {
    position: relative !important;
    overflow: hidden !important;
    border-radius: 24px !important;
    background: linear-gradient(135deg, #1E8F85, #2DA89B) !important;
    padding: 28px 24px !important;
    margin-bottom: 20px !important;
    color: #fff !important;
    box-shadow: 0 12px 32px rgba(13,115,119,0.18) !important;
}
.rc-checkin-hero-inner {
    position: relative; z-index: 2;
    display: flex; flex-direction: column;
    align-items: flex-start; gap: 6px;
}
.rc-checkin-label {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    padding: 4px 12px; border-radius: 999px;
    font-size: 15px; font-weight: 800;
    letter-spacing: 2px; text-transform: uppercase;
    color: rgba(255,255,255,0.9);
}
.rc-checkin-title {
    font-size: 28px !important; font-weight: 800 !important;
    letter-spacing: -1px !important; color: #fff !important;
    margin: 4px 0 !important;
}
.rc-checkin-desc {
    font-size: 15px !important;
    color: rgba(255,255,255,0.7) !important;
    line-height: 1.5 !important; max-width: 220px;
}
.rc-checkin-btn {
    display: flex !important; align-items: center !important; gap: 8px !important;
    margin-top: 10px !important; padding: 12px 24px !important;
    background: #E5F5F2 !important; color: #1A7D74 !important;
    border: none !important; border-radius: 999px !important;
    font-size: 14px !important; font-weight: 700 !important;
    cursor: pointer !important;
    transition: transform 0.15s !important;
}
.rc-checkin-btn:active { transform: scale(0.95) !important; }
.rc-checkin-deco {
    position: absolute; right: -20px; bottom: -20px;
    opacity: 0.1; z-index: 1;
}
.rc-checkin-deco .material-symbols-outlined {
    font-size: 160px; color: #fff;
}

/* Hide old inner elements */
#recordCheckinCard > div[style*="display:flex"][style*="justify-content:space-between"],
#recordCheckinCard > div[style*="font-size:13px"][style*="color:var(--ap-text-secondary)"],
#recordCheckinCard > button[onclick="openCheckin()"],
#recordCheckinCard > div[style*="margin-top:8px"] { display: none !important; }
#recordCheckinStatus { display: none !important; }

/* ══ Section 4: Before/After ══ */
#beforeAfterContainer {
    border-radius: 20px !important;
}
#beforeAfterContainer > div {
    background: #fff !important;
    border-radius: 20px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04) !important;
}
[data-theme="dark"] #beforeAfterContainer > div {
    background: var(--ap-surface-1) !important;
}

/* ══ Section 5: Pain Trend ══ */
#tabRecord #painTrendCard {
    background: #fff !important;
    border-radius: 20px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04) !important;
}
[data-theme="dark"] #tabRecord #painTrendCard {
    background: var(--ap-surface-1) !important;
}

/* ══ Section 6: Gamification (Challenges + Badges) ══ */
.rc-gamification-section {
    margin-bottom: 20px;
}
.rc-gamification-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 12px;
}
.rc-gamification-title {
    font-size: 16px; font-weight: 800;
    color: var(--ap-text, #1a1c1b);
    letter-spacing: -0.3px;
}
#activeChallengeContainer > div {
    border-radius: 16px !important;
}

/* ══ Section 7: Health Data ══ */
.rc-health-section { margin-bottom: 10px; }
.rc-health-header {
    display: flex; align-items: center; gap: 8px;
}
.rc-health-icon { font-size: 20px !important; color: #2DA89B; }
.rc-health-title {
    font-size: 16px; font-weight: 800;
    color: var(--ap-text, #1a1c1b);
    letter-spacing: -0.3px;
}
#tabRecord #healthDashboard {
    background: #fff !important;
    border-radius: 20px !important;
    padding: 20px !important;
    margin-bottom: 16px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04) !important;
}
[data-theme="dark"] #tabRecord #healthDashboard {
    background: var(--ap-surface-1) !important;
}

/* ══ Stagger Animation ══ */
#tabRecord > section,
#tabRecord > div[id]:not([style*="display:none"]):not([style*="display: none"]) {
    opacity: 0;
    transform: translateY(16px);
    animation: rcStagger 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
#tabRecord > *:nth-child(1) { animation-delay: 0ms; }
#tabRecord > *:nth-child(2) { animation-delay: 60ms; }
#tabRecord > *:nth-child(3) { animation-delay: 120ms; }
#tabRecord > *:nth-child(4) { animation-delay: 180ms; }
#tabRecord > *:nth-child(5) { animation-delay: 240ms; }
#tabRecord > *:nth-child(6) { animation-delay: 300ms; }
#tabRecord > *:nth-child(7) { animation-delay: 360ms; }
#tabRecord > *:nth-child(8) { animation-delay: 420ms; }
#tabRecord > *:nth-child(9) { animation-delay: 480ms; }

@keyframes rcStagger {
    to { opacity: 1; transform: translateY(0); }
}
