/* ═══════════════════════════════════════════════════════════
   EXERCISE TAB — Stitch Design (Coby Care Reference)
   Full Stitch overrides: Hero, Bento Grid, Cards, Tip
   ═══════════════════════════════════════════════════════════ */

/* ── Material Symbols base ── */
#tabExercise .material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ── Hero Banner ── */
.ex-hero {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: #2DA89B;
    padding: 32px 28px;
    color: #fff;
    margin-bottom: 32px;
}
.ex-hero-content {
    position: relative;
    z-index: 2;
}
.ex-hero-eyebrow {
    font-size: 15px;
    font-weight: 600;
    opacity: 0.8;
    margin-bottom: 8px;
}
.ex-hero-title {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
}
.ex-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
}
.ex-hero-blur1 {
    position: absolute;
    top: -80px; right: -80px;
    width: 240px; height: 240px;
    background: rgba(253,130,105,0.15);
    border-radius: 50%;
    filter: blur(60px);
}
.ex-hero-blur2 {
    position: absolute;
    bottom: -40px; right: -40px;
    width: 120px; height: 120px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    filter: blur(40px);
}

/* ── Section Header ── */
.ex-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
}
.ex-section-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--ap-text, #1a1c1b);
    letter-spacing: -0.5px;
}
.ex-section-subtitle {
    font-size: 15px;
    color: var(--ap-text-muted, #6e7979);
    margin-top: 4px;
}
.ex-section-link {
    font-size: 15px;
    font-weight: 700;
    color: #2DA89B;
    cursor: pointer;
    white-space: nowrap;
}

/* ── Bento Grid ── */
.ex-bento-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

/* ── Featured Card (col-span-2) ── */
.ex-card-featured {
    grid-column: span 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f4f4f1;
    padding: 20px 24px;
    border-radius: 20px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}
.ex-card-featured:active {
    background: #eeeee9;
}
[data-theme="dark"] .ex-card-featured {
    background: var(--ap-surface-1);
}
.ex-card-featured-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ── Secondary Featured Card (col-span-2, Soft Teal) ── */
.ex-card-secondary {
    grid-column: span 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #E5F5F2;
    padding: 20px 24px;
    border-radius: 20px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}
.ex-card-secondary:active {
    background: #c8ecec;
}
[data-theme="dark"] .ex-card-secondary {
    background: rgba(13,115,119,0.12);
}

/* ── Icon Boxes ── */
.ex-icon-box {
    width: 48px; height: 48px;
    background: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.ex-icon-box .material-symbols-outlined {
    font-size: 26px;
    color: #2DA89B;
}
.ex-icon-box-lg {
    width: 56px; height: 56px;
    border-radius: 16px;
}
.ex-icon-box-lg .material-symbols-outlined {
    font-size: 30px;
}
.ex-icon-box-secondary {
    background: rgba(255,255,255,0.6);
}
.ex-icon-box-secondary .material-symbols-outlined {
    color: #2DA89B;
}

/* ── Icon Circle (small cards) ── */
.ex-icon-circle {
    width: 48px; height: 48px;
    background: #f4f4f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.ex-icon-circle .material-symbols-outlined {
    font-size: 24px;
    color: #2DA89B;
}
[data-theme="dark"] .ex-icon-circle {
    background: var(--ap-surface-2, #333);
}

/* ── Play Button ── */
.ex-play-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(13,115,119,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
.ex-play-btn .material-symbols-outlined {
    font-size: 22px;
    color: #2DA89B;
}
.ex-card-featured:hover .ex-play-btn {
    background: #2DA89B;
}
.ex-card-featured:hover .ex-play-btn .material-symbols-outlined {
    color: #fff;
}

/* ── Chevron (secondary card) ── */
.ex-chevron-secondary {
    font-size: 24px !important;
    color: #2DA89B;
}

/* ── Small Cards (2-col) ── */
.ex-card-small {
    background: #fff;
    padding: 20px 16px;
    border-radius: 20px;
    border-bottom: 4px solid rgba(13,115,119,0.08);
    cursor: pointer;
    position: relative;
    transition: transform 0.15s, border-color 0.2s;
}
.ex-card-small:active {
    transform: scale(0.97);
    border-bottom-color: #2DA89B;
}
[data-theme="dark"] .ex-card-small {
    background: var(--ap-surface-1);
    border-bottom-color: rgba(13,115,119,0.15);
}

/* ── Card Text ── */
.ex-card-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--ap-text, #1a1c1b);
    margin: 0;
}
.ex-card-name-lg {
    font-size: 20px;
    font-weight: 700;
    color: var(--ap-text, #1a1c1b);
    margin: 0;
}
.ex-card-desc {
    font-size: 14px;
    color: var(--ap-text-muted, #6e7979);
    margin-top: 4px;
}
.ex-card-desc-secondary {
    font-size: 14px;
    color: #0a5e61;
    margin-top: 4px;
}
.ex-card-secondary .ex-card-name-lg {
    color: #1A7D74;
}

/* ── Locked state ── */
.ex-card-locked {
    opacity: 0.55;
}
.ex-premium-badge {
    position: absolute;
    top: 8px; right: 8px;
    font-size: 9px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #2DA89B, #0a5e61);
    padding: 3px 8px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

/* ── Tip Card ── */
.ex-tip-card {
    background: #f4f4f1;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}
[data-theme="dark"] .ex-tip-card {
    background: var(--ap-surface-1);
}
.ex-tip-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ap-text, #1a1c1b);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.ex-tip-text {
    font-size: 15px;
    color: var(--ap-text-muted, #6e7979);
    line-height: 1.7;
    position: relative;
    z-index: 2;
}
.ex-tip-deco {
    position: absolute;
    bottom: -8px; right: -8px;
    opacity: 0.04;
}
.ex-tip-deco .material-symbols-outlined {
    font-size: 96px;
}

/* ── Exercise Category/Detail Modals ── */
#exerciseCatModal > div {
    border-radius: 28px 28px 0 0 !important;
    background: var(--ap-bg) !important;
}
#exerciseDetailModal > div,
.ex-detail-modal {
    border-radius: 28px 28px 0 0 !important;
}
/* Close button row stays visible on scroll */
#exerciseCatModal > div > div:first-child,
#exerciseDetailModal > div > div:first-child {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background: var(--ap-card) !important;
    padding-top: 16px !important;
    padding-bottom: 12px !important;
    margin-bottom: 8px !important;
}
[data-theme="dark"] #exerciseCatModal > div > div:first-child,
[data-theme="dark"] #exerciseDetailModal > div > div:first-child {
    background: var(--ap-surface-1) !important;
}
#exerciseSessionOverlay {
    background: var(--ap-bg) !important;
}

/* ── Stagger Animation ── */
#tabExercise .ex-hero,
#tabExercise #todayExerciseSection,
#tabExercise .ex-tip-card,
#tabExercise #exerciseLibrarySection {
    opacity: 0;
    transform: translateY(16px);
    animation: exStagger 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
#tabExercise .ex-hero { animation-delay: 0ms; }
#tabExercise #todayExerciseSection { animation-delay: 80ms; }
#tabExercise .ex-tip-card { animation-delay: 160ms; }
#tabExercise #exerciseLibrarySection { animation-delay: 240ms; }

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

/* ── Bento item stagger ── */
.ex-bento-grid > * {
    opacity: 0;
    transform: translateY(12px);
    animation: exItemIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.ex-bento-grid > *:nth-child(1) { animation-delay: 100ms; }
.ex-bento-grid > *:nth-child(2) { animation-delay: 160ms; }
.ex-bento-grid > *:nth-child(3) { animation-delay: 220ms; }
.ex-bento-grid > *:nth-child(4) { animation-delay: 280ms; }
.ex-bento-grid > *:nth-child(5) { animation-delay: 340ms; }
.ex-bento-grid > *:nth-child(6) { animation-delay: 400ms; }
.ex-bento-grid > *:nth-child(7) { animation-delay: 460ms; }
.ex-bento-grid > *:nth-child(8) { animation-delay: 520ms; }
.ex-bento-grid > *:nth-child(9) { animation-delay: 580ms; }
.ex-bento-grid > *:nth-child(10) { animation-delay: 640ms; }

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