/* ==========================================================================
   Practice Home Widget — Hub/Navigation Entry Point
   ========================================================================== */

.practice-home-root {
    --ph-blue: #185FA5;
    --ph-green: #3B6D11;
    --ph-amber: #854F0B;
    --ph-grey: #CBD5E0;
    --ph-text: #1A202C;
    --ph-text-muted: #718096;
    --ph-card-bg: #FFFFFF;
    --ph-border-radius: 12px;
}

/* --------------------------------------------------------------------------
   Container
   -------------------------------------------------------------------------- */

.practice-home-root .practice-home-container {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Welcome Section
   -------------------------------------------------------------------------- */

.practice-home-root .practice-home-welcome {
    padding: 8px 0 6px;
    text-align: center;
}

.practice-home-root .practice-home-welcome-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--ph-text);
    margin: 0 0 2px;
    line-height: 1.2;
}

.practice-home-root .practice-home-welcome-subtitle {
    font-size: 13px;
    color: var(--ph-text-muted);
    margin: 0;
    line-height: 1.3;
}

.practice-home-root .practice-home-streak {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 4px 10px;
    background: #FFF8E1;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ph-amber);
}

.practice-home-root .practice-home-streak-flame {
    font-size: 16px;
}

/* --------------------------------------------------------------------------
   Tier Section
   -------------------------------------------------------------------------- */

.practice-home-root .practice-home-tier {
    margin-bottom: 4px;
}

.practice-home-root .practice-home-tier-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

.practice-home-root .practice-home-tier-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    color: #fff;
}

.practice-home-root .practice-home-tier-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ph-text);
}

.practice-home-root .practice-home-tier-lock {
    font-size: 13px;
    margin-left: auto;
}

/* --------------------------------------------------------------------------
   Carousel Strip
   -------------------------------------------------------------------------- */

.practice-home-root .practice-home-carousel {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    scrollbar-width: none;
}

.practice-home-root .practice-home-carousel::-webkit-scrollbar {
    display: none;
}

/* --------------------------------------------------------------------------
   Exercise Card
   -------------------------------------------------------------------------- */

.practice-home-root .practice-home-card {
    min-width: 110px;
    max-width: 110px;
    scroll-snap-align: start;
    border-radius: var(--ph-border-radius);
    border: 2px solid var(--ph-grey);
    padding: 8px 6px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    background: var(--ph-card-bg);
    flex-shrink: 0;
    min-height: 44px;
    transition: transform 0.15s ease;
    box-sizing: border-box;
}

.practice-home-root a.practice-home-card:hover {
    transform: translateY(-2px);
}

.practice-home-root a.practice-home-card:focus-visible {
    outline: 3px solid var(--ph-blue);
    outline-offset: 2px;
}

.practice-home-root .practice-home-card-emoji {
    font-size: 22px;
    line-height: 1;
}

.practice-home-root .practice-home-card-label {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    min-height: 14px;
    display: flex;
    align-items: center;
}

.practice-home-root .practice-home-accuracy-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.practice-home-root .practice-home-accuracy {
    font-size: 12px;
    font-weight: 700;
}

.practice-home-root .practice-home-accuracy-locked {
    color: var(--ph-text-muted);
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   Progress Bar
   -------------------------------------------------------------------------- */

.practice-home-root .practice-home-progress-track {
    width: 100%;
    height: 3px;
    background: #EDF2F7;
    border-radius: 2px;
    overflow: hidden;
    margin: 1px 0;
}

.practice-home-root .practice-home-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* --------------------------------------------------------------------------
   Strong Badge
   -------------------------------------------------------------------------- */

.practice-home-root .practice-home-strong-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--ph-green);
}

/* --------------------------------------------------------------------------
   Locked States
   -------------------------------------------------------------------------- */

.practice-home-root .practice-home-card.is-locked {
    opacity: 0.45;
    background: #F7FAFC;
    cursor: default;
    pointer-events: none;
}

.practice-home-root .is-locked-tier .practice-home-tier-label {
    color: var(--ph-text-muted);
}

/* --------------------------------------------------------------------------
   CTA Button
   -------------------------------------------------------------------------- */

.practice-home-root .practice-home-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--ph-border-radius);
    background: var(--ph-blue);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    min-height: 44px;
    margin-top: 10px;
    box-sizing: border-box;
    transition: background-color 0.15s ease;
}

.practice-home-root .practice-home-cta:hover {
    background: #134B84;
}

.practice-home-root .practice-home-cta:focus-visible {
    outline: 3px solid var(--ph-blue);
    outline-offset: 2px;
}

.practice-home-root .practice-home-cta-arrow {
    margin-left: 4px;
}

/* --------------------------------------------------------------------------
   Loading Skeleton
   -------------------------------------------------------------------------- */

.practice-home-root .practice-home-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 0;
}

.practice-home-root .skeleton-block {
    background: linear-gradient(90deg, #EDF2F7 25%, #E2E8F0 50%, #EDF2F7 75%);
    background-size: 200% 100%;
    animation: ph-shimmer 1.5s infinite;
    border-radius: 8px;
}

.practice-home-root .skeleton-welcome {
    height: 80px;
}

.practice-home-root .skeleton-tier {
    height: 120px;
}

.practice-home-root .skeleton-cta {
    height: 48px;
}

@keyframes ph-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --------------------------------------------------------------------------
   Error State
   -------------------------------------------------------------------------- */

.practice-home-root .practice-home-error {
    text-align: center;
    padding: 40px 16px;
    color: var(--ph-text-muted);
}

/* --------------------------------------------------------------------------
   Elementor Preview
   -------------------------------------------------------------------------- */

.practice-home-root.elementor-preview .practice-home-preview {
    padding: 20px;
    background: #F7FAFC;
    border: 2px dashed #CBD5E0;
    border-radius: 8px;
    text-align: center;
}

.practice-home-root.elementor-preview .preview-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.practice-home-root.elementor-preview .preview-header h3 {
    margin: 0;
    font-size: 18px;
}

.practice-home-root.elementor-preview .preview-badge {
    background: var(--ph-blue);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.practice-home-root.elementor-preview .preview-settings {
    text-align: left;
    font-size: 13px;
    color: var(--ph-text-muted);
}

.practice-home-root.elementor-preview .preview-settings ul {
    margin: 4px 0 0;
    padding-left: 20px;
}

/* --------------------------------------------------------------------------
   Responsive — Tablet+
   -------------------------------------------------------------------------- */

@media (min-width: 768px) {
    .practice-home-root .practice-home-container {
        padding: 24px;
    }

    .practice-home-root .practice-home-welcome-title {
        font-size: 26px;
    }

    .practice-home-root .practice-home-card {
        min-width: 120px;
        max-width: 120px;
    }
}

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .practice-home-root .practice-home-progress-fill {
        transition: none;
    }

    .practice-home-root .practice-home-card {
        transition: none;
    }

    .practice-home-root .practice-home-cta {
        transition: none;
    }

    .practice-home-root .skeleton-block {
        animation: none;
        background: #EDF2F7;
    }
}
