/* Muscle Progress System
 * Progress tabs, full-width progress section, muscle diagrams, legend colors.
 */
/* Muscle Progress System */
.progress-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.progress-tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
}

.progress-tab-btn:hover {
    color: var(--primary-color);
    background-color: var(--bg-secondary);
}

.progress-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: var(--bg-secondary);
}

.progress-tab-content {
    display: none;
}

.progress-tab-content.active {
    display: block;
}

.muscle-view-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.muscle-view-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    border-radius: 20px;
    transition: all 0.3s ease;
    min-height: 44px;
    min-width: 60px;
}

.muscle-view-btn:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-color-light);
}

.muscle-view-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.legend-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.legend-toggle-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 16px;
    transition: all 0.3s ease;
    margin-bottom: 5px;
    min-height: 44px;
    min-width: 44px;
}

.legend-toggle-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: var(--primary-color-light);
}

.legend-toggle-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.muscle-progress-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 15px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.2);
}

/* Legend Color Classes */
.legend-color.muscle-improvement-excellent {
    background-color: #00b300;
}

.legend-color.muscle-improvement-good {
    background-color: #66cc00;
}

.legend-color.muscle-improvement-average {
    background-color: #ffcc00;
}

.legend-color.muscle-improvement-declining {
    background-color: #ff6600;
}

.legend-color.muscle-improvement-poor {
    background-color: #cc0000;
}

.legend-color.muscle-no-data {
    background-color: #cccccc;
}

.muscle-diagram-container {
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow: visible;
}

#muscleDiagramWrapper {
    max-width: 100%;
    padding: 0;
    margin: 0;
}

#muscleDiagramWrapper svg {
    width: 100%;
    max-width: 1600px;
    height: auto;
    min-height: 1000px;
}

.muscle-details-panel {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    margin: 0;
}

.muscle-details-panel h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 18px;
}

.muscle-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.muscle-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
}

.muscle-exercises h5 {
    margin: 15px 0 10px 0;
    color: var(--text-primary);
    font-size: 14px;
}

.muscle-exercises ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.muscle-exercises li {
    padding: 8px 12px;
    margin-bottom: 5px;
    background-color: var(--bg-primary);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exercise-progress {
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
}

.exercise-progress.positive {
    background-color: var(--success-color);
    color: white;
}

.exercise-progress.negative {
    background-color: var(--error-color);
    color: white;
}

/* Full-Width Progress Section */
.progress-section-full {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark)) !important;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    color: white !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.progress-section-full * {
    color: white !important;
    background: transparent !important;
}

.progress-section-full .progress-header:hover {
    opacity: 0.9;
}

.progress-section-full::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    background: transparent !important;
}

.progress-section-full .progress-header {
    background: transparent !important;
}

.progress-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-section-full .progress-title i {
    font-size: 24px;
    opacity: 0.9;
    color: white !important;
}

.progress-section-full .progress-title h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: white !important;
}

.progress-title i {
    font-size: 24px;
    opacity: 0.9;
    color: white;
}

.progress-title h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: white;
}

.progress-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-collapse-icon {
    font-size: 18px;
    color: white !important;
    opacity: 0.8;
    transition: transform 0.2s;
}

.progress-main-stat {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.progress-section-full .progress-main-stat .progress-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
    color: white !important;
}

.progress-main-stat .progress-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
    color: white;
}

.progress-section-full .progress-subtitle {
    font-size: 14px;
    opacity: 0.8;
    font-weight: 500;
    color: white !important;
}

.progress-subtitle {
    font-size: 14px;
    opacity: 0.8;
    font-weight: 500;
    color: white;
}

.progress-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr) 2fr;
    gap: 20px;
    align-items: center;
    margin-top: 20px;
}

.progress-section-full .progress-details {
    background: transparent !important;
}

.progress-stat {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-section-full .progress-stat .stat-number {
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    color: white !important;
}

.progress-stat .stat-number {
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
}

.progress-section-full .progress-stat .stat-label {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 500;
    color: white !important;
}

.progress-stat .stat-label {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 500;
}

.progress-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.progress-cta i:first-child {
    font-size: 16px;
}

.progress-cta i:last-child {
    font-size: 12px;
    opacity: 0.7;
}

/* Mobile Responsive */
@media (max-width: 768px) {  
    .progress-section-full {
        background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
        color: white !important;
        padding: 20px !important;
        margin-bottom: 20px !important;
        border-radius: 16px !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
        position: relative !important;
        overflow: hidden !important;
    }
    
    .progress-section-full * {
        color: white !important;
    }
    
    .progress-section-full::before {
        content: '' !important;
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        width: 80px !important;
        height: 80px !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 50% !important;
        transform: translate(20px, -20px) !important;
    }
    
    .progress-header {
        flex-direction: row;
        gap: 12px;
        margin-bottom: 16px;
    }

    .progress-title h2 {
        font-size: 20px;
        color: white !important;
    }

    .progress-header-right {
        margin-left: auto;
    }

    .progress-main-stat {
        align-items: flex-end;
        text-align: right;
    }
    
    .progress-main-stat .progress-value {
        font-size: 28px;
        color: white !important;
    }
    
    .progress-subtitle {
        color: rgba(255, 255, 255, 0.8) !important;
    }
    
    .progress-details {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .progress-cta {
        grid-column: 1 / -1;
        margin-top: 8px;
        padding: 14px 16px;
        font-size: 13px;
    }
    
    .progress-stat .stat-number {
        font-size: 18px;
        color: white !important;
    }
    
    .progress-stat .stat-label {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.8) !important;
    }
    
    .progress-cta {
        background: rgba(255, 255, 255, 0.2) !important;
        color: white !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        backdrop-filter: blur(10px) !important;
        border-radius: 10px !important;
    }
    
    .progress-cta i {
        color: white !important;
    }
}

/* Force white color for progress section stat labels - override all other .stat-label rules */
.progress-section-full .progress-stat .stat-label,
.progress-section-full .stat-label,
div.progress-section-full div.progress-stat span.stat-label {
    color: white !important;
    opacity: 0.9 !important;
}

/* Mobile Optimization for Muscle Diagrams */
@media (max-width: 768px) {
    .progress-tabs {
        margin-bottom: 15px;
    }
    
    .progress-tab-btn {
        padding: 10px 15px;
        font-size: 13px;
        min-height: 44px;
    }
    
    .muscle-view-selector {
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .muscle-view-btn {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 44px;
        min-width: 55px;
    }
    
    .legend-toggle-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .muscle-progress-legend {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }
    
    .legend-item {
        font-size: 11px;
        justify-content: center;
    }
    
    .legend-container {
        margin-bottom: 5px;
    }
    
    .muscle-diagram-container {
        margin: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        overflow: hidden;
        max-height: 80vh;
    }
    
    #muscleDiagramWrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        padding: 0;
        margin: 0;
        overflow: hidden;
        max-height: 80vh;
    }
    
    #muscleDiagramWrapper svg {
        width: 100vw;
        max-width: none;
        height: 80vh;
        max-height: 80vh;
        padding: 0;
        margin: 0;
        display: block;
        transform: scale(1.1);
        transform-origin: center;
        touch-action: pan-y;
    }
    
    /* Ensure muscle click targets are large enough for mobile */
    #muscleDiagramWrapper svg .muscle-group {
        min-width: 44px;
        min-height: 44px;
    }
    
    .muscle-details-panel {
        padding: 15px;
        margin: 0;
    }
    
    .muscle-stats {
        flex-direction: column;
        gap: 12px;
    }
    
    .muscle-stat {
        align-items: center;
        text-align: center;
    }
    
    .muscle-exercises li {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .exercise-progress {
        align-self: flex-end;
    }
}

